a11y(2.1.1): navigation primitives — replace hover-only CSS :after label tooltip with focusable Tooltip#3529
Open
rosanusi wants to merge 2 commits into
Open
a11y(2.1.1): navigation primitives — replace hover-only CSS :after label tooltip with focusable Tooltip#3529rosanusi wants to merge 2 commits into
rosanusi wants to merge 2 commits into
Conversation
…primitive
The CSS :after / data-tooltip pattern on the three nav primitives fired only
on :hover with no :focus companion, making labels invisible to keyboard users
in the collapsed rail. Replace all three with the Tooltip component (right,
hide={$navOpen}) so labels appear on focus, are linked via aria-describedby,
and are dismissible with Escape.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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.
Description & motivation 💭
Three navigation primitives (
navigation-item,navigation-button,navigation-badge) rendered their text label as a CSS:afterpseudo-element keyed exclusively to:hoverviagroup-data-[nav=closed]:hover:after:flex. In the collapsed rail, keyboard users tabbing through the icons received no visible label and no accessible description — pseudo-elements are not in the accessibility tree.This PR replaces the
:after/data-tooltipblock in each component with theTooltipprimitive (right,hide={$navOpen}), which provides:<a>/<div role="button">) receives keyboard focusaria-describedbylinkage — screen readers announce the label as a descriptionmouseenter/mouseleavedrives the same popoverhide={$navOpen}suppresses the tooltip when the nav is expanded, since the inline label is already visible in that state — matching the originalgroup-data-[nav=closed]gating.Depends on: the
Tooltipprimitive must supportfocusin/focusout+ Escape-to-dismiss +role="tooltip"+aria-describedby(tracked in1.4.13-tooltip.md). This PR is drafted to land after that work.Files changed (3):
src/lib/holocene/navigation/navigation-item.svelte(finding Install testing #1)src/lib/holocene/navigation/navigation-button.svelte(finding #2a)src/lib/holocene/navigation/navigation-badge.svelte(finding Add navigation #3)SC: 2.1.1 Keyboard (Level A) — current verdict: Fails → Supports (for these three primitives)
Screenshots (if applicable) 📸
No visual change on hover. New behaviour: tooltip appears on keyboard focus in collapsed rail state.
Design Considerations 🎨
None — the Tooltip primitive reuses existing visual styling. Layout classes controlling icon visibility in nav-open state are preserved on the Tooltip wrapper.
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
/(sidebar always present): zero new violations.Checklists
Draft Checklist
1.4.13-tooltip.md— Tooltip primitive must have focus + Escape +aria-describedbysupport before mergingMerge Checklist
1.4.13-tooltip.mdfix is merged and the Tooltip primitive supports keyboard focusIssue(s) closed
Closes findings #1, #2a, #3 from
audit-output/issues/2.1.1-keyboard-audit.md.Docs
Any docs updates needed?
No doc changes needed.
A11y-Audit-Ref: 2.1.1-navigation-css-tooltip-disclosure