Audit finding from #300 (commit 679f9fe)
Severity: medium
Category: ux
File: crates/web/src/profile/controller.rs:114
Obvious fix: yes
Description
install_listeners_once registers a window-level keydown listener that calls set_open.set(None) on every Escape, no matter the focused element or whether the profile card is open. This both consumes work and competes with other Escape handlers (search input, command palette, dialogs).
Impact / Threat
User-facing — Esc-to-cancel in other surfaces can race with this listener; benign for now but error-prone as more modals land.
Suggested fix
Only register the listener while a profile is open (drop / re-add it from an Effect), or guard with if profile_state.with(Option::is_some).
Verify
rg "keydown" crates/web/src/profile/controller.rs
Audit finding from #300 (commit 679f9fe)
Severity: medium
Category: ux
File: crates/web/src/profile/controller.rs:114
Obvious fix: yes
Description
install_listeners_onceregisters a window-levelkeydownlistener that callsset_open.set(None)on every Escape, no matter the focused element or whether the profile card is open. This both consumes work and competes with other Escape handlers (search input, command palette, dialogs).Impact / Threat
User-facing — Esc-to-cancel in other surfaces can race with this listener; benign for now but error-prone as more modals land.
Suggested fix
Only register the listener while a profile is open (drop / re-add it from an
Effect), or guard withif profile_state.with(Option::is_some).Verify
rg "keydown" crates/web/src/profile/controller.rs