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:
Manjunath PaparajuandSameh Khamis authored and Sameh Khamis committed 2026-11-18 15:00:06 -08:00
1 parent 6e0baacd57
commit a3f4af91f8
36 files changed
+4741 -75

No files matched your search

+35 -3
View File
@@ -46,6 +46,7 @@ export class LocationControls {
onCity,
onPoi,
onSearch,
onSearchEdit,
onReset,
publish,
doc,
@@ -74,6 +75,7 @@ export class LocationControls {
poi: t('Landmark: --'),
};
this.searchError = null;
this.searchOrigin = 'dock';
// The search field: whether it is open, and whether a lookup runs.
this.searchExpanded = Boolean(searchExpanded);
this.searching = false;
@@ -96,12 +98,16 @@ export class LocationControls {
onPoi(cityId, index);
});
this.bind(elements.search, 'keydown', (event) => {
if (event.key === 'Enter') void onSearch(elements.search.value);
if (event.key === 'Enter')
void this.search(elements.search.value, { origin: 'dock' });
});
// Typing corrects a failed query; closing the field (which empties it) drops its error.
this.bind(elements.search, 'input', () => onSearchEdit?.());
this.bind(elements.search, 'input', () => {
if (this.searchOrigin === 'dock') onSearchEdit?.();
});
this.bind(elements.search, 'blur', () => {
if (!elements.search.value) onSearchEdit?.();
if (this.searchOrigin === 'dock' && !elements.search.value)
onSearchEdit?.();
});
this.present();
}
@@ -138,9 +144,29 @@ export class LocationControls {
searchError: this.searchError,
searchExpanded: this.searchExpanded,
searching: this.searching,
searchOrigin: this.searchOrigin,
orbit: this.orbit && { ...this.orbit },
};
}
/** Search through the same lifecycle as the location field. */
search(query, { origin = 'omnibar' } = {}) {
if (this.destroyed || !String(query || '').trim()) return false;
this._requestedSearchOrigin = origin;
// Beginning navigation synchronously settles the previous lookup. That
// handoff must not clear or blur the draft just submitted by either field.
this._startingSearch = true;
try {
return this.onSearch(query);
} finally {
this._startingSearch = false;
this._requestedSearchOrigin = null;
}
}
/** Editing an external query clears its prior lookup error. */
editSearch() {
if (!this.destroyed && this.searchOrigin === 'omnibar')
this.onSearchEdit?.();
}
/** A city pill was clicked. */
chooseCity(id) {
if (!this.destroyed) this.onCity(id);
@@ -233,6 +259,8 @@ export class LocationControls {
/** Mark the search field while a lookup runs. */
setSearching(active) {
if (this.destroyed) return;
if (active && this._requestedSearchOrigin)
this.searchOrigin = this._requestedSearchOrigin;
this.searching = Boolean(active);
this.present();
}
@@ -243,6 +271,10 @@ export class LocationControls {
settleSearch({ keepQuery = false } = {}) {
if (this.destroyed) return;
this.searching = false;
if (this._startingSearch || this.searchOrigin === 'omnibar') {
this.present();
return;
}
if (!keepQuery) {
this.closeSearch();
return;