mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(ui): add a desktop panel rail to each sidebar
Each side stack hosts a Vue rail listing its panels; selecting one opens it through PanelChrome. The shell owns one Vue runtime and Pinia instance, and a panel store mirrors each side's panels from the DOM. The rail hides with its stack, in Cockpit, clean view and recording, and on phones. Panels without a catalog entry get a generic item, and Data Layers leaves the rail while the f shortcut hides it.
This commit is contained in:
1 parent
eed7657516
commit
3d5d3ef014
29 files changed
+627
-32
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { createApp } from 'vue';
|
||||
import { createPinia } from 'pinia';
|
||||
|
||||
/**
|
||||
* Create the application's Vue runtime: one Pinia instance shared by every
|
||||
* view the shell mounts, and the mounts themselves for teardown.
|
||||
* @returns {{pinia: import('pinia').Pinia, mount: Function, destroy: Function}}
|
||||
*/
|
||||
export function createUiRuntime() {
|
||||
const pinia = createPinia();
|
||||
const apps = new Set();
|
||||
return {
|
||||
pinia,
|
||||
/**
|
||||
* Mount a root component into a host element.
|
||||
* @param {object} component Root component.
|
||||
* @param {Element} host Element the view renders into.
|
||||
* @param {object} [props] Root props.
|
||||
* @returns {Function} Unmount this view.
|
||||
*/
|
||||
mount(component, host, props = {}) {
|
||||
const app = createApp(component, props);
|
||||
app.use(pinia);
|
||||
app.mount(host);
|
||||
apps.add(app);
|
||||
return () => {
|
||||
if (!apps.delete(app)) return;
|
||||
app.unmount();
|
||||
};
|
||||
},
|
||||
destroy() {
|
||||
for (const app of apps) app.unmount();
|
||||
apps.clear();
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user