Skip to content

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

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

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
danny-avila added a commit that referenced this pull request Oct 28, 2026
…ers (#195)

The keyboard-highlighted option in a click-ui Select popover showed its ring
on three sides only. The popover is as wide as the trigger and clips its
content (overflow: hidden) inside 1px borders, but the option list is also as
wide as the trigger, so options overhang the clip box by 2px on the right.
click-ui draws a 2px ring at a -2px offset, in the option's outer 2px, so the
right side fell entirely in the overhang. The ring also used click-ui's
accent, near-black in the light theme, instead of the app's focus color.

A scoped rule in styles.css, next to the other focus-ring overrides, draws
the ring of a keyboard-highlighted option in --focus-ring-color, 4px inside
the option. data-input-modality is only set on click-ui menu panels, so the
rule reaches click-ui Select, Dropdown and ContextMenu options only, and only
while the keyboard drives them. Dropdown menus (the sidebar user menu, the
row action menus) already showed a whole ring; they now draw the same ring
as the Selects.

e2e/a11y/menus.spec.ts (live backend) measures the highlighted option's ring
in two Selects and the user menu, in light and dark mode: solid, in the focus
color, and inside every clipping ancestor up to the menu.

Supersedes #125 by @dustinhealy, whose root-cause analysis and inset ring
this reuses.
@danny-avila

Copy link
Copy Markdown
Contributor

Thanks @dustinhealy for measuring exactly why the ring's right side was clipped. #195 is now merged and redoes this PR on current main. It keeps your root-cause analysis, the scoped override that insets the ring by 4px, and your recolor commit.

The Title method and Title timing selects you checked are native selects on main now. #195 was checked on the click-ui Selects that remain: the audit log's Target type filter, the configuration Jump to list, "Add field" and the Langfuse destination. #200 then removed a related focus line across the top of every Select popover.

Closing this in favor of #195. If you see the ring clipped anywhere else, please comment or open an issue.

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.

2 participants