From b877b49c78a90333f86195e041750a78d9d81cff Mon Sep 17 00:00:00 2001 From: Chris Dumas Date: Thu, 15 Oct 2026 09:00:54 +0000 Subject: [PATCH] Append markers when adding shots --- web/sequence_prompt_builder.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/sequence_prompt_builder.js b/web/sequence_prompt_builder.js index 437ff00..2839940 100644 --- a/web/sequence_prompt_builder.js +++ b/web/sequence_prompt_builder.js @@ -82,10 +82,11 @@ function configure(node) { // slots are only the timeline model used to paint the bar and to locate // boundaries. Rebuilding the textarea from slots is lossy (and was the // reason a redraw could erase text that had just been typed). + const formatPromptFromSlots = (clip) => clip.slots.map((slot, index) => + `[Shot ${index + 1}] At ${formatTime(slot.start)}, ${slot.text || ""}`).join("\n\n"); const promptFor = (clip) => { if (typeof clip.prompt === "string" && clip.prompt.length) return clip.prompt; - return clip.slots.map((slot, index) => - `[Shot ${index + 1}] At ${formatTime(slot.start)}, ${slot.text || ""}`).join("\n\n"); + return formatPromptFromSlots(clip); }; const syncPrompt = (clip, value) => { const text = String(value || ""); @@ -119,7 +120,7 @@ function configure(node) { // Adding/removing a shot is the one operation allowed to add/remove // marker lines. Preserve all existing shot text before formatting. syncPrompt(clip, clip.prompt || promptFor(clip)); - clip.prompt = promptFor(clip); + clip.prompt = formatPromptFromSlots(clip); }; const render = () => { const count = Math.max(1, Math.min(MAX_CLIPS, Number(countWidget.value) || 1));