mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
Add the Omnibar: one field above the footer for places, layers and commands
On desktop the dock becomes one search bar (Omnibar.vue) that shows the rows the line-reading pipeline makes: places with nearby suggestions, coordinates, map items, layers, commands, plans such as "go to Austin and show flights", guided walks through the real controls, and Ask GEV for questions. Enter runs only what the line asks for outright. The map credits move below the bar onto the Power Up row, the voice waveform shows in the bar while voice is on, and the dock's Location and Visual trays are hidden in this layout. The phone layout is unchanged. Long place names are kept out of automatic Ask GEV. Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
1 parent
6e0baacd57
commit
a3f4af91f8
36 files changed
+4741
-75
No files matched your search
@@ -62,7 +62,7 @@ export function installEntityContext({
|
||||
const voice = useVoiceStore(pinia);
|
||||
const cockpitStore = useCockpitStore(pinia);
|
||||
const chrome = usePanelChromeStore(pinia);
|
||||
/** Whether Context is open; a closed panel reads nothing. */
|
||||
/** Whether Context is open. (readView also reads while the Omnibar is focused.) */
|
||||
const isOpen = () =>
|
||||
chrome.panels['global-context-panel']?.collapsed === false;
|
||||
const doc = globalThis.document;
|
||||
@@ -223,7 +223,8 @@ export function installEntityContext({
|
||||
// the height. Read when the camera settles, not every frame.
|
||||
const readView = () => {
|
||||
const port = camera();
|
||||
if (!port || !isOpen()) return;
|
||||
if (!port || (!isOpen() && doc?.activeElement?.id !== 'gev-omnibar-input'))
|
||||
return;
|
||||
const pose = port.pose();
|
||||
if (![pose.lat, pose.lon, pose.height].every(Number.isFinite)) return;
|
||||
const middle = pickWorld?.(viewer, 0.5, 0.5);
|
||||
@@ -272,6 +273,12 @@ export function installEntityContext({
|
||||
listen();
|
||||
readView();
|
||||
}, 0);
|
||||
// The Omnibar's nearby suggestions also need a fresh center even with
|
||||
// Context closed. Its focus event requests one camera read.
|
||||
const onSearchFocus = (event) => {
|
||||
if (event.target?.id === 'gev-omnibar-input') readView();
|
||||
};
|
||||
doc?.addEventListener('focusin', onSearchFocus);
|
||||
// Opening the panel describes the view as it is now.
|
||||
let wasOpen = isOpen();
|
||||
const offChrome = chrome.$subscribe(() => {
|
||||
@@ -356,6 +363,7 @@ export function installEntityContext({
|
||||
clearTimeout(trailing);
|
||||
offFollow();
|
||||
offChrome();
|
||||
doc?.removeEventListener('focusin', onSearchFocus);
|
||||
clearTimeout(followCheck);
|
||||
globalThis.removeEventListener?.('gev:entity-selected', onSelected);
|
||||
store.connect(null);
|
||||
|
||||
Reference in new issue
Block a user