fix(distribution-toolbar): add focus trap and fix RTL positioning closes #437 - #578
Open
Sycosmile wants to merge 2 commits into
Open
fix(distribution-toolbar): add focus trap and fix RTL positioning closes #437#578Sycosmile wants to merge 2 commits into
Sycosmile wants to merge 2 commits into
Conversation
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.
Context
DistributionFilterToolbaralready exists onmaster(built for #214) and iswired into
DistributionDashboard.tsxwith full URL-param sync. This PR doesnot rebuild the toolbar — it closes the two gaps #437 calls out that #214
missed: keyboard focus loops and RTL wrapping, plus a few smaller a11y gaps
found along the way.
Changes
src/hooks/useFocusTrap.ts— focus-trap + return-focus hook, usedby every popover panel and the mobile sheet
DistributionFilterToolbar.tsx— wires in the hook, adds anaria-livestatus region,
id/aria-controlslinking triggers to panels, hidesdecorative emoji from AT, mobile trigger now literally reads
Filters (n)DistributionFilterToolbar.css— converted physical CSS properties tological ones (
inset-inline-*,padding-inline-*,border-inline-*);fixed the presets panel's un-flippable inline
right: 0positioning;removed a pre-existing RTL rule that was actually double-flipping pill
order back to LTR
DistributionFilterToolbar.a11y-rtl.test.tsx/useFocusTrap.test.tsx— cover focus trap/return-focus, RTL rendering,many-active-filters, and the remaining branches needed for 95%+ coverage
vite.config.ts— added both new files to the coverageinclude/thresholdslists (95%), since neither was tracked beforeVerified locally
npm run lint— cleannpx tsc --noEmit— cleannpx vitest run(scoped) — 40/40 passingDistributionFilterToolbar.tsx100% lines/stmts/funcs, 99.4%branches;
useFocusTrap.ts100% across the boardDistributionFilterToolbar.test.tsx(15 tests) untouched, stillpassing unmodified
Manual QA
Filters (n)<html dir="rtl">— popovers anchor correctly, pills read in the samelogical order, no icon/text overlap in search
Note for maintainers (unrelated, found while testing)
src/pages/DistributionDashboard.tsxcurrently fails to parse for coverageon
master(Rollup:Expected ',', got '{') during a full unscopedvitest run. Pre-existing, not touched by this PR — flagging separately.