Append markers when adding shots
tests / test (push) Canceled after 0s
tests / windows-storage (push) Canceled after 0s

This commit is contained in:
2026-10-15 09:00:54 +00:00
parent 616a38fc9e
commit b877b49c78
+4 -3
View File
@@ -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));