fix(web): a11y escape + initial focus on relay popover#409
Merged
Conversation
Popover advertises `aria-haspopup="dialog"` but had no Escape handler and no focus pull. Global keybinding stack does not own this popover — local listener required. Seed focus on settings link so keyboard users land inside the dialog. Mark `aria-modal="false"` — popover does not trap focus. Tests: Escape closes, settings link focused on open, aria-modal="false". Closes #352
This was referenced Apr 27, 2026
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
Relay-signal popover claims
aria-haspopup="dialog"but keyboard users got stranded:keybindings::installdoes not know about this popover — Escape was a no-op while focus was inside.Issue title says "focus trap" but body says non-modal. Trapping focus on a non-modal popover is wrong — would break Tab-out. Seed focus instead, mark
aria-modal="false".Fix
crates/web/src/components/relay_signal_button.rs:on:keydownon.relay-popover— Escape setsopen=false, stops propagation so global handler does not double-fire.Effecton open transition pulls focus to settings-link button viaNodeRef+request_animation_frame(same pattern asConfirmDialog).aria-modal="false"+tabindex="-1"on the dialog so it can take focus and AT knows it is non-modal.No focus trap — Tab continues out of the popover normally.
Verify
cargo fmt --checkcleancargo clippy --workspace --all-targets -- -D warningscleancargo check -p willow-web --tests --target wasm32-unknown-unknownclean (Firefox + geckodriver not installed in this env, so wasm-pack browser run is deferred to CI; compile coverage proves the new tests build)cargo test -p willow-web --lib72 passedcrates/web/tests/browser.rs:relay_signal_button_escape_closes_popover— opens popover, dispatches Escape keydown, asserts popover unmounts +aria-expanded="false"relay_signal_button_focuses_settings_link_on_open— opens popover, waits one frame, assertsdocument.activeElementis the settings-link buttonrelay_signal_button_popover_is_non_modal— assertsaria-modal="false"+role="dialog"Closes #352
Generated by Claude Code