refactor: port hook lifecycle and a11y fixes from crit-web for parity#369
Merged
tomasz-tomczyk merged 3 commits intomainfrom Apr 26, 2026
Merged
refactor: port hook lifecycle and a11y fixes from crit-web for parity#369tomasz-tomczyk merged 3 commits intomainfrom
tomasz-tomczyk merged 3 commits intomainfrom
Conversation
Ports the a11y fix from crit-web for review-page parity. Replaces the group/aria-pressed pattern with the standard radiogroup semantics: - role="radiogroup" parent; role="radio" + aria-checked + roving tabindex on each filter button - ArrowLeft/Right/Up/Down (wrap), Home/End keyboard navigation - Click + keyboard route through shared activateFilterBtn helper Two other crit-web fixes (panel-creation idempotency, trackedSetTimeout cleanup) don't apply here — crit's frontend is a single-load IIFE with static panel markup and no destroy phase, so the underlying remount / teardown races those fixes address don't exist on this side. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #369 +/- ##
==========================================
+ Coverage 67.10% 67.12% +0.01%
==========================================
Files 18 18
Lines 7823 7823
==========================================
+ Hits 5250 5251 +1
+ Misses 2181 2180 -1
Partials 392 392
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
#368 migrated crit-hide-resolved from localStorage to a host-scoped cookie (port-stable across crit invocations). Test still asserted the old localStorage value and failed on every run since. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Parity port from crit-web's release audit (crit-web#129). Three fixes were identified there; only one ports cleanly to crit:
Applied — comments-panel filter pill a11y
frontend/index.html:role="radiogroup"parent; each button isrole="radio"+aria-checked+ rovingtabindex(replacesaria-pressed).frontend/app.js: ArrowLeft/Right/Up/Down (wrap), Home/End keyboard navigation. Click + keyboard route through sharedactivateFilterBtnhelper. Re-render path keepsaria-checked/tabindexin sync.Skipped — lifecycle fixes (don't apply here)
mounted(), so duplicate-mount and stale-orphan races are real. Here, the panel is static markup infrontend/index.html(lines 129-151). No creation-on-mount path → no fix needed.trackedSetTimeoutcleanup: crit's frontend is a top-level IIFE loaded once. There is no destroy/teardown phase; pending timers naturally die with the document on full navigation. Adding the helper without a destroyed callsite would be dead code.The fourth audit fix (
crit-hide-resolvedcache) already shipped via #368.Test plan
node --check frontend/app.js— clean🤖 Generated with Claude Code