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

+12
View File
@@ -103,6 +103,18 @@ test('selecting an item toggles its panel explicitly', async () => {
ui.destroy();
});
test('selecting right after a same-task collapse reads the panel, not the store', async () => {
const { left, calls, ui, navigation } = setup();
await nextTick();
// A host collapses Data Layers and selects its item in one task, before
// the store follows the class change.
left.querySelector('#data-panel').classList.add('collapsed');
navigation.select('data-panel');
assert.deepEqual(calls, [['data-panel', false, { explicit: true }]]);
navigation.destroy();
ui.destroy();
});
test('the rails follow disclosure and availability changes', async () => {
const { left, right, ui, navigation } = setup();
document.getElementById('data-panel').classList.add('collapsed');