feat(ui): open Display on a first desktop visit to the tabbed rail

With every panel closed nothing shows that the sideways labels are launchers, so Display starts expanded for a first-time visitor on a desktop viewport; phones keep it collapsed and a share link decides for itself. A stored choice still wins. When the rail picks its one owner, a panel the visitor or a share link opened outranks one open only by default, so a stored CCTV choice is not displaced by the Display default.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Fable 5.1 committed 2026-10-27 18:26:46 +04:00
1 parent 575ff3678f
commit f383174f3e
6 files changed
+72 -23

No files matched your search

+25
View File
@@ -295,6 +295,31 @@ test('right layout uses keyboard focus when there is no preferred panel', () =>
assert.equal(f.second.classList.contains('collapsed'), false);
});
test('right layout lets a stored or shared choice outrank a panel open only by default', () => {
// Display opens by default on a first desktop visit; a visitor who had
// opened CCTV keeps CCTV as the owner, whatever the rail order.
const f = fixture('right');
f.expand(f.first, 900);
f.expand(f.second, 900);
f.first.dataset.collapsedPreference = 'default';
f.second.dataset.collapsedPreference = 'stored';
f.run();
assert.equal(f.first.classList.contains('rail-owner-collapsed'), true);
assert.equal(f.second.classList.contains('collapsed'), false);
const g = fixture('right');
g.expand(g.first, 900);
g.expand(g.second, 900);
g.first.dataset.collapsedPreference = 'default';
g.second.dataset.collapsedPreference = 'default';
g.run();
assert.equal(
g.first.classList.contains('collapsed'),
false,
'all default: first wins',
);
assert.equal(g.second.classList.contains('rail-owner-collapsed'), true);
});
for (const collapsed of [true, false]) {
test(`right layout ignores a hidden ${collapsed ? 'collapsed' : 'expanded'} panel`, () => {
const baseline = fixture('right');