From 541843833921a98e9862c12a79fc1688370740cb Mon Sep 17 00:00:00 2001 From: Manjunath <301209272+manjunath22466@users.noreply.github.com> Date: Fri, 13 Nov 2026 22:08:55 +0530 Subject: [PATCH] Stories: GEV scenes as stories on the live globe A Stories button (top right) opens Explore: a feed of GEV scenes over GEV's own Cesium globe, with a pin per story. Explore opens at country level over the first story and, while idle, flies on from story to story for a minute. A picked story is framed in the middle of the view; a pin plays its story on a second click. The Story page plays the scene through SceneDirector with a timeline, chapters, key moments, sources and background, then Close (or Back) puts the person's camera, clock, layers, style and AUTHORING selection back. Open in GEV hands the scene to the Scenes panel at its current shot. Stories lists the scenes GEV ships with a camera path (while they are in the project), the scenes saved with SAVE TO STORIES in AUTHORING, and the person's other scenes as drafts. The person's own stories live in the project on this device, so they have no Share; a link to a story that is not here opens Explore and says so. Each shipped story's context comes from what GEV knows: what it shows, the place each shot goes, and each layer's data sources as DATA_SOURCES.md lists them; the Nepal story carries the event pack's facts and CC BY-NC sources. Card images are a captured THUMBNAIL or drawn from the keyless Esri World Imagery. AUTHORING has no scene picker: it starts with no scene, NEW SCENE (or CAPTURE SHOT) makes one, and Stories' Open in GEV selects one. Before SAVE TO STORIES it offers topic tags and THUMBNAIL. A scene's stories flag, storyThumb and storyTags are saved with the project and kept through export and import. Only the closed state loads with the page; the screens, styles, story data and controller load on first open. Stories keeps its place in the query (one history entry per screen) and holds the share link's hash writes while open. Keyboard input and voice tools stay with Stories while it is open. Explore's pins move on every drawn frame without asking for frames; the idle tour and tile settling are bounded. All strings are translated in the 13 locales. --- docs/CURRENT-STATE.md | 162 +- docs/VUE-MIGRATION.md | 2 +- index.html | 1 + scripts/format-scope.json | 27 + scripts/package-boundaries.json | 51 +- scripts/qa-form-fields.mjs | 86 +- scripts/qa-scene-controls.mjs | 9 +- src/app/tools.js | 17 + src/creditAttribution.test.mjs | 3 + src/data/bhoteKoshiEmbeddedMedia.js | 4 + src/director/document.js | 31 +- src/director/documentFields.js | 5 +- src/i18n/locales/ar.json | 189 +- src/i18n/locales/de.json | 177 +- src/i18n/locales/es.json | 180 +- src/i18n/locales/fr.json | 180 +- src/i18n/locales/he.json | 180 +- src/i18n/locales/it.json | 180 +- src/i18n/locales/ja.json | 174 +- src/i18n/locales/pt.json | 180 +- src/i18n/locales/ru.json | 183 +- src/i18n/locales/sv.json | 177 +- src/i18n/locales/uk.json | 183 +- src/i18n/locales/zh-CN.json | 174 +- src/i18n/locales/zh-Hant.json | 174 +- src/i18n/same-as-english.json | 30 +- src/navigationPolicy.js | 2 + src/scenes/director.js | 322 +- src/scenes/director.test.mjs | 569 ++- src/scenes/project.js | 11 + src/scenes/storyTags.js | 37 + src/scenes/storyThumb.js | 139 + src/scenes/storyThumb.test.mjs | 173 + src/sharelink.js | 46 +- src/sharelink.navigation.test.mjs | 47 + src/stories/boot.js | 119 + src/stories/boot.test.mjs | 142 + src/stories/catalog.js | 340 ++ src/stories/controller.js | 953 +++++ src/stories/controller.test.mjs | 787 ++++ src/stories/format.js | 46 + src/stories/gevLogo.js | 3 + src/stories/gevPlayer.js | 143 + src/stories/gevPlayer.test.mjs | 95 + src/stories/keyboard.js | 38 + src/stories/keyboard.test.mjs | 76 + src/stories/storyMeta.js | 150 + src/stories/thumbs.js | 102 + src/stories/thumbs.test.mjs | 68 + src/tooling/applicationHtml.test.mjs | 2 +- src/ui/sceneControls.js | 37 +- src/ui/sceneControls.test.mjs | 309 +- src/ui/scenePresentation.js | 32 +- src/ui/stores/scenes.js | 35 +- src/ui/stores/stories.js | 83 + src/ui/storiesCredit.test.mjs | 136 + src/ui/styles/english-css-parity.test.mjs | 4 +- src/ui/styles/scenes.css | 75 +- src/ui/styles/stories-entry.css | 243 ++ src/ui/styles/stories.css | 4031 +++++++++++++++++++++ src/ui/surfaceKeyboard.js | 2 + src/ui/views/LayerPanelsView.vue | 26 +- src/ui/views/SceneOptions.vue | 31 - src/ui/views/StoriesView.vue | 337 ++ src/ui/views/index.js | 2 + src/ui/views/panels/ImagerySplitView.vue | 2 +- src/ui/views/stories/ExploreScreen.vue | 782 ++++ src/ui/views/stories/StoriesHeader.vue | 181 + src/ui/views/stories/StoryContext.vue | 414 +++ src/ui/views/stories/StoryRail.vue | 53 + src/ui/views/stories/StoryScreen.vue | 631 ++++ src/ui/views/stories/StoryTimeline.vue | 560 +++ src/ui/wildlifeSightingCard.js | 2 + src/voice/gevActions.js | 11 + src/voice/gevActions.test.mjs | 42 + src/voice/realtimeInput.js | 4 +- style.css | 1 + 77 files changed, 14975 insertions(+), 260 deletions(-) create mode 100644 src/scenes/storyTags.js create mode 100644 src/scenes/storyThumb.js create mode 100644 src/scenes/storyThumb.test.mjs create mode 100644 src/stories/boot.js create mode 100644 src/stories/boot.test.mjs create mode 100644 src/stories/catalog.js create mode 100644 src/stories/controller.js create mode 100644 src/stories/controller.test.mjs create mode 100644 src/stories/format.js create mode 100644 src/stories/gevLogo.js create mode 100644 src/stories/gevPlayer.js create mode 100644 src/stories/gevPlayer.test.mjs create mode 100644 src/stories/keyboard.js create mode 100644 src/stories/keyboard.test.mjs create mode 100644 src/stories/storyMeta.js create mode 100644 src/stories/thumbs.js create mode 100644 src/stories/thumbs.test.mjs create mode 100644 src/ui/stores/stories.js create mode 100644 src/ui/storiesCredit.test.mjs create mode 100644 src/ui/styles/stories-entry.css create mode 100644 src/ui/styles/stories.css delete mode 100644 src/ui/views/SceneOptions.vue create mode 100644 src/ui/views/StoriesView.vue create mode 100644 src/ui/views/stories/ExploreScreen.vue create mode 100644 src/ui/views/stories/StoriesHeader.vue create mode 100644 src/ui/views/stories/StoryContext.vue create mode 100644 src/ui/views/stories/StoryRail.vue create mode 100644 src/ui/views/stories/StoryScreen.vue create mode 100644 src/ui/views/stories/StoryTimeline.vue 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';