Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(website): give the recreation's lane hints their {{key}}

Etienne Lescot9f1a5b241970
diff --git a/website/scripts/gen-recreation.mjs b/website/scripts/gen-recreation.mjs
index 856005b3e..d5c4c1f58 100644
--- a/website/scripts/gen-recreation.mjs
+++ b/website/scripts/gen-recreation.mjs
@@ -113,6 +113,12 @@ const { buildClipSection, isSilenceWord, SILENCE_THRESHOLD_SEC } = await appModu
const { CURSOR_THEMES, DEFAULT_CURSOR_THEME_ID, resolveCursorSprites } = await appModule(
"src/lib/cursor/cursorThemes.ts",
);
+// The empty-lane hints take their key through {{key}} since the app learned to
+// show the bound shortcut (358c3383). The recreation shows a fresh install, so
+// the default bindings, formatted the way the app formats them. No import of
+// its own, so it loads as-is like cursorThemes.ts.
+const { DEFAULT_SHORTCUTS, formatBinding } = await appModule("src/lib/shortcuts.ts");
+const shortcutKey = (action) => ({ key: formatBinding(DEFAULT_SHORTCUTS[action], true) });
// ── locale access that fails loudly ─────────────────────────────────────
const locale = (ns) =>
@@ -406,11 +412,36 @@ const trimPills = trims.map((r) => ({
}));
const LANE_ORDER = [
- { id: "annotation", hintKey: "timeline:hints.pressAnnotation", pills: [] },
- { id: "speed", hintKey: "timeline:hints.pressSpeed", pills: [] },
- { id: "trim", hintKey: "timeline:hints.pressTrim", pills: trimPills },
- { id: "zoom", hintKey: "timeline:hints.pressZoom", pills: zoomPills },
- { id: "cameraFullscreen", hintKey: "timeline:hints.pressCameraFullscreen", pills: [] },
+ {
+ id: "annotation",
+ hintKey: "timeline:hints.pressAnnotation",
+ hintVars: shortcutKey("addAnnotation"),
+ pills: [],
+ },
+ {
+ id: "speed",
+ hintKey: "timeline:hints.pressSpeed",
+ hintVars: shortcutKey("addSpeed"),
+ pills: [],
+ },
+ {
+ id: "trim",
+ hintKey: "timeline:hints.pressTrim",
+ hintVars: shortcutKey("addTrim"),
+ pills: trimPills,
+ },
+ {
+ id: "zoom",
+ hintKey: "timeline:hints.pressZoom",
+ hintVars: shortcutKey("addZoom"),
+ pills: zoomPills,
+ },
+ {
+ id: "cameraFullscreen",
+ hintKey: "timeline:hints.pressCameraFullscreen",
+ hintVars: shortcutKey("addCameraFullscreen"),
+ pills: [],
+ },
];
// Cross-check against the document rather than trusting the table above: a lane
@@ -433,7 +464,7 @@ for (const lane of LANE_ORDER) {
const LANES = LANE_ORDER.map((lane) => ({
id: lane.id,
- hint: lane.pills.length === 0 ? t(lane.hintKey) : null,
+ hint: lane.pills.length === 0 ? t(lane.hintKey, lane.hintVars) : null,
pills: lane.pills,
}));
const PILLS = LANES.flatMap((lane) => lane.pills);
@@ -1054,7 +1085,7 @@ const PROVENANCE = [
})),
...LANES.filter((l) => l.hint).map((l) => ({
shown: l.hint,
- source: `timeline.json hints.press${l.id[0].toUpperCase()}${l.id.slice(1)} — rendered because the document holds no ${l.id} regions`,
+ source: `computed: timeline.json hints.press${l.id[0].toUpperCase()}${l.id.slice(1)} with {{key}} = the default binding (shortcuts.ts DEFAULT_SHORTCUTS, formatBinding) — rendered because the document holds no ${l.id} regions`,
})),
{
shown: RULER.variants[0].labels.map((l) => l.text).join(" "),
diff --git a/website/src/components/Recreation/generated.ts b/website/src/components/Recreation/generated.ts
index 49a910880..91b1e19e3 100644
--- a/website/src/components/Recreation/generated.ts
+++ b/website/src/components/Recreation/generated.ts
@@ -730,9 +730,9 @@ export const PROVENANCE: ProvenanceEntry[] = [
{ shown: "1.80×", source: "computed: effectiveZoomScale(zoomRanges depth 3).toFixed(2) + \"×\" from src/lib/ai-edition/timeline/zoom-scale.ts" },
{ shown: "0:02.2", source: "computed: formatSec(2.19 − 0) over trimRange trim_f52989cf-489c-47f5-a6c7-b95a7d71b399" },
{ shown: "0:04.9", source: "computed: formatSec(40.033 − 35.12) over trimRange trim_3bad6006-721a-4dd4-a218-091fa734a63e" },
- { shown: "Press A to add annotation", source: "timeline.json hints.pressAnnotation — rendered because the document holds no annotation regions" },
- { shown: "Press S to add speed", source: "timeline.json hints.pressSpeed — rendered because the document holds no speed regions" },
- { shown: "Press C to add a Full Camera segment", source: "timeline.json hints.pressCameraFullscreen — rendered because the document holds no cameraFullscreen regions" },
+ { shown: "Press A to add annotation", source: "computed: timeline.json hints.pressAnnotation with {{key}} = the default binding (shortcuts.ts DEFAULT_SHORTCUTS, formatBinding) — rendered because the document holds no annotation regions" },
+ { shown: "Press S to add speed", source: "computed: timeline.json hints.pressSpeed with {{key}} = the default binding (shortcuts.ts DEFAULT_SHORTCUTS, formatBinding) — rendered because the document holds no speed regions" },
+ { shown: "Press C to add a Full Camera segment", source: "computed: timeline.json hints.pressCameraFullscreen with {{key}} = the default binding (shortcuts.ts DEFAULT_SHORTCUTS, formatBinding) — rendered because the document holds no cameraFullscreen regions" },
{ shown: "0:00 0:02 0:04 0:06 0:08 0:10 0:12 0:14 0:16 0:18 0:20 0:22 0:24 0:26 0:28 0:30 0:32 0:34 0:36 0:38 0:40", source: "computed: fmtTick lifted from V4Timeline.tsx over a 2s step, itself derived as the first TICK_STEPS_SEC entry clearing MIN_LABEL_GAP_PX 76 at 47.9604 px/s" },
{ shown: "0:40.0", source: "computed: formatSec(assets[0].durationSec = 40.033)" },
{ shown: "0:17.5", source: "computed: formatSec(zoomRanges[1].sourceStartSec = 17.5) — where the loop starts" },