From 28ee3bfc3748c60af1dba027a655fe344b1ea168 Mon Sep 17 00:00:00 2001 From: Said Turksever Date: Fri, 6 Nov 2026 00:47:52 +0000 Subject: [PATCH 1/5] Keep app shortcuts off Cmd/Ctrl/Alt combos; F collapses the layer panel like its button --- src/ui/applicationShell.js | 1 + src/ui/applicationShortcuts.js | 5 +++++ src/ui/displayBindings.js | 4 ++-- src/ui/visualInput.test.mjs | 14 ++++++++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/ui/applicationShell.js b/src/ui/applicationShell.js index ac921b34b5..1e4daaefdb 100644 --- a/src/ui/applicationShell.js +++ b/src/ui/applicationShell.js @@ -542,6 +542,7 @@ export class StyleManager extends ShellFacade { _toggleOrbit: (...args) => this._toggleOrbit(...args), toggleCleanView: (...args) => this.toggleCleanView(...args), _toggleCctvEnabled: (...args) => this._toggleCctvEnabled(...args), + _togglePanel: (panelId) => this._panelChrome._togglePanel(panelId), _setBloomEnabled: (...args) => this._setBloomEnabled(...args), _setBloomIntensity: (...args) => this._setBloomIntensity(...args), _setSharpenEnabled: (...args) => this._setSharpenEnabled(...args), diff --git a/src/ui/applicationShortcuts.js b/src/ui/applicationShortcuts.js index 57214a570d..d83e0caab2 100644 --- a/src/ui/applicationShortcuts.js +++ b/src/ui/applicationShortcuts.js @@ -27,6 +27,11 @@ export function bindApplicationShortcuts({ event.target?.matches?.('select, input, textarea') || event.target === searchInput; if (isFormControl && event.key !== 'Escape') return; + // Browser and OS shortcuts (Cmd+C, Ctrl+F, Alt+1…) are not ours. + if (event.metaKey || event.ctrlKey || event.altKey) { + if (event.key === 'Escape') actions.dismissSearch(); + return; + } if (STYLE_KEYS[event.key]) actions.setStyle(STYLE_KEYS[event.key]); if (event.key === 'Escape') actions.dismissSearch(); diff --git a/src/ui/displayBindings.js b/src/ui/displayBindings.js index 73c4fbee68..5a00dc6631 100644 --- a/src/ui/displayBindings.js +++ b/src/ui/displayBindings.js @@ -64,8 +64,8 @@ export class DisplayBindings { }, toggleOrbit: () => this._toggleOrbit(), toggleCleanView: () => this.toggleCleanView(), - toggleLayers: () => - document.getElementById('data-panel').classList.toggle('active'), + // Same collapse as the panel's own button, so its rail entry stays. + toggleLayers: () => this._togglePanel('data-panel'), cycleDetection: () => { this.shareLinkManager?.claimRestoreLane?.('visual'); this.claimDetection(); diff --git a/src/ui/visualInput.test.mjs b/src/ui/visualInput.test.mjs index d49a19bda0..82ca6beccd 100644 --- a/src/ui/visualInput.test.mjs +++ b/src/ui/visualInput.test.mjs @@ -117,9 +117,19 @@ test('the supplied search target retains editing even without form markup', () = assert.deepEqual(f.calls, [['dismissSearch']]); }); -test('shortcut extraction does not change repeat or modifier policy', () => { +test('browser shortcuts with Cmd, Ctrl or Alt never reach app shortcuts', () => { const f = shortcuts(); - f.press('h', new Element(), { repeat: true, ctrlKey: true }); + for (const modifier of ['metaKey', 'ctrlKey', 'altKey']) + for (const key of ['1', 'h', 'o', 'v', 'f', 'd', 'c']) + f.press(key, new Element(), { [modifier]: true }); + assert.deepEqual(f.calls, []); + f.press('Escape', new Element(), { metaKey: true }); + assert.deepEqual(f.calls, [['dismissSearch']]); +}); + +test('a held key still repeats its shortcut', () => { + const f = shortcuts(); + f.press('h', new Element(), { repeat: true }); assert.deepEqual(f.calls, [['toggleHud']]); }); From d3904b9503b203d7541f8f29f362c9e4efc7e720 Mon Sep 17 00:00:00 2001 From: Said Turksever Date: Fri, 6 Nov 2026 11:59:27 +0000 Subject: [PATCH 2/5] Changelog: 1598 fragment --- changelog.d/1598-shortcuts-modifier-keys.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelog.d/1598-shortcuts-modifier-keys.md diff --git a/changelog.d/1598-shortcuts-modifier-keys.md b/changelog.d/1598-shortcuts-modifier-keys.md new file mode 100644 index 0000000000..80c30dde51 --- /dev/null +++ b/changelog.d/1598-shortcuts-modifier-keys.md @@ -0,0 +1,5 @@ +- Keep single-key app shortcuts off Cmd, Ctrl and Alt combinations, so Cmd+F, + Cmd+C and Cmd+R reach the browser instead of hiding the layer panel or + switching layers on. `F` now collapses the layer panel the way its button + does, instead of hiding the panel and the button that brings it back + (asturksever, #1598). From 89ebfa85d1f1f82fc91fef1f938b468369d9f422 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Wed, 18 Nov 2026 19:00:04 +0400 Subject: [PATCH 3/5] Changelog: describe only the F change for 1598 --- changelog.d/1598-f-collapses-data-layers.md | 4 ++++ changelog.d/1598-shortcuts-modifier-keys.md | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 changelog.d/1598-f-collapses-data-layers.md delete mode 100644 changelog.d/1598-shortcuts-modifier-keys.md diff --git a/changelog.d/1598-f-collapses-data-layers.md b/changelog.d/1598-f-collapses-data-layers.md new file mode 100644 index 0000000000..e0f4df4973 --- /dev/null +++ b/changelog.d/1598-f-collapses-data-layers.md @@ -0,0 +1,4 @@ +- `F` now collapses and reopens the Data Layers panel the way the panel's own + button does, and its rail entry stays. Before, `F` hid the panel together + with its rail entry, so only another `F` brought it back (asturksever, + #1598). diff --git a/changelog.d/1598-shortcuts-modifier-keys.md b/changelog.d/1598-shortcuts-modifier-keys.md deleted file mode 100644 index 80c30dde51..0000000000 --- a/changelog.d/1598-shortcuts-modifier-keys.md +++ /dev/null @@ -1,5 +0,0 @@ -- Keep single-key app shortcuts off Cmd, Ctrl and Alt combinations, so Cmd+F, - Cmd+C and Cmd+R reach the browser instead of hiding the layer panel or - switching layers on. `F` now collapses the layer panel the way its button - does, instead of hiding the panel and the button that brings it back - (asturksever, #1598). From 3a24768a2dd85175d24ca24604472c4bda05b351 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Wed, 18 Nov 2026 19:02:17 +0400 Subject: [PATCH 4/5] Test that F collapses Data Layers through PanelChrome and keeps its rail entry --- src/ui/panelChromeButtons.test.mjs | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/ui/panelChromeButtons.test.mjs b/src/ui/panelChromeButtons.test.mjs index 75678f8e62..75d9e72493 100644 --- a/src/ui/panelChromeButtons.test.mjs +++ b/src/ui/panelChromeButtons.test.mjs @@ -14,6 +14,8 @@ import PanelCollapseButton from './rail/PanelCollapseButton.vue'; import RailPanel from './rail/RailPanel.vue'; import UiPanel from './kit/UiPanel.vue'; import { usePanelChromeStore } from './stores/panelChrome.js'; +import { useDisplayStore } from './stores/display.js'; +import { DisplayBindings } from './displayBindings.js'; import CommandDockView from './views/CommandDockView.vue'; function mount(t, component) { @@ -462,3 +464,46 @@ test('the accordion closes peers through the real store, and opens them again', assert.equal(panels[0].className, ''); chrome.destroy(); }); + +test('F collapses Data Layers like its button and keeps its rail entry', (t) => { + document.body.innerHTML = ` +
`; + const panel = document.getElementById('data-panel'); + const store = usePanelChromeStore(createPinia()); + const chrome = panelChrome(store); + followPanelState(store, 'data-panel', panel); + chrome._disclosurePanelIds = new Set(['data-panel']); + const bindings = new DisplayBindings({ + viewer: null, + services: { isScopeMaskEnabled: () => false, cycleDetectionMode() {} }, + elements: { _locationSearch: document.createElement('input') }, + operations: { + _setScope() {}, + _togglePanel: (panelId) => chrome._togglePanel(panelId), + }, + readState: () => ({}), + claimDetection() {}, + displayStore: useDisplayStore(createPinia()), + }); + bindings._initUI(); + t.after(() => { + bindings.destroy(); + chrome.destroy(); + }); + const press = (init = {}) => + document.body.dispatchEvent( + new KeyboardEvent('keydown', { key: 'f', bubbles: true, ...init }), + ); + + press(); + assert.equal(store.panels['data-panel']?.collapsed, true); + assert.ok(panel.classList.contains('collapsed')); + // `active` is what keeps Data Layers in the rail. + assert.ok(panel.classList.contains('active')); + press({ metaKey: true }); + assert.equal(store.panels['data-panel'].collapsed, true, 'Cmd+F is not ours'); + press(); + assert.equal(store.panels['data-panel'].collapsed, false); + assert.ok(!panel.classList.contains('collapsed')); + assert.ok(panel.classList.contains('active')); +}); From c7df3c67982c0a905796b28328f6f5b218484c1f Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Thu, 19 Nov 2026 15:00:17 +0400 Subject: [PATCH 5/5] Hand focus to a rail entry when a panel folds it away - When F or a panel's collapse button folds a panel that holds the focus, the focus moves to that panel's visible rail entry. The same happens when opening Data Layers folds a peer panel that held it, and in Cockpit the focus moves to Contact's expand button when that card folds. - The `shownBy: 'active'` rail gate is gone: nothing removes `.active` from Data Layers any more, so a rail entry now follows `panel.hidden`. - CURRENT-STATE says what F does, and the panel catalog comment no longer says F toggles `.active`. --- changelog.d/1598-f-collapses-data-layers.md | 7 +- docs/CURRENT-STATE.md | 5 +- src/mapSourceFocus.test.mjs | 2 +- src/panelEscape.test.mjs | 2 +- src/ui/panelChrome.js | 57 ++++++--- src/ui/panelChromeButtons.test.mjs | 122 +++++++++++++++++++- src/ui/panelNavigation.js | 7 +- src/ui/panelNavigation.test.mjs | 6 +- src/ui/panelRailCatalog.js | 11 +- 9 files changed, 179 insertions(+), 40 deletions(-) diff --git a/changelog.d/1598-f-collapses-data-layers.md b/changelog.d/1598-f-collapses-data-layers.md index e0f4df4973..42bdc9d833 100644 --- a/changelog.d/1598-f-collapses-data-layers.md +++ b/changelog.d/1598-f-collapses-data-layers.md @@ -1,4 +1,7 @@ - `F` now collapses and reopens the Data Layers panel the way the panel's own button does, and its rail entry stays. Before, `F` hid the panel together - with its rail entry, so only another `F` brought it back (asturksever, - #1598). + with its rail entry, so only another `F` brought it back. When `F` or a + panel's collapse button hides a panel that holds the focus, including one + the opened panel folds away, the focus moves to that panel's rail entry; + in Cockpit, focus in the Contact card it folds moves to the card's expand + button (asturksever, #1598). diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 879c2135fb..f3b2976028 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -3252,7 +3252,10 @@ Browser acceptance: `QA_BASE_URL=http://127.0.0.1:4173 node scripts/qa-segmented `ui/input` supplies the bubbling application shortcut listener and generated shader-parameter rows. Number/style keys, H/O/V/F/D/C actions, native form-control -typing and Escape behavior retain their existing mappings. A shortcut key held +typing and Escape behavior retain their existing mappings. `F` collapses and +reopens Data Layers the way the panel's own collapse button does, so its rail +entry stays; if focus was inside the panel, it moves to that rail entry. +A shortcut key held with Cmd, Ctrl or Alt runs no shortcut, so the browser's own chord (Cmd+C to copy, Cmd+F to find, Cmd+1 to switch tab) does not also toggle CCTV, the layers panel or a style; Shift does not count, and Escape dismisses search either way. diff --git a/src/mapSourceFocus.test.mjs b/src/mapSourceFocus.test.mjs index 22d00f2cf8..a3b24ba23d 100644 --- a/src/mapSourceFocus.test.mjs +++ b/src/mapSourceFocus.test.mjs @@ -110,7 +110,7 @@ function harness({ hidden = false, selected = true, noChips = false } = {}) { window.performance = { now: () => now }; document.defaultView = window; const methods = new Function('createHoverDisclosure', 'collapsePanelOnEscape', 'document', 'window', 'clearTimeout', 'performance', 'requestAnimationFrame', 't', 'msg', 'readPanelState', - `return ({${shellMethod('_initAutoHoverPanel').toString()},\n${shellMethod('_collapsePanelOnEscape').toString()},\n${shellMethod('setPanelCollapsed').toString()},\n${shellMethod('_presentPanel').toString()},\n${shellMethod('_shownPanel').toString()}});`)( + `return ({${shellMethod('_initAutoHoverPanel').toString()},\n${shellMethod('_collapsePanelOnEscape').toString()},\n${shellMethod('_railFocusStand').toString()},\n${shellMethod('setPanelCollapsed').toString()},\n${shellMethod('_presentPanel').toString()},\n${shellMethod('_shownPanel').toString()}});`)( createHoverDisclosure, collapsePanelOnEscape, document, window, (id) => timers.delete(id), { now: () => now }, () => {}, t, msg, readPanelState, ); const saves = []; diff --git a/src/panelEscape.test.mjs b/src/panelEscape.test.mjs index 1177804d01..b3937beb94 100644 --- a/src/panelEscape.test.mjs +++ b/src/panelEscape.test.mjs @@ -42,7 +42,7 @@ function panelFixture({ id = 'data-panel', nested = false, nestedCollapsed = fal disclosure.closest = () => panel; } const document = { getElementById: (candidate) => candidate === id ? panel : null }; - const manager = new Function('document', 'getComputedStyle', 'collapsePanelOnEscape', `return {${method('_collapsePanelOnEscape', '_togglePanel')}};`)(document, (el) => ({ visibility: el.visibility ?? 'visible' }), collapsePanelOnEscape); + const manager = new Function('document', 'getComputedStyle', 'collapsePanelOnEscape', `return {${method('_collapsePanelOnEscape', '_togglePanel')}, ${method('_railFocusStand', '_setCommandDockPanelPinState')}};`)(document, (el) => ({ visibility: el.visibility ?? 'visible' }), collapsePanelOnEscape); manager.setPanelCollapsed = (candidate, value, options) => { assert.equal(candidate, id); assert.equal(value, true); diff --git a/src/ui/panelChrome.js b/src/ui/panelChrome.js index c5da55c43b..bf6e08c3fe 100644 --- a/src/ui/panelChrome.js +++ b/src/ui/panelChrome.js @@ -204,22 +204,7 @@ export class PanelChrome { beforeCollapse: () => { if (panelId === 'location-bar') this._closeLocationSearch?.(); }, - // A desktop side panel hides entirely once collapsed; its rail item - // takes the focus its own disclosure can no longer hold. - returnFocusTo: () => { - const panel = document.getElementById(panelId); - if (!panel?.getClientRects || panel.getClientRects().length > 0) - return null; - const item = document.querySelector?.( - `.ui-rail [data-rail-item="${panelId}"]`, - ); - return item && - !item.disabled && - item.getClientRects().length > 0 && - getComputedStyle(item).visibility === 'visible' - ? item - : null; - }, + returnFocusTo: () => this._railFocusStand(panelId), }); } @@ -228,9 +213,49 @@ export class PanelChrome { if (this._disposed || !this._disclosurePanelIds?.has(panelId)) return; const panel = document.getElementById(panelId); if (!panel) return; + // Opening a panel folds others too (the side accordion, Cockpit's + // Contact card): note which open ones hold the focus. + const focused = document.activeElement; + const holders = [...this._disclosurePanelIds] + .map((id) => document.getElementById(id)) + .filter((el) => el?.contains(focused) && !this._shownPanel(el).collapsed); + const cockpit = this.cockpitView; + const contactHeld = + cockpit?.active && + !cockpit.contextCollapsed && + document.getElementById('cockpit-context')?.contains(focused); this.setPanelCollapsed(panelId, !this._shownPanel(panel).collapsed, { explicit: true, }); + const stand = + contactHeld && cockpit.contextCollapsed + ? document.getElementById('cockpit-context-toggle') + : holders + .filter((el) => this._shownPanel(el).collapsed) + .map((el) => this._railFocusStand(el.id)) + .find(Boolean); + stand?.focus({ preventScroll: true }); + } + + /** + * A desktop side panel hides entirely once collapsed; its rail item takes + * the focus its own disclosure can no longer hold. Null while the panel or + * the item is not shown. + * @param {string} panelId Panel element id. + */ + _railFocusStand(panelId) { + const panel = document.getElementById(panelId); + if (!panel?.getClientRects || panel.getClientRects().length > 0) + return null; + const item = document.querySelector?.( + `.ui-rail [data-rail-item="${panelId}"]`, + ); + return item && + !item.disabled && + item.getClientRects().length > 0 && + getComputedStyle(item).visibility === 'visible' + ? item + : null; } _setCommandDockPanelPinState( diff --git a/src/ui/panelChromeButtons.test.mjs b/src/ui/panelChromeButtons.test.mjs index 75d9e72493..3b0c833fcf 100644 --- a/src/ui/panelChromeButtons.test.mjs +++ b/src/ui/panelChromeButtons.test.mjs @@ -467,8 +467,13 @@ test('the accordion closes peers through the real store, and opens them again', test('F collapses Data Layers like its button and keeps its rail entry', (t) => { document.body.innerHTML = ` +
`; const panel = document.getElementById('data-panel'); + const item = document.querySelector('[data-rail-item="data-panel"]'); + panel.getClientRects = () => + panel.classList.contains('collapsed') ? [] : [{}]; + item.getClientRects = () => [{}]; const store = usePanelChromeStore(createPinia()); const chrome = panelChrome(store); followPanelState(store, 'data-panel', panel); @@ -491,14 +496,16 @@ test('F collapses Data Layers like its button and keeps its rail entry', (t) => chrome.destroy(); }); const press = (init = {}) => - document.body.dispatchEvent( + document.activeElement.dispatchEvent( new KeyboardEvent('keydown', { key: 'f', bubbles: true, ...init }), ); + panel.querySelector('button').focus(); press(); assert.equal(store.panels['data-panel']?.collapsed, true); + assert.ok(document.activeElement === item, 'focus moves to the rail'); assert.ok(panel.classList.contains('collapsed')); - // `active` is what keeps Data Layers in the rail. + // `active` is what shows Data Layers at all (layers.css). assert.ok(panel.classList.contains('active')); press({ metaKey: true }); assert.equal(store.panels['data-panel'].collapsed, true, 'Cmd+F is not ours'); @@ -507,3 +514,114 @@ test('F collapses Data Layers like its button and keeps its rail entry', (t) => assert.ok(!panel.classList.contains('collapsed')); assert.ok(panel.classList.contains('active')); }); + +test('F that folds a focused peer hands the focus to a rail entry', (t) => { + document.body.innerHTML = ` + +
+ +
+
`; + const stack = document.getElementById('left-panel-stack'); + const store = usePanelChromeStore(createPinia()); + const chrome = new PanelChrome({ + elements: { _leftPanelStack: stack }, + operations: { _showToast() {}, _syncCctvPanelViewport() {} }, + readHud: () => ({ visible: false, getVariant: () => null }), + readCockpit: () => null, + readShareLinks: () => null, + readInitialShare: () => null, + readScrollRestoreOwner: () => null, + readDisplayScrollTop: () => 0, + store, + }); + for (const id of ['data-panel', 'pp-toggles']) { + const panel = document.getElementById(id); + panel.getClientRects = () => + panel.classList.contains('collapsed') ? [] : [{}]; + followPanelState(store, id, panel); + } + for (const item of document.querySelectorAll('[data-rail-item]')) + item.getClientRects = () => [{}]; + chrome._disclosurePanelIds = new Set(['data-panel', 'pp-toggles']); + const bindings = new DisplayBindings({ + viewer: null, + services: { isScopeMaskEnabled: () => false, cycleDetectionMode() {} }, + elements: { _locationSearch: document.createElement('input') }, + operations: { + _setScope() {}, + _togglePanel: (panelId) => chrome._togglePanel(panelId), + }, + readState: () => ({}), + claimDetection() {}, + displayStore: useDisplayStore(createPinia()), + }); + bindings._initUI(); + t.after(() => { + bindings.destroy(); + chrome.destroy(); + }); + + const crt2 = document.getElementById('crt2'); + crt2.focus(); + assert.equal(document.activeElement, crt2); + crt2.dispatchEvent(new KeyboardEvent('keydown', { key: 'f', bubbles: true })); + assert.equal( + store.panels['data-panel']?.collapsed, + false, + 'Data Layers opens', + ); + const visual = document.getElementById('pp-toggles'); + assert.ok( + visual.classList.contains('collapsed'), + 'the accordion folds Visual', + ); + assert.ok( + document.activeElement?.matches?.('.ui-rail [data-rail-item]'), + `focus lands on a rail entry, not inside the hidden peer (got ${document.activeElement?.id || document.activeElement?.tagName})`, + ); +}); + +test('opening Data Layers in Cockpit hands the focus from the folded Contact card to its toggle', (t) => { + document.body.innerHTML = ` +
+ +
+ `; + const store = usePanelChromeStore(createPinia()); + const cockpit = { + active: true, + contextCollapsed: false, + setContextCollapsed(collapsed) { + this.contextCollapsed = collapsed; + }, + setSignalCollapsed() {}, + scheduleContextLayout() {}, + }; + const chrome = new PanelChrome({ + elements: { _leftPanelStack: document.getElementById('left-panel-stack') }, + operations: { _showToast() {}, _syncCctvPanelViewport() {} }, + readHud: () => ({ visible: false, getVariant: () => null }), + readCockpit: () => cockpit, + readShareLinks: () => null, + readInitialShare: () => null, + readScrollRestoreOwner: () => null, + readDisplayScrollTop: () => 0, + store, + }); + t.after(() => chrome.destroy()); + followPanelState(store, 'data-panel', document.getElementById('data-panel')); + chrome._disclosurePanelIds = new Set(['data-panel']); + document.getElementById('cockpit-weather-toggle').focus(); + chrome._togglePanel('data-panel'); + assert.equal( + store.panels['data-panel']?.collapsed, + false, + 'Data Layers opens', + ); + assert.equal(cockpit.contextCollapsed, true, 'Contact folds for it'); + assert.equal(document.activeElement?.id, 'cockpit-context-toggle'); +}); diff --git a/src/ui/panelNavigation.js b/src/ui/panelNavigation.js index e6fed5d641..698381a1e8 100644 --- a/src/ui/panelNavigation.js +++ b/src/ui/panelNavigation.js @@ -1,5 +1,5 @@ import PanelRailView from './PanelRailView.vue'; -import { PANEL_RAIL_HOST_CLASS, PANEL_RAIL_ITEMS } from './panelRailCatalog.js'; +import { PANEL_RAIL_HOST_CLASS } from './panelRailCatalog.js'; import { usePanelStore } from './stores/panels.js'; /** @@ -71,7 +71,6 @@ export class PanelNavigation { ? [...stack.children] .filter((panel) => panel.matches('[data-panel-id]')) .map((panel) => { - const shownBy = PANEL_RAIL_ITEMS[panel.id]?.shownBy; return { id: panel.id, title: @@ -79,9 +78,7 @@ export class PanelNavigation { .querySelector('.panel-title, .pp-header-label') ?.textContent.trim() || panel.id, open: !panel.classList.contains('collapsed'), - available: - !panel.hidden && - (!shownBy || panel.classList.contains(shownBy)), + available: !panel.hidden, }; }) : []; diff --git a/src/ui/panelNavigation.test.mjs b/src/ui/panelNavigation.test.mjs index 2eb999d3cc..40b54060da 100644 --- a/src/ui/panelNavigation.test.mjs +++ b/src/ui/panelNavigation.test.mjs @@ -22,8 +22,6 @@ function panel(id, { collapsed = true, hidden = false, title = '' } = {}) { element.className = collapsed ? 'panel-collapsible collapsed' : 'panel-collapsible'; - // Data Layers shows only while `active` (the `f` shortcut toggles it). - if (id === 'data-panel') element.classList.add('active'); element.hidden = hidden; if (title) element.innerHTML = `${title}`; return element; @@ -132,8 +130,8 @@ test('the rails follow disclosure and availability changes', async () => { ['global-context-panel', 'false'], ['host-panel', 'false'], ]); - // `f` hides Data Layers outright, so the rail stops offering it. - document.getElementById('data-panel').classList.remove('active'); + // A hidden panel leaves its rail. + document.getElementById('data-panel').hidden = true; await new Promise((resolve) => setTimeout(resolve, 0)); await nextTick(); assert.deepEqual(railItems(left), [['scene-panel', 'true']]); diff --git a/src/ui/panelRailCatalog.js b/src/ui/panelRailCatalog.js index 854214a2ad..ead5460ab2 100644 --- a/src/ui/panelRailCatalog.js +++ b/src/ui/panelRailCatalog.js @@ -7,16 +7,11 @@ export const PANEL_RAIL_HOST_CLASS = 'gev-panel-rail'; export const PANEL_RAIL_FALLBACK_ICON = 'more_horiz'; /** - * How each side panel appears on its rail. Labels are the panels' own titles. - * `shownBy` names a class the panel needs to be shown at all (`f` toggles - * Data Layers' `active`). `context` is the label's translation context. + * How each side panel appears on its rail. Labels are the panels' own titles; + * `context` is the label's translation context. */ export const PANEL_RAIL_ITEMS = Object.freeze({ - 'data-panel': { - icon: 'layers', - label: msg('DATA LAYERS'), - shownBy: 'active', - }, + 'data-panel': { icon: 'layers', label: msg('DATA LAYERS') }, 'utilities-panel': { icon: 'handyman', label: msg('UTILITIES') }, 'scene-panel': { icon: 'movie', label: msg('AUTHORING') }, // `context` keeps the panel's name apart from the satellite class of the