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.
This commit is contained in:
Manjunath committed 2026-11-16 20:12:10 +05:30
1 parent da81cf743b
commit 5418438339
77 files changed
+14975 -260

No files matched your search

+44 -2
View File
@@ -345,15 +345,35 @@ export class ShareLinkManager {
const target = globalThis.window;
if (typeof target?.addEventListener !== 'function') return;
const handler = () => this._handleLocationChange(onNavigate);
this._onNavigate = onNavigate;
target.addEventListener('hashchange', handler);
target.addEventListener('popstate', handler);
this._unwatchNavigation = () => {
target.removeEventListener('hashchange', handler);
target.removeEventListener('popstate', handler);
this._unwatchNavigation = null;
this._onNavigate = null;
};
}
/**
* Restore a share hash now, even when it is the one the address already
* shows: an owner that changed the view under it (Stories, after a GEV
* scene) hands the person's view back this way. Navigation must be watched.
* @param {string} hash Without the leading `#`.
* @returns {boolean} Whether a restore began.
*/
restore(hash) {
if (this._destroyed || !this._onNavigate || typeof hash !== 'string')
return false;
const url = new URL(window.location.href);
url.hash = hash;
history.replaceState(history.state, '', url.href);
this._knownHash = null;
this._handleLocationChange(this._onNavigate);
return this._knownHash === hash;
}
_handleLocationChange(onNavigate) {
if (this._destroyed) return;
const hash = window.location.hash.slice(1);
@@ -692,8 +712,28 @@ export class ShareLinkManager {
}
}
/**
* Hold the address's hash writes, for an owner that covers the view and
* keeps the person's camera and layers out of the address while it does
* (Stories). Releasing writes the current view again.
* @param {boolean} held
*/
holdWrites(held) {
if (held && !this._writesHeld && this._debounceTimer) {
// A view change still waiting for its debounce is written first, so
// the address the owner saves is the live view.
clearTimeout(this._debounceTimer);
this._debounceTimer = null;
this._updateHash();
}
this._writesHeld = !!held;
if (!held) this._scheduleUpdate();
else clearTimeout(this._debounceTimer);
}
_scheduleUpdate() {
if (this._destroyed || this._initialRestorePending) return;
if (this._destroyed || this._initialRestorePending || this._writesHeld)
return;
clearTimeout(this._debounceTimer);
this._debounceTimer = setTimeout(() => this._updateHash(), DEBOUNCE_MS);
}
@@ -711,7 +751,9 @@ export class ShareLinkManager {
: new URL(window.location.href);
url.hash = params.toString();
this._knownHash = url.hash.slice(1);
history.replaceState(null, '', url.href);
// Keep the entry's state: another owner (Stories) may have stored its
// place there, and a hash update is not a new place.
history.replaceState(history.state, '', url.href);
}
/** Build a deterministic snapshot without mutating history. */