Skip to content

💍 fix: Unclip the Keyboard Highlight Ring in Select Popovers - #125

Open
dustinhealy wants to merge 3 commits into
mainfrom
fix/click-ui-select-clip
Open

💍 fix: Unclip the Keyboard Highlight Ring in Select Popovers#125
dustinhealy wants to merge 3 commits into
mainfrom
fix/click-ui-select-clip

Conversation

@dustinhealy

@dustinhealy dustinhealy commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Keyboard-navigating the options of any click-ui Select shows the highlight ring on only three sides; the right edge is cut off by the popover.

Root cause (measured in the browser): click-ui's Select popover content is overflow: hidden with 1px borders, so its inner clip box is 2px narrower than the popover, but the option list and rows render at the full trigger width and overhang the clip box by exactly 2px on the right. click-ui's keyboard-highlight rule draws a 2px outline at outline-offset: -2px on the active option, placing the ring in the outermost 2px band, so the right band falls entirely inside the clipped overhang. Pixel sampling on the highlighted row confirmed zero outline pixels between the option's visible right edge and the popover border. Systemic to every click-ui Select in the app and theme-independent.

Fix: a scoped override in styles.css, following the existing scoped focus-override convention, insets the ring past the overhang: [data-input-modality='keyboard'] [data-highlighted] { outline-offset: -4px !important; }. The selector pair only matches click-ui popover descendants because the input-modality attribute lives on the click-ui popover content element; other click-ui popovers (e.g. the user-menu dropdown) also pick up the inset, verified visually with no regression (their rings stay complete and comfortably inside the menu). The width mismatch itself is a click-ui bug worth reporting upstream; this override keeps the ring fully visible regardless.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

Verified in the browser at 1280x800 with keyboard modality: the highlighted option's ring now renders on all four sides (computed outline-offset: -4px, outline pixels present at the right band inside the popover), checked on multiple selects (Title method, Title timing). jsdom cannot assert outline geometry, so the proof is visual plus the pixel sampling; no unit test carries signal for this rule.

Full gates green: bunx tsc --noEmit, bunx eslint src/ --max-warnings 0, bunx vitest run (799/799), bun run build, prettier on the touched file.

Before/after proof:

04_AI-1772_select-option-ring

Test Configuration:

  • Local dev server against local LibreChat backend

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

Inline @clickhouse/click-ui in vitest server deps and exclude .claude/** from test discovery. click-ui 0.9.1 ships ESM that imports .css files, which Node's loader cannot parse, so Vitest must process the package through Vite.
click-ui renders the select option list at the trigger width while the popover border-box loses 2px to its 1px borders, so the overflow hidden popover clips the outermost 2px of the options on the right.

The keyboard-highlight ring click-ui draws on the active option (2px outline at -2px offset) falls entirely inside that clipped band on the right edge, so the ring rendered on three sides only.

Inset the ring by the overhang with a scoped override on the click-ui modality attribute pair, following the existing scoped focus overrides in styles.css.
@dustinhealy dustinhealy changed the title 🐛 fix: Unclip the Keyboard Highlight Ring in Select Popovers 💍 fix: Unclip the Keyboard Highlight Ring in Select Popovers Aug 11, 2026
…oken

click-ui paints the keyboard-highlight ring on popover options with its own accent token, which the app theme never overrides, so the ring rendered near-black in light mode while every other focus ring uses the outline token. The options are not buttons, so the global focus-visible override never reaches them; the existing scoped popover rule now also sets the outline color to var(--cui-color-outline), matching the app focus convention in both themes.
@dustinhealy
dustinhealy marked this pull request as ready for review August 11, 2026 23:04
Base automatically changed from chore/click-ui-0.9.1 to main August 14, 2026 14:54
@dustinhealy

Copy link
Copy Markdown
Contributor Author

@codex review

@dustinhealy
dustinhealy marked this pull request as draft August 14, 2026 15:05
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: afac16901a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dustinhealy
dustinhealy marked this pull request as ready for review August 14, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant