fix(mobile): director number keys work with the menu open, plus engine fixes

Number keys 1-9, 0, - and = jump to beats whether or not the director
is open. The engine now draws real river outlines over Esri's
inconsistent Hudson imagery, declutters Moment labels, and makes
playMoment, exitMoment and setTime(null) safe at any time (each view-
cone line owns its material; teardown waits for the frame in flight).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VVYRAqiQj9Y1V9ZfG1RcDH
This commit is contained in:
Claude committed 2026-10-23 08:15:00 +00:00
1 parent 070b549990
commit 4e1e838771
8 files changed
+227 -41

No files matched your search

+11 -4
View File
@@ -1,8 +1,8 @@
/**
* Director (DESIGN.md §12.8): a presenter menu for demos. Press "." (or
* triple-tap the Today title) to open it; each beat sets up its state
* deterministically so the demo never depends on luck. Number keys 1–9 jump
* straight to a beat while the menu is closed and the director is armed.
* deterministically so the demo never depends on luck. Number keys 1–9, 0, - and = jump
* straight to a beat, whether or not the menu is open.
*/
import { icon } from './icons.js';
@@ -23,7 +23,7 @@ export function createDirector({ beats, onReset }) {
let current = -1;
function render() {
sheet.head.innerHTML = `<div class="dir-kicker tele">${icon('director')}DIRECTOR · DEMO MODE</div><h2 class="sheet-title">The story, beat by beat</h2><div class="sheet-sub">Each beat sets its own state. Keys 1–9 jump; “.” reopens this menu.</div>`;
sheet.head.innerHTML = `<div class="dir-kicker tele">${icon('director')}DIRECTOR · DEMO MODE</div><h2 class="sheet-title">The story, beat by beat</h2><div class="sheet-sub">Each beat sets its own state. Keys 1–9, 0, - and = jump; “.” opens this menu.</div>`;
sheet.body.innerHTML = `<ol class="dir-beats">${beats
.map(
(
@@ -71,7 +71,14 @@ export function createDirector({ beats, onReset }) {
else open();
return;
}
if (armed && /^[1-9]$/.test(e.key) && !sheet.isOpen) run(Number(e.key) - 1);
// 1–9 and 0 jump to beats 1–10, - and = to 11 and 12, menu open or not:
// a presenter reads the menu and presses the number.
const keyBeat = { 0: 9, '-': 10, '=': 11 }[e.key] ?? Number(e.key) - 1;
if (armed && /^[0-9=-]$/.test(e.key)) {
e.preventDefault();
if (sheet.isOpen) sheet.close();
run(keyBeat);
}
});
function open() {