Repository navigation
fix(ui): close five primitive a11y and styling gaps - #160
Merged
Merged
Conversation
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Goal: fix every bug on
ui-sdkthat 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'ssxnow works after hydration.Fixes #57
Fixes #69
Fixes #82
Fixes #10
What
base.cssdraws 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, sincedocs/design/states.mdsays components never style focus themselves.CommandInputno longer overwrites theInputGroup'sinput-groupslot, so the group's focus ring and its inline-start padding now apply. With the padding, the text sitsspace.rowfrom the search icon instead ofspace.popup, as the issue describes. The Dropdown Menu half of the issue no longer applies:DropdownMenuInputis gone from the ui-sdk branch.docs/ARCHITECTURE.mdnow says the same in the Command and Input Group rows.aria-sorttoascendingordescendingwhile its column is sorted. Unsorted and non-sortable columns have no attribute. Tables withoutrowSortingFeatureare detected by shape, the same wayisSizedandhasVisibilitywork.[torph-root]rule at runtime. Unlayered rules beat StyleX's layered ones, sosxlost on all six properties that rule sets. The fix moves those six values into Swap Text's own StyleX style. An unlayeredbase.cssrule,[data-slot="swap-text"][torph-root], then sets each of them torevert-layer, which hands them back to the layered cascade. The result:sxwins, and the defaults match Torph's. Before hydration the span is nowinline-block, as it already was after hydration.ui-sdk. The marker's plain[triggerFocused]rule outranks the[media.hover]block'sdefaultin the same layer, so Tab focus shows the chevron with(hover: hover)true. The independent verifier confirmed it on the base.Verification
vpr checkpasses.vpr buildpasses.vpr testpasses (69 files, 548 passed, 1 expected fail).packages/ui/src/lib/constella/focus-ring.css.test.tsx(ui-css) loadsbase.cssinto jsdom. It checks that the slider thumb (single and range), and the Command's input group, match a--focus-ringoutline 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 bybase.css. A Torph upgrade that adds a property fails this test.data-table.test.tsxcovers "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.tsxnow expects theinput-groupslot.solid 1px rgb(187,187,187)in light andrgb(96,96,96)in dark.input-groupand the same outlines.thEmail hasaria-sort="ascending"and the others have none.inline-blockby default. With a layereddisplay: block; white-space: normal, it readsblock normal. Before the fix, Torph's unlayered rule held it atinline-block.slider-{light,dark}.pngandcommand-{light,dark}.pngunder/var/folders/91/3x35r4q15cdgbz3s7y2qmj6c0000gn/T/orbit-autopilot/ui-sdk-fix-all/shots/B-a11y/.Tradeoffs
revert-layerhands back all six properties, not only thedisplayandwhite-spacethe issue names. The cause is the same for all six, and the test keeps the list in step with Torph's rule. Rejected alternatives: addingmaxWidth: 100%to the root fixes only truncation and leavesdisplaystill overridden. Wrapping Torph's CSS in a layer is not possible, because Torph appends its<style>at runtime.aria-sortis left off unsorted sortable columns instead of set tonone. ARIA's practice is to mark only the sorted column(s).space.popuptospace.rowfrom the icon. This is the input group's intended padding, which the overwritten slot had been skipping.Tracker
ui-sdk. The Dropdown Menu half of Command and Dropdown Menu inputs never draw the input group's focus ring #69 is moot becauseDropdownMenuInputwas removed.ui-sdk, not by this PR. Close it after this lands.