Skip to content

fix(ui): close five primitive a11y and styling gaps - #160

Merged
aayushbtw merged 3 commits into
ui-sdkfrom
fix/primitive-a11y-gaps
Nov 21, 2026
Merged

aayushbtw merged 3 commits into
ui-sdkfrom
fix/primitive-a11y-gaps

Conversation

@aayushbtw

@aayushbtw aayushbtw commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Why

Goal: fix every bug on ui-sdk that we can fix on our side, so the branch has no known bugs before it lands on main. This PR closes four small primitive bugs from open issues. Keyboard users get a visible focus ring on the Slider thumb and the Command search field. Screen readers now hear which way a Data Table column is sorted. A Swap Text's sx now works after hydration.

Fixes #57
Fixes #69
Fixes #82
Fixes #10

What

  • Slider thumb shows no focus ring #57 Slider. base.css draws the shared focus ring on [data-slot="slider-thumb"]:has(:focus-visible), as ui-sdk's Slider docs say to. It sits in the same single focus rule as everything else, since docs/design/states.md says components never style focus themselves.
  • Command and Dropdown Menu inputs never draw the input group's focus ring #69 Command. CommandInput no longer overwrites the InputGroup's input-group slot, so the group's focus ring and its inline-start padding now apply. With the padding, the text sits space.row from the search icon instead of space.popup, as the issue describes. The Dropdown Menu half of the issue no longer applies: DropdownMenuInput is gone from the ui-sdk branch. docs/ARCHITECTURE.md now says the same in the Command and Input Group rows.
  • Data Table: sortable headers don't set aria-sort #82 Data Table. Each header cell sets aria-sort to ascending or descending while its column is sorted. Unsorted and non-sortable columns have no attribute. Tables without rowSortingFeature are detected by shape, the same way isSized and hasVisibility work.
  • SwapText: Torph's rule overrides display and white-space passed through sx #10 Swap Text. Torph injects an unlayered [torph-root] rule at runtime. Unlayered rules beat StyleX's layered ones, so sx lost on all six properties that rule sets. The fix moves those six values into Swap Text's own StyleX style. An unlayered base.css rule, [data-slot="swap-text"][torph-root], then sets each of them to revert-layer, which hands them back to the layered cascade. The result: sx wins, and the defaults match Torph's. Before hydration the span is now inline-block, as it already was after hydration.
  • Trace step trigger shows no chevron on keyboard focus #39 Trace is not in this PR. It is already fixed on ui-sdk. The marker's plain [triggerFocused] rule outranks the [media.hover] block's default in the same layer, so Tab focus shows the chevron with (hover: hover) true. The independent verifier confirmed it on the base.

Verification

  • vpr check passes. vpr build passes. vpr test passes (69 files, 548 passed, 1 expected fail).
  • New tests. Each one fails with its fix reverted and passes with the fix in place (checked by reverting each fix and rerunning):
    • packages/ui/src/lib/constella/focus-ring.css.test.tsx (ui-css) loads base.css into jsdom. It checks that the slider thumb (single and range), and the Command's input group, match a --focus-ring outline rule only while focused.
    • packages/ui/src/components/primitives/swap-text.css.test.tsx (ui-css) checks that every property in Torph's injected [torph-root] rule is reverted by base.css. A Torph upgrade that adds a property fails this test.
    • data-table.test.tsx covers "a sorted column's header says which way it sorts": asc, then desc, then moving to another column, and none on the select column.
    • command.test.tsx now expects the input-group slot.
  • Browser test: Playwright (Chromium) against the static build, in light and dark, focus reached with real Tab key presses:
    • Slider thumb outline is solid 1px rgb(187,187,187) in light and rgb(96,96,96) in dark.
    • Command input group has slot input-group and the same outlines.
    • Data Table: after clicking Email, th Email has aria-sort="ascending" and the others have none.
    • Swap Text on the hydrated page reads inline-block by default. With a layered display: block; white-space: normal, it reads block normal. Before the fix, Torph's unlayered rule held it at inline-block.
    • Screenshots: slider-{light,dark}.png and command-{light,dark}.png under /var/folders/91/3x35r4q15cdgbz3s7y2qmj6c0000gn/T/orbit-autopilot/ui-sdk-fix-all/shots/B-a11y/.

Tradeoffs

  • Swap Text: revert-layer hands back all six properties, not only the display and white-space the issue names. The cause is the same for all six, and the test keeps the list in step with Torph's rule. Rejected alternatives: adding maxWidth: 100% to the root fixes only truncation and leaves display still overridden. Wrapping Torph's CSS in a layer is not possible, because Torph appends its <style> at runtime.
  • Data Table: aria-sort is left off unsorted sortable columns instead of set to none. ARIA's practice is to mark only the sorted column(s).
  • Command: the input text moves from space.popup to space.row from the icon. This is the input group's intended padding, which the overwritten slot had been skipping.

Tracker

Slider thumb rings on keyboard focus. Command input keeps the input-group slot, so it rings. Trace step trigger shows its chevron on keyboard focus with a hover pointer. Data Table sets aria-sort on sorted headers. Swap Text's sx overrides Torph's root rule.

Fixes #57, #69, #39, #82, #10
@aayushbtw

Copy link
Copy Markdown
Owner Author

Verifier: PASS+NOTES at d6e75fc on the merge result with ui-sdk c7d3b3f (check, build, 550 tests; browser: slider and Command rings, aria-sort, SwapText sx wins with the morph unchanged). Fix round 0b49151 reverts the no-op Trace change (#39 was already fixed on ui-sdk) and corrects two stale ARCHITECTURE.md rows; lead-reviewed, docs and a revert to the base file, so no new verifier.

@aayushbtw
aayushbtw merged commit 6be0088 into ui-sdk Nov 21, 2026
1 check passed
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