feat(ui): render the location tray's pills, mini status and search error from a store

LocationControls (./ui/location) no longer builds the city and landmark
pills or writes the mini status and the search error: it presents the tray
and hands it to its publish option, so the entry stays Vue-free. The shell
publishes it to a new gev-location store and connects the controls, and
the dock renders it and calls chooseCity() and choosePoi(). The landmark
row still expands a frame after its pills render. The search field, its
toggle and the reset buttons keep their listeners. The location QA harness
reads the rendered elements.
This commit is contained in:
Sameh Khamis committed 2026-10-31 12:19:44 -07:00
1 parent 4966877859
commit 5f8f9bb921
14 files changed
+333 -141

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import { defineStore } from 'pinia';
import { markRaw, shallowRef } from 'vue';
/**
* The dock's location tray as its view renders it. LocationControls
* presents the city pills, the landmark row, the mini status and the search
* error and publishes them here; it keeps the search field's listeners.
*/
export const useLocationStore = defineStore('gev-location', () => {
/** The presented tray; null until the controls first render. */
const view = shallowRef(null);
/** @param {?object} next A fresh presentation; every publish re-renders. */
function publish(next) {
view.value = next && markRaw(next);
}
/** The controls whose `chooseCity(id)` and `choosePoi(index)` pills call. */
const controls = shallowRef(null);
/** @param {?object} next The location controls, or null to disconnect. */
function connect(next) {
controls.value = next && markRaw(next);
}
return { view, publish, controls, connect };
});