mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a24768a2d | ||
|
|
89ebfa85d1 | ||
|
|
649d29e409 | ||
|
|
d3904b9503 | ||
|
|
28ee3bfc37 |
No files matched your search
@@ -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).
|
||||
@@ -621,6 +621,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),
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 = `
|
||||
<div id="data-panel" class="active"><button class="panel-collapse-btn" data-collapse-target="data-panel"></button></div>`;
|
||||
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'));
|
||||
});
|
||||
Reference in new issue
Block a user