♿️(frontend) close side panel with Escape key - #1507
Conversation
useEscapeToClose: close panel on Escape, restore focus, let chat input bubble
e94597a to
72af826
Compare
Confidence Score: 4/5This is close, but the subpanel keyboard path should be fixed before merging.
src/frontend/src/features/rooms/livekit/components/SidePanel.tsx Important Files Changed
|
| activeKey: activePanelId, | ||
| }) | ||
|
|
||
| useEscapeToClose(isSidePanelOpen, asideRef, closePanel) |
There was a problem hiding this comment.
Subpanel Trigger Can Disappear
When Escape closes the panel from inside a subpanel, the close path clears both activePanelId and activeSubPanelId. If focus was last captured from the subpanel opener inside the side panel, that element can be unmounted before focus restoration runs, so document.contains(trigger) fails and keyboard focus is not restored to a visible trigger.
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Show "(Escape)" in close tooltip, add aria-describedby for SR keyboard shortcut hint.
|



Purpose
Side panels can be closed with the ✕ button, but keyboard users have no equivalent shortcut. Escape should close the panel and return focus to the trigger button.
Proposal