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

+9 -4
View File
@@ -75,10 +75,12 @@ export function layoutRightPanelRail({
(hiddenByRail(panel) || getComputedStyle(panel).display !== 'none'),
);
// One expanded owner: the latest explicit disclosure, else the panel that
// holds keyboard focus, else the first. Peers are presentation-collapsed
// without overwriting saved panel preferences; the marker is distinct from
// the left rail's space-based collapse. Phones present the rail as tab
// sheets that show several panels at once, so they get every panel back.
// holds keyboard focus, else one the visitor or a share link chose over one
// open only by default (panelPositionControls.js marks each), else the
// first. Peers are presentation-collapsed without overwriting saved panel
// preferences; the marker is distinct from the left rail's space-based
// collapse. Phones present the rail as tab sheets that show several panels
// at once, so they get every panel back.
const isMobile = windowRef.matchMedia('(max-width: 720px)').matches;
if (!isMobile) {
const expanded = panels.filter(
@@ -87,6 +89,9 @@ export function layoutRightPanelRail({
const owner =
expanded.find((panel) => panel.id === preferredPanelId) ||
expanded.find((panel) => panel.contains(documentRef?.activeElement)) ||
expanded.find(
(panel) => panel.dataset?.collapsedPreference !== 'default',
) ||
expanded[0];
for (const panel of expanded) {
if (panel === owner) continue;