Repository navigation
a11y: fix the 39 todo stories' component bugs; popup stories wait; ratchet bans modern colour literals - #22
Merged
Merged
Conversation
…it; ratchet bans modern colour literals Components: - SidebarControls' account button and the collapsed OrgSwitcher start their names with the initials they show (label in name). - Collapsed Sidebar links carry their label; the child list's rail is the <ul>'s ::before, so the list holds only <li>s. - The interface-scale popover is named. - SegmentMeter takes an optional label; MeterCard passes its own. - CommandList passes aria-label/aria-labelledby to its listbox. - CommandPanel stops being a listbox while a CommandEmpty is inside it; an empty Select popup stops being one too. - DataTable's scroller, a block Code and markdown fences take keyboard focus; the table's focus rings the whole card. - GFM task-list checkboxes are labelled. - Combobox's Show options button is out of the tab order again, as Base UI's own trigger is; Button had put its tabIndex back. Stories: every todo mark removed; popup stories wait for the popup before axe runs (org switcher, sidebar menus, scale popover and hint, context menu, hint overlay, command menu, app shell's command menu, toasts). Ratchet: colour-literal also bans oklch(), oklab(), lab(), lch(), hwb() with arguments, and a color-mix() of a named colour.
A GFM task's checkbox takes its item's words as its name, not a generic "Task" (the fallback when an item has none). The combobox comment names the real source of the stray tabIndex, and the color-mix() branch says what it cannot see.
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.
Linear: ATL-870 (follow-up to #18: the 39 "todo" stories, popup waits, the ratchet's colour rule). Version not bumped. The README has no unreleased section, so the release note is at the end for you to fold in.
Summary
Todo marks: all 39 removed. None remain.
::beforelistboxwhile emptyCommandList aria-labelSegmentMeter label<pre>/ block<code>focusableThe popup waits did not expose any new component bugs.
Behaviour changes worth knowing:
tabIndex -1for a trigger outside the popup, and the APG pattern: the input opens the list from the keyboard. Without it, axe fails all 5 open stories (checked by reverting the line).Known gaps, left as is:
showClearand the popup open, the clear button sits in the aria-hidden region. Base UI sets it totabIndex -1, so axe doesn't flag it, but a screen reader can't reach it while the list is open. No story covers this.var(--a, white)) or on a later line of a multi-linecolor-mix(), because the ratchet reads line by line. It is case-sensitive, like thergbandhslbranches. A local helper function namedlab(…),lch(…)orhwb(…)would be flagged.Evidence
bun run test:storybookshowed 590 passed, 39 of them as todo warnings.After: 590 passed with no todo marks, on 3 consecutive runs.
the colour-literal rule.oklch(0.7 0.12 250),bg-[oklab(…)],lab(…),lch(…),hwb(…),color-mix(in srgb, white 10%, …)andbg-[color-mix(in_srgb,40%_red,…)].currentColor/transparent,srgb-linear/display-p3/longer hue,${tone}interpolations,oklch()in prose andcollab(x).rgb()andhsl()cases.src/features,src/componentsandsrc/devhave 0 hits on the new branches.Staticnow assertsgetByRole("checkbox", { name: "Port the sort" }).shots/ATL-870-a11y/. Focused data table, code block and fence; the open popups; the empty Select.Merge Danger
Door: two-way
Each fix is local to one component. Reverting the commits restores the todo marks.
Blast Radius: consumers
Release note (for the upgrade notes): a11y fixes, with no visual change except focus rings.
SegmentMetertakeslabel, andCommandListtakesaria-label/aria-labelledby.Codeand markdown fences are tab stops.CommandPanel/Selectpopup is not a listbox."<initials>, account — <name>", and the collapsed org switcher"<initials>, <name>".colour-literalalso bansoklch(),oklab(),lab(),lch(),hwb()and acolor-mix()of a named colour.