From c351e66af9f3fa0c67bc31e3083d941eff45ec21 Mon Sep 17 00:00:00 2001 From: Manjunath Paparaju Date: Sat, 14 Nov 2026 17:29:40 -0800 Subject: [PATCH] Wire Context into the shell The shell connects the layer store that Context and the omnibar share, installs the click-to-Context bridge and removes both on dispose. Voice sessions hand their command runner to the same store, and the stylesheet imports the Context styles. Co-authored-by: Sameh Khamis --- src/ui/applicationShell.js | 16 ++++++++++++++++ src/ui/stores/omnibar.js | 33 +++++++++++++++++++++++++++++++++ src/voice/sessionCommands.js | 10 ++++++++++ style.css | 5 +++++ 4 files changed, 64 insertions(+) create mode 100644 src/ui/stores/omnibar.js diff --git a/src/ui/applicationShell.js b/src/ui/applicationShell.js index 35a5e2062..c3ca23fd0 100644 --- a/src/ui/applicationShell.js +++ b/src/ui/applicationShell.js @@ -71,6 +71,8 @@ import { useHudStore } from './stores/hud.js'; import { useDisplayStore } from './stores/display.js'; import { useLocaleStore } from './stores/locale.js'; import { useLocationStore } from './stores/location.js'; +import { useOmnibarStore } from './stores/omnibar.js'; +import { installEntityContext } from './entityContextBridge.js'; import { installRailEdgeScroll } from './railEdgeScroll.js'; import { useCockpitStore } from './stores/cockpit.js'; import { useGlobeActionsStore } from './stores/globeActions.js'; @@ -171,6 +173,12 @@ export class StyleManager extends ShellFacade { }); // Vue views share this runtime and its stores; dispose unmounts them. this._ui = createUiRuntime({ pinia: applicationPinia() }); + // The omnibar and Context list and toggle data layers through the shell. + useOmnibarStore(applicationPinia()).connect({ + layers: () => this._dataManager?.getAll?.() || [], + setLayer: (id, enabled) => + this._dataManager?.setEnabled(id, enabled, { origin: 'user' }), + }); // Scrolling at a screen edge steps through that side's rail panels. this._removeRailEdgeScroll = installRailEdgeScroll(); this._feedback = new ShellFeedback({ @@ -184,6 +192,12 @@ export class StyleManager extends ShellFacade { this._updateGlobalLoadingFeedback(), ); this.viewer = viewer; + // A click on anything a layer can identify opens its card in Context. + this._removeEntityContext = installEntityContext({ + viewer, + getDataManager: () => this._dataManager, + pinia: applicationPinia(), + }); this.mapStackController = mapStackController; this.placeSearch = placeSearch; @@ -1879,7 +1893,9 @@ export class StyleManager extends ShellFacade { const { destroyTrackedReadout, destroyWorldOverlay, destroyDetection } = this.services; if (this._disposed) return; + useOmnibarStore(applicationPinia()).connect(null); this._removeRailEdgeScroll?.(); + this._removeEntityContext?.(); this._shareRestoration.destroy(); this._feedback.clearLoadingStatus(); this._disposed = true; diff --git a/src/ui/stores/omnibar.js b/src/ui/stores/omnibar.js new file mode 100644 index 000000000..68c2e4e25 --- /dev/null +++ b/src/ui/stores/omnibar.js @@ -0,0 +1,33 @@ +import { defineStore } from 'pinia'; +import { markRaw, shallowRef } from 'vue'; + +/** + * The top-bar omnibar's link to the shell. The shell connects the actions + * the omnibar offers: `layers()` lists the data layers as `{id, name, + * enabled}`, and `setLayer(id, enabled)` turns one on or off as a user click + * would. Place search runs through the location controls and Ask GEV through + * the voice controls, so neither is repeated here. + */ +export const useOmnibarStore = defineStore('gev-omnibar', () => { + /** `{layers(), setLayer(id, enabled)}`, or null while disconnected. */ + const controls = shallowRef(null); + + /** @param {?object} next The shell's omnibar actions, or null. */ + function connect(next) { + controls.value = next && markRaw(next); + } + + /** + * The voice action runner, `(name, args) → Promise`: the same + * actions voice and chat call, run directly without a model. Null while no + * voice runtime is up. + */ + const runner = shallowRef(null); + + /** @param {?Function} next The runner, or null to disconnect. */ + function connectRunner(next) { + runner.value = next ? markRaw(next) : null; + } + + return { controls, connect, runner, connectRunner }; +}); diff --git a/src/voice/sessionCommands.js b/src/voice/sessionCommands.js index bcf0ba3ab..be825bf61 100644 --- a/src/voice/sessionCommands.js +++ b/src/voice/sessionCommands.js @@ -1,4 +1,6 @@ import { nextTick } from 'vue'; +import { useOmnibarStore } from '../ui/stores/omnibar.js'; +import { applicationPinia } from '../ui/vueRuntime.js'; import { bindAssistantPanelLayout, bindLayoutDock } from './panelLayout.js'; import { bindChatControl } from './chatControl.js'; import { bindVoiceMiniPreview } from './voiceMiniPreview.js'; @@ -334,5 +336,13 @@ export function createVoiceCommands({ if (session.disposed) cleanup(); else adapter.bindControls?.(); window.__gevVoiceCommands = controls; + // The omnibar runs the same actions directly, without a model. + const omnibar = useOmnibarStore(applicationPinia()); + omnibar.connectRunner((name, args) => runner(name, args)); + session.signal.addEventListener( + 'abort', + () => omnibar.connectRunner(null), + { once: true }, + ); return controls; } diff --git a/style.css b/style.css index 6d3591643..b8136340c 100644 --- a/style.css +++ b/style.css @@ -48,10 +48,15 @@ @import './src/ui/styles/rail-edge.css'; @import './src/ui/styles/rail-split.css'; @import './src/ui/styles/left-tools.css'; +@import './src/ui/styles/entity-card.css'; +@import './src/ui/styles/context-dock.css'; +@import './src/ui/styles/spot-conditions.css'; +@import './src/ui/styles/sun-dial.css'; @import './src/ui/styles/panel-edge.css'; @import './src/ui/styles/visual-panel.css'; @import './src/ui/styles/layer-section-index.css'; @import './src/ui/styles/layer-finder.css'; +@import './src/ui/styles/context-tabs.css'; @import './src/ui/styles/cockpit-panels.css'; @import './src/ui/styles/ai-chat.css'; @import './src/ui/styles/scope-off-shadows.css';