From b9f2ba9e47899196cc1d3a6db39acb5f6e2c8a39 Mon Sep 17 00:00:00 2001 From: th Date: Wed, 22 Apr 2026 07:44:43 +0200 Subject: [PATCH] 0.9.1: jumpToScene action + auto-play on scene switch Co-Authored-By: Claude Opus 4.7 (1M context) --- package.json | 2 +- src/components/ActionEditor.vue | 25 +++ src/components/FullscreenPreview.vue | 52 ++++- src/devtools/tests.ts | 315 ++++++++++++++++++++++++++- src/i18n/messages.ts | 3 + src/lib/actions.ts | 20 ++ src/lib/exportPlayer.ts | 19 +- src/stores/scene.ts | 11 +- src/types/scene.ts | 4 + 9 files changed, 436 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index f1f35a2..41cc20b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "animatr", "private": true, - "version": "0.9.0", + "version": "0.9.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src/components/ActionEditor.vue b/src/components/ActionEditor.vue index 4542115..fdf9107 100644 --- a/src/components/ActionEditor.vue +++ b/src/components/ActionEditor.vue @@ -19,6 +19,10 @@ const markerNames = computed(() => (store.scene.markers ?? []).map((m) => m.name), ) +const sceneOptions = computed(() => + store.project.scenes.map((s) => ({ id: s.id, name: s.name })), +) + const ACTION_TYPES: Action['type'][] = [ 'play', 'pause', @@ -26,6 +30,7 @@ const ACTION_TYPES: Action['type'][] = [ 'jumpTo', 'jumpToFrame', 'jumpToMarker', + 'jumpToScene', 'script', ] @@ -45,6 +50,14 @@ function makeDefault(type: Action['type']): Action { return { type: 'jumpToFrame', frame: 0 } case 'jumpToMarker': return { type: 'jumpToMarker', name: markerNames.value[0] ?? '' } + case 'jumpToScene': { + // Default to the first scene that ISN'T the current one so the + // action is immediately useful; fall back to the first if there's + // only one scene. + const others = sceneOptions.value.filter((s) => s.id !== store.project.activeSceneId) + const target = others[0] ?? sceneOptions.value[0] + return { type: 'jumpToScene', sceneId: target?.id ?? '' } + } case 'script': return { type: 'script', source: '' } } @@ -152,6 +165,18 @@ function onTypeChange(index: number, newType: Action['type']) { +
+ +