fix(ui): return Escape focus to the rail item and read rail direction from the panel

A desktop side panel hides once collapsed, so Escape hands focus to its visible rail item instead of the hidden disclosure. Rail selection reads the panel's collapsed class rather than the store, which follows it a microtask late.
This commit is contained in:
Sameh Khamis committed 2026-10-30 23:56:20 -07:00
1 parent 54b8060f71
commit 231ac4b67b
5 files changed
+81 -5

No files matched your search

+5 -1
View File
@@ -95,7 +95,11 @@ export class PanelNavigation {
*/
select(panelId) {
if (this._destroyed) return;
this._setPanelCollapsed(panelId, this._store.isOpen(panelId), {
// The panel itself, not the store: the store follows its class a
// microtask later, after a same-task setPanelCollapsed.
const panel = document.getElementById(panelId);
if (!panel) return;
this._setPanelCollapsed(panelId, !panel.classList.contains('collapsed'), {
explicit: true,
});
}