Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
The approach looks sound: a single base-layer :focus-visible default, component overrides only where a ring would be clipped, and the V1 focus tokens fully removed with no remaining references in the repo. I couldn't check the rings visually because the sandbox has no browser; the before/after screenshots in the description cover that. Typecheck passes in all four changed packages, packages/app builds, and the nearby unit tests pass (the session-ui failures are Playwright files that fail the same way on base).
Public API: @opencode/ui is published to npm, so this is breaking for anyone outside the repo using these:
- Removed the
@opencode/ui/checkboxexport (and its stylesheet fromstyles/index.css). - Removed the CSS variables
--shadow-xs-border-focus,--shadow-xs-border-critical-focus,--border-focus,--border-{strong,weak,weaker}-focus,--border-interactive-focus,--icon-{,weak-,strong-}focusand--input-focus, along with their Tailwind colour/shadow utilities and resolver tokens. ColorValuegainsRgbaColor, andwithAlphanow returnsRgbaColor. Both are additive.
Custom desktop themes that override any of the removed tokens still load; the override just has no effect now. Nothing inside the repo depends on the removed items.
Minor scope note: a few edits are unrelated to focus rings and could be split out to keep this diff focused. Examples: the type-cast cleanups in theme/resolve.ts, color.ts, unpaid.tsx, file-search.tsx and project-row.tsx; the removed navigator guard in home/sessions/view.tsx; and the new bound-handler (tuple) support in ProjectTrigger's onKeyDown.
|
This also fixes #56891 (dropdowns in Settings → Preferences show no focus when you Tab to them). On current With this PR merged on top of |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Every keyboard focus indicator in the desktop and web app now draws the V2 ring,
2px solid var(--v2-border-border-focus). The V1 focus tokens are deleted, so the old styles cannot come back.How each element shows focus
flowchart LR F[Keyboard focus] --> A{Text field?} A -- yes --> Field["1px blue field outline"] A -- no --> B{"Option in an arrow-key list?<br/>menu, picker, palette"} B -- yes --> Hi["V2 hover highlight<br/>(model and provider picker rows)"] B -- no --> C{"Flush with a clip edge,<br/>or a tab, row or scroll region?"} C -- yes --> In["Ring inside, offset -2px"] C -- no --> Out["Ring outside, offset 2px"]packages/ui/src/styles/base.cssdraws the outside ring on any:focus-visibleelement that a component does not style, in place of the browser ring. Raw buttons and links are V2 without extra classes.--shadow-xs-border-focus,--shadow-xs-border-critical-focus,--border-focus,--border-{strong,weak,weaker}-focus,--border-interactive-focus,--icon-{,weak-,strong-}focusand--input-focusare gone fromtheme.css, the generated Tailwind colours and the runtime theme resolver. The unused V1Checkboxwas the last stylesheet built on them, so it is deleted.What changed
currentColorand text-accent rings now use the standard ring; picker rows usefocus-visible:instead offocus:; Tab stops that only changed background now show the ring[data-timeline-key]:has(:focus-visible)); toast content usesoverflow: clipwith a 4px margin; padding moved inside the composer controls, settings subtabs, breadcrumbs, workspace rows and WSL catalog scrollers; flush elements draw the ring insideBefore and after (keyboard focus)
beta; its matching one-line ring fix goes there separately.Added by the opencode bot (AI-generated).
Public API: removes the @opencode/ui/checkbox export and the V1 focus CSS variables and Tailwind utilities from @opencode/ui (breaking for outside users of those)