mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
feat(panels): render each panel's state classes from the store
A panel's collapsed, dock-pinned, dock-pinned-top, layout-auto-collapsed
and accordion-collapsed classes are drawn by its root's v-panel-state from
the gev-panel-chrome store. PanelChrome, its restore, the layout
controller, both rails and the side accordion present each panel's state
there instead of writing its classes; the rails call onCollapse(panel,
{collapsed, auto}). The directive applies a change in a synchronous
watcher, since the rails measure a panel in the task that opens or closes
it.
Destroying the chrome inside Cockpit now puts back the panels Cockpit's
entry closed while it can still present them. Without a shell, the voice
tools' set_panel_open reports that there is no panel to open. QA scripts
present the states they set instead of writing the classes.
This commit is contained in:
1 parent
dd3a2c87f9
commit
95523e09cd
37 files changed
+404
-135
No files matched your search
+18
-7
@@ -817,7 +817,17 @@ export function createGevActionRunner({
|
||||
...(!applied ? { error: say } : {}),
|
||||
};
|
||||
}
|
||||
setPanelOpen(styleManager, panelId, open);
|
||||
if (!setPanelOpen(styleManager, panelId, open)) {
|
||||
const say = 'There is no panel to open here.';
|
||||
return {
|
||||
ok: false,
|
||||
action: 'set_panel_open',
|
||||
panelId,
|
||||
open,
|
||||
say,
|
||||
error: say,
|
||||
};
|
||||
}
|
||||
return { ok: true, action: 'set_panel_open', panelId, open };
|
||||
}
|
||||
|
||||
@@ -3143,13 +3153,14 @@ function normalizeAircraftClassFilter(value) {
|
||||
return raw.replace(/[\s-]+/g, '') === TR3B_CLASS ? TR3B_CLASS : raw;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean} Whether a shell took the change: its panel chrome owns
|
||||
* panel state, so without one there is no panel to open.
|
||||
*/
|
||||
function setPanelOpen(styleManager, panelId, open) {
|
||||
if (styleManager && typeof styleManager.setPanelCollapsed === 'function') {
|
||||
styleManager.setPanelCollapsed(panelId, !open, { explicit: true });
|
||||
} else {
|
||||
const panel = document.getElementById(panelId);
|
||||
if (panel) panel.classList.toggle('collapsed', !open);
|
||||
}
|
||||
if (typeof styleManager?.setPanelCollapsed !== 'function') return false;
|
||||
styleManager.setPanelCollapsed(panelId, !open, { explicit: true });
|
||||
return true;
|
||||
}
|
||||
|
||||
function normalizeContextMode(value) {
|
||||
|
||||
Reference in new issue
Block a user