Skip to content

fix(site/src): show truncated filter labels and options in a tooltip - #32054

Merged
jeremyruppel merged 6 commits into
mainfrom
a11y/text-spacing-cut-off
Nov 18, 2026
Merged

jeremyruppel merged 6 commits into
mainfrom
a11y/text-spacing-cut-off

Conversation

@chrifro

@chrifro chrifro commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Under WCAG 1.4.12 text spacing overrides (letter spacing 0.12em, word spacing 0.16em, line height 1.5), the SelectFilter trigger and options cut their labels off with no way to read the full text. Examples are "All providers" on AI Gateway sessions and "All resource types" and "All organizations" on the audit log.

Nothing wraps. Labels stay on one line with an ellipsis, and a truncated label shows its full text in a tooltip:

  • Trigger: ComboboxButton shows the tooltip on hover and keyboard focus. It only opens if the label is truncated at that moment, so a spacing override applied after load is still caught. It stays closed while the dropdown is open.
  • Options: the new ComboboxItemLabel shows the tooltip while its option is highlighted, by pointer or arrow keys. cmdk options never get DOM focus, so the tooltip follows cmdk's highlighted value instead. SelectFilter options use it. cmdk highlights the first option when the dropdown opens, so a truncated first option shows its tooltip right away. Escape closes that tooltip first, and a second Escape closes the dropdown.

Filter widths are unchanged from main. With the spacing override, "All providers" (109 > 98px), "All resource types" (156 > 148px) and "All organizations" still truncate at main widths, and the tooltip covers them.

ComboboxButton is shared, so its form callers (workspace version, preset, IdP sync, AI budget dialogs) also get the tooltip when their selected value is truncated. That's additive: on main they truncated with no way to read the full text.

The W3C Understanding document for 1.4.12 allows ellipses caused by spacing overrides "so long as the content is still available". The tooltip keeps the content available.

Closes DEQ-365
Closes DEQ-430

Ticket Surface Before/after screenshots (spacing override on)
DEQ-365 Audit log filters, long options Linear comment
DEQ-430 AI Gateway sessions filters, long options Linear comment
Grouping, decisions, and review notes

Grouping. The batch label text-spacing-cut-off had three eligible tickets with two root causes. DEQ-365 and DEQ-430 come from the shared SelectFilter/ComboboxButton and are fixed here. DEQ-434 comes from StaticWidth in agent metadata and is fixed in #32055.

Revisions.

  1. Wrapped the trigger and options onto several lines. A human reviewer rejected this.
  2. One-line trigger with a tooltip, wider filters, wrapped options.
  3. This version: nothing ever wraps, options get a tooltip too, and the width bumps are reverted at the reviewer's request after a re-check confirmed the issue still exists at main widths.

Tooltip details.

  • Both tooltips are controlled Radix Tooltips that compare the label's scrollWidth to its clientWidth.
  • The trigger tooltip opens through onOpenChange. The option tooltip opens from a layout effect when useCommandState reports the option as highlighted, so it follows the arrow keys without focus moving.
  • Trigger: Escape and moving the pointer onto the tooltip work as WCAG 1.4.13 requires, through the Radix defaults.

Verification.

  • Injected the WCAG spacing stylesheet into Storybook (pages/AuditPage AuditPage, pages/AIBridgePage/ListSessionsFilter Default, components/SelectFilter LongOptionHighlighted and TruncatedTriggerFocused). Truncated triggers show their full label on hover and on focus. The highlighted long option shows its full label, arrow keys move the tooltip, and short options get none. Option heights stay 37 to 40px (one line).
  • Vitest: the focused trigger's accessible description is the full label when truncated and empty when it fits. With a truncated option highlighted, the first Escape dismisses its tooltip and the second closes the dropdown.
  • Unit tests for Filter, Combobox, Command, AuditPage, AIBridgePage, TemplatesPage and ConnectionLogPage pass (331), and so do the Storybook tests for Filter, Combobox, Command, AuditPage and AIBridgePage (228). pnpm check and tsc are clean.
  • OrganizationMembersPage.test.tsx fails 4 tests locally with main's components too, so it's unrelated.

Accessibility audit (axe 4.11, WCAG A/AA and best practices). No new violations. aria-dialog-name and scrollable-region-focusable on the open popover already fail on main, and this diff doesn't touch the popover.

Doc check. No docs describe filter label truncation, so no docs changes are needed.

🤖 Generated by Coder Agents on behalf of @chrifro. Review fixes by Coder Agents on behalf of @jeremyruppel.

@chrifro
chrifro temporarily deployed to main November 11, 2026 14:57 — with GitHub Actions Inactive
@chrifro
chrifro temporarily deployed to main November 11, 2026 14:57 — with GitHub Actions Inactive
@linear-code

linear-code Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

DEQ-430

DEQ-365

@chrifro
chrifro temporarily deployed to main November 11, 2026 15:00 — with GitHub Actions Inactive
@chrifro
chrifro marked this pull request as ready for review November 11, 2026 15:07
@chrifro
chrifro temporarily deployed to main November 11, 2026 15:07 — with GitHub Actions Inactive
@chrifro
chrifro marked this pull request as draft November 12, 2026 14:06
@chrifro
chrifro temporarily deployed to main November 12, 2026 14:06 — with GitHub Actions Inactive
@chrifro chrifro changed the title fix(site/src/components): wrap SelectFilter labels instead of truncating fix(site/src): show truncated filter labels in a tooltip Nov 12, 2026
@chrifro
chrifro temporarily deployed to main November 12, 2026 14:08 — with GitHub Actions Inactive
@chrifro
chrifro marked this pull request as ready for review November 12, 2026 15:30
@chrifro
chrifro temporarily deployed to main November 12, 2026 15:30 — with GitHub Actions Inactive
…ping

Options stay on one line and show the full label in a tooltip while highlighted and truncated. Reverts the per-page filter width bumps; the trigger tooltip covers those labels.
@chrifro
chrifro temporarily deployed to main November 13, 2026 09:48 — with GitHub Actions Inactive
@chrifro chrifro changed the title fix(site/src): show truncated filter labels in a tooltip fix(site/src): show truncated filter labels and options in a tooltip Nov 13, 2026
@chrifro
chrifro temporarily deployed to main November 13, 2026 10:06 — with GitHub Actions Inactive
@chrifro
chrifro requested a review from aqandrew November 13, 2026 12:51

@jeremyruppel jeremyruppel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[reviewer-agent] round 1: changes needed at 3bbb8e2.

Scope, size (111 non-test lines), tickets, and required CI pass. The trigger tooltip works (shows on focus/hover only when truncated, Escape dismisses), verified in Storybook with the WCAG 1.4.12 spacing override. One blocking issue in the option tooltip, below.

Nits (optional):

  • The option tooltip opens by itself when the dropdown opens, because cmdk highlights the first item. With the fix below, a keyboard user then needs two Escapes to close the dropdown. Fine to keep, but say so in the PR body.
  • Combobox.tsx:109: useCombobox().open states the intent more directly than props["aria-expanded"].
  • Combobox.tsx:244: use a named ComboboxItemLabelProps type.
  • SelectFilter.stories.tsx:101-121: LongLabels gets its open, option-tooltip state only from the inherited meta play. Name the two stories for their state (for example LongOptionHighlighted, TruncatedTriggerFocused) and make play explicit on both.
  • SelectFilter.test.tsx:97-107 mostly duplicates the LongLabels story; the Escape regression test below is the more valuable one.

Follow-ups filed (pre-existing, not blocking):

  • DEQ-636 SelectFilter dropdown dialog has no accessible name
  • DEQ-635 ComboboxButton silently ignores className and children from callers

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

}, [isHighlighted]);

return (
<Tooltip open={isTooltipOpen}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[blocking] The option tooltip is controlled with no onOpenChange, and it sits above the popover in Radix's dismissable-layer stack, so it captures Escape. While a truncated option is highlighted, Escape neither dismisses the tooltip (WCAG 1.4.13 dismissible) nor closes the dropdown, which is a keyboard regression from main for every SelectFilter.

Repro: Storybook components/SelectFilter LongLabels with the spacing override, open the dropdown (first option is truncated and highlighted), press Escape three times: the dropdown and tooltip stay open. Only after ArrowDown to a short option does Escape close it. Reproduced independently in jsdom too; on main the first Escape closes the dropdown.

Suggested fix: handle close requests, e.g. onOpenChange={(open) => { if (!open) setIsTooltipOpen(false); }}, so the first Escape hides the tooltip and the next closes the dropdown. Add a regression test that presses Escape with a truncated option highlighted and asserts the tooltip is gone and then the trigger reports aria-expanded="false".

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

@jeremyruppel
jeremyruppel marked this pull request as draft November 18, 2026 20:48
The option tooltip captured Escape without closing, so the dropdown could
not be closed by keyboard while a truncated option was highlighted.

Also reads the popover state from the combobox context, names the
ComboboxItemLabel props type, and names the long-label stories for the
state they show.

@jeremyruppel jeremyruppel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 38ed012 after taking over from the author agent. The round 1 blocking issue is fixed: Escape now closes a truncated option's tooltip and then the dropdown, and a regression test covers it. The nits are addressed too. Follow-ups DEQ-635 and DEQ-636 track problems that already exist on main.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

@jeremyruppel
jeremyruppel merged commit a065cd2 into main Nov 18, 2026
37 checks passed
@jeremyruppel
jeremyruppel deleted the a11y/text-spacing-cut-off branch November 18, 2026 21:40
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
docs-preview — 38ed0128 Deployed Nov 18, 2026 by jeremyruppel via cleanup #229
main — 38ed0128 Deployed Nov 18, 2026 by jeremyruppel via cla #259891
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants