diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 811e2a1fd..87d00f49a 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -658,6 +658,106 @@ owner (open state, filters, the rows they show, Remove all) and the text helpers the view renders, so every label follows the locale. Only the modal open/close and focus moves are imperative. +## Stories — November 13, 2026 + +A Stories button (top right, `#hStories`) opens Explore: a feed of stories +over GEV's own Cesium globe with their pins, then a Story screen with a +timeline, chapters and context. Every GEV page loads only what the +closed state needs: the boot shell (`src/stories/boot.js`), the store, +`StoriesView.vue` with the Stories button, first-visit popup and +back-to-story toast, and their styles (`stories-entry.css`). The screens +(`ExploreScreen.vue`, `StoryScreen.vue` and their parts), their styles +(`stories.css`), the story data (`storyMeta.js`, `catalog.js`) and the +controller are separate chunks fetched together on first open, on a +`?stories=` / `?story=` link, or on Back or Forward into Stories; a failed +fetch is reported and the next attempt tries again. Stories keeps its place +in the query, not the share-state hash, with one history entry per screen; +Close steps back over those entries, so Back afterwards does not reopen it, +and share links carry only the Stories place (`stories` / `story`), not the +sender's camera, layers or other settings. GEV's share link keeps +`history.state` when it rewrites the hash, so Stories' entries survive. + +Every story is a GEV scene, played on the person's own Cesium globe through +`SceneDirector`, with its labels, embedded media, A/B imagery split (marked +`data-globe-overlay`) and data-pack cards kept while the rest of GEV is +hidden. Explore lists the scenes the person saved to Stories from AUTHORING +first (`SceneDirector.storyScenes()`, refreshed on every `stories-changed`), +then the person's other scenes with a shot as drafts +(`SceneDirector.draftScenes()`, marked DRAFT), then the +scenes GEV ships with a camera path while they are in the project +(`SceneDirector.hasScene`). A saved scene brings the card image and topics +picked for it in AUTHORING; the topic chips use AUTHORING's tag names and +order. Explore opens at country level +(2,500 km) over the first story and, while idle, flies on to the next story +every few seconds, for a minute after the last touch (never with a story +picked or with reduced motion). A picked story's place is framed in the +middle of the view at an angle. After each landing the globe keeps drawing +only until its tiles have loaded (at most 10 s). Each story's pin, in the +world overlay's label style (`src/overlays/worldOverlayTokens.js`), is placed +from Cesium's own projection on every drawn frame, written straight to the +pin's transform, and hidden behind the globe; the pins ask for no frames of +their own. Card images are drawn from the keyless Esri World Imagery tiles +around the story's place (`src/stories/thumbs.js`) unless the scene has its +own; with any other base imagery the card shows its placeholder, and a card +drawn from Esri earlier is dropped. A shot +tied to an anchor rather than a place pins the whole-globe view. + +A shipped story's context comes from what GEV knows about it +(`src/stories/catalog.js`): what it shows, the place each shot goes, and, +for each layer it turns on, what the layer shows and the data sources +DATA_SOURCES.md lists for it. The Nepal story carries the event pack's own +facts and sources (Vantor imagery and the GeoPera reconstruction, CC BY-NC +4.0), and its key moments are the chapters that show them. Topic chips and +region choices are the ones the listed stories carry. Closing Stories after +a story played puts AUTHORING's own selection back (usually none); +Open in GEV leaves the story's scene selected there. + +Opening Stories claims the camera through the shared navigation policy, so +orbit, a tracked contact or a flight end, and Cockpit refuses with the +policy's own toast ("Exit cockpit to open Stories"). Those owners are not +started again on Close: the camera and clock come back, a follow or orbit +does not. While Stories is open it owns the keyboard (`src/stories/keyboard.js`): +a key pressed in Stories stops at its root, and a key pressed anywhere else +stops at the window, so none of GEV's document-level shortcuts act behind it, +except on a playing GEV scene's own on-globe controls (`data-globe-overlay`); +the capture-phase listeners (hold Space to talk, a surface's Tab trap, the +wildlife card's Escape) check `body.stories-mode` themselves. Voice tool calls +are refused while `stories-mode` is set ("Close Stories first"). + +The address bar names only the story while Stories is open: the share link +holds its hash writes (`ShareLinkManager.holdWrites`, which first writes a +change still waiting for its debounce, so the view Stories saves is current). +Close works in this order. Stories' screens go and GEV is back on screen, but +`stories-mode` (keyboard guard, voice refusal) stays. The director is waited +on until idle (`SceneDirector.whenIdle`: no run and no pending LOAD, seek or +interaction; at most 15 s). The camera and clock are put back, unless a +camera owner took over during the wait (a drag on the globe, a layer's +focus). History steps back over Stories' entries; once that lands (or after +2 s if it never does), the saved share state is re-applied directly +(`ShareLinkManager.restore`, since the share link skips a hash it already +knows) and the share link writes the live view again. Back out of Stories +re-applies it the same way, and Back to Explore from a story re-applies it +once the scene has torn down, with the address still naming only Stories. +"Open in GEV" (GEV scene stories only) closes the +same way but keeps the place and look: nothing is put back, the scene and its +current shot are selected (`SceneDirector.selectShot`) and the Scenes panel +opens for authoring; Back then goes to the page before Stories. A Close or +open made while a traversal is landing runs once it has landed; a second Back +to Explore is ignored. Reopening Stories while a closed GEV scene is still +tearing down keeps the view from before Stories as the one Close restores. +Inside an inline embed Stories is not offered: the URL and history are the +host's. + +The Stories button sits left of whatever holds GEV's top-right corner: the +ACTIVE STYLE readout, or GEV Hosted's account avatar. The first-visit popup +is a labelled region that does not take focus. The story page's rail offers +Open in GEV and Share only. A scene of the person's own (saved or draft) +shows as theirs ("You") and has no Share: the project lives on this device, +so a link to it would open nothing elsewhere; a link to a story that is not +here opens Explore and says so. GEV's own credit line stays on screen throughout, inside the +Stories map while a scene plays (`creditPlacement` in +`src/stories/format.js`). + ## Utilities panel — October 29, 2026 UTILITIES is its own left-side panel, between Data Layers and Scenes, with @@ -1271,7 +1371,7 @@ Native `
- {{ t('EDIT DETAILS') }} - {{ t('SHARE SCENE') }} + {{ t('EDIT DETAILS') }} + {{ t('SHARE SCENE') }}
{{ scene?.progress ?? 0 }}%
diff --git a/src/ui/views/SceneOptions.vue b/src/ui/views/SceneOptions.vue deleted file mode 100644 index 4cc6bbe77..000000000 --- a/src/ui/views/SceneOptions.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/src/ui/views/StoriesView.vue b/src/ui/views/StoriesView.vue new file mode 100644 index 000000000..4e3944e64 --- /dev/null +++ b/src/ui/views/StoriesView.vue @@ -0,0 +1,337 @@ + + + diff --git a/src/ui/views/index.js b/src/ui/views/index.js index a85224912..522a8d0c9 100644 --- a/src/ui/views/index.js +++ b/src/ui/views/index.js @@ -10,6 +10,7 @@ import CockpitView from './CockpitView.vue'; import SceneChromeView from './SceneChromeView.vue'; import ProviderSettingsView from './ProviderSettingsView.vue'; import IntelHudView from './IntelHudView.vue'; +import StoriesView from './StoriesView.vue'; /** * Application views by name. A page places each one with a host element, @@ -26,6 +27,7 @@ export const APPLICATION_VIEWS = Object.freeze({ context: ContextView, welcome: WelcomeView, 'intel-hud': IntelHudView, + stories: StoriesView, }); const mounted = new WeakMap(); diff --git a/src/ui/views/panels/ImagerySplitView.vue b/src/ui/views/panels/ImagerySplitView.vue index b25c7cf46..1c2a34e05 100644 --- a/src/ui/views/panels/ImagerySplitView.vue +++ b/src/ui/views/panels/ImagerySplitView.vue @@ -11,6 +11,6 @@ const optional = (value) => value ?? undefined; diff --git a/src/ui/views/stories/ExploreScreen.vue b/src/ui/views/stories/ExploreScreen.vue new file mode 100644 index 000000000..04babc054 --- /dev/null +++ b/src/ui/views/stories/ExploreScreen.vue @@ -0,0 +1,782 @@ + + + diff --git a/src/ui/views/stories/StoriesHeader.vue b/src/ui/views/stories/StoriesHeader.vue new file mode 100644 index 000000000..e53d35b3b --- /dev/null +++ b/src/ui/views/stories/StoriesHeader.vue @@ -0,0 +1,181 @@ + + + diff --git a/src/ui/views/stories/StoryContext.vue b/src/ui/views/stories/StoryContext.vue new file mode 100644 index 000000000..2556c6405 --- /dev/null +++ b/src/ui/views/stories/StoryContext.vue @@ -0,0 +1,414 @@ + + + diff --git a/src/ui/views/stories/StoryRail.vue b/src/ui/views/stories/StoryRail.vue new file mode 100644 index 000000000..5687a61c9 --- /dev/null +++ b/src/ui/views/stories/StoryRail.vue @@ -0,0 +1,53 @@ + + + diff --git a/src/ui/views/stories/StoryScreen.vue b/src/ui/views/stories/StoryScreen.vue new file mode 100644 index 000000000..8eeff9c15 --- /dev/null +++ b/src/ui/views/stories/StoryScreen.vue @@ -0,0 +1,631 @@ + + + diff --git a/src/ui/views/stories/StoryTimeline.vue b/src/ui/views/stories/StoryTimeline.vue new file mode 100644 index 000000000..de0bd9972 --- /dev/null +++ b/src/ui/views/stories/StoryTimeline.vue @@ -0,0 +1,560 @@ + + + diff --git a/src/ui/wildlifeSightingCard.js b/src/ui/wildlifeSightingCard.js index ce6a24588..7a01b110d 100644 --- a/src/ui/wildlifeSightingCard.js +++ b/src/ui/wildlifeSightingCard.js @@ -203,6 +203,8 @@ export function createWildlifeSightingCard({ const keydown = (event) => { if (!selected.value || event.key !== 'Escape') return; + // Stories owns Escape while it is open (the card is behind it). + if (documentRef.body?.classList?.contains?.('stories-mode')) return; event.preventDefault(); event.stopImmediatePropagation(); layer.clearSightingSelection(); diff --git a/src/voice/gevActions.js b/src/voice/gevActions.js index 3343cd243..45279baa9 100644 --- a/src/voice/gevActions.js +++ b/src/voice/gevActions.js @@ -444,6 +444,17 @@ export function createGevActionRunner({ runOptions = {}, ) { const args = rawArgs && typeof rawArgs === 'object' ? rawArgs : {}; + // Stories covers GEV and owns its camera and scenes: an open-mic session + // must not fly, load or change what is behind it. + if (globalThis.document?.body?.classList?.contains?.('stories-mode')) + return { + ok: false, + action: name, + applied: false, + refused: 'stories-open', + error: 'Stories is open. Close Stories first.', + say: 'Stories is open. Close Stories first to control the globe.', + }; const current = () => !runOptions.signal?.aborted && (typeof runOptions.isCurrent !== 'function' || runOptions.isCurrent()); diff --git a/src/voice/gevActions.test.mjs b/src/voice/gevActions.test.mjs index 123bbd8e4..0a26b4b36 100644 --- a/src/voice/gevActions.test.mjs +++ b/src/voice/gevActions.test.mjs @@ -258,6 +258,48 @@ test('zoom to globe adopts the shared visible reset route and returns its result assert.equal(calls, 1); }); +test('voice changes nothing behind Stories while it is open', async () => { + globalThis.window = globalThis.window || { + clearTimeout, + setTimeout, + requestIdleCallback: null, + }; + const viewer = { + clock: { onTick: { addEventListener: () => () => {} } }, + scene: { canvas: { addEventListener() {}, removeEventListener() {} } }, + camera: { moveEnd: { addEventListener() {} } }, + }; + let calls = 0; + const styleManager = { + async resetToGlobeView() { + calls += 1; + return { ok: true }; + }, + }; + const runner = createGevActionRunner({ + viewer, + styleManager, + dataManager: { layers: new Map(), getAll: () => [] }, + }); + const classes = new Set(['stories-mode']); + const priorDocument = globalThis.document; + globalThis.document = { + ...(priorDocument ?? {}), + body: { classList: { contains: (c) => classes.has(c) } }, + }; + try { + const refused = await runner('zoom_to_globe'); + assert.equal(refused.ok, false); + assert.equal(refused.refused, 'stories-open'); + assert.equal(calls, 0); + classes.clear(); + await runner('zoom_to_globe'); + assert.equal(calls, 1, 'works again once Stories has closed'); + } finally { + globalThis.document = priorDocument; + } +}); + test('dependent voice navigation waits for the destination viewport to arrive', async () => { globalThis.window = globalThis.window || { clearTimeout, diff --git a/src/voice/realtimeInput.js b/src/voice/realtimeInput.js index 0a43fa6ec..e759e14d8 100644 --- a/src/voice/realtimeInput.js +++ b/src/voice/realtimeInput.js @@ -55,9 +55,11 @@ export class RealtimeInput { bindPushToTalkShortcut() { if (this.shortcutKeyDownHandler) return; this.shortcutKeyDownHandler = (event) => { - // Space types in chat; it never talks while chat is open. + // Space types in chat; it never talks while chat is open, nor while + // Stories owns the keyboard (body.stories-mode). if ( this.ui.state?.chat?.open === true || + globalThis.document?.body?.classList?.contains?.('stories-mode') || !shouldHandlePushToTalkKeyDown(event) ) return; diff --git a/style.css b/style.css index 7e218d7f8..6d3591643 100644 --- a/style.css +++ b/style.css @@ -55,4 +55,5 @@ @import './src/ui/styles/cockpit-panels.css'; @import './src/ui/styles/ai-chat.css'; @import './src/ui/styles/scope-off-shadows.css'; +@import './src/ui/styles/stories-entry.css'; @import './src/ui/styles/cyber.css';