diff --git a/README.md b/README.md index 7a0bfce..7edfc78 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ All clip tabs use the single `Default chunk duration` control. There is no per-clip duration because Continuum multi-clip projects are intentionally uniform; resizing a shot boundary updates its timestamp in the visible prompt editor immediately. +The final shot is always extended to the end of the track, so adding or +resizing shots cannot leave an unintended unassigned tail. The editor follows the CSGlide shot-timeline model: one prompt editor per clip, coloured shot bands, and draggable boundary sliders between shots. Use diff --git a/WORKLOG.md b/WORKLOG.md index bd77083..2f37f26 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -9,6 +9,8 @@ authoring without changing the emitted Timeline format. - Make `Default chunk duration` the only duration control; all clip tabs now share it and legacy per-clip duration values are ignored. +- Ensure the final shot always ends at the full chunk duration; adding a shot + splits the previous final shot instead of leaving a grey tail. ## 2026-10-15 — Sequence prompt builder diff --git a/prompt_builder.py b/prompt_builder.py index 4385d3e..6af7116 100644 --- a/prompt_builder.py +++ b/prompt_builder.py @@ -84,6 +84,10 @@ def normalize_sequence(value: Any, *, clip_count: int, default_seconds: float) - if text: slots.append({"start": start, "end": end, "text": text}) slots.sort(key=lambda slot: (slot["start"], slot["end"])) + if slots: + # The final shot owns the end of every uniform-duration chunk; + # there must be no unassigned tail on the editor track. + slots[-1]["end"] = duration clips.append({"duration": duration, "slots": slots}) return {"version": 1, "clips": clips} diff --git a/web/sequence_prompt_builder.js b/web/sequence_prompt_builder.js index 9fba28f..92e6a07 100644 --- a/web/sequence_prompt_builder.js +++ b/web/sequence_prompt_builder.js @@ -55,6 +55,13 @@ function configure(node) { }; const addSlot = (clip, afterIndex = clip.slots.length - 1) => { const duration = Number(clip.duration) || 0.1; + if (afterIndex === clip.slots.length - 1 && afterIndex >= 0) { + const previous = clip.slots[afterIndex]; + const split = Number(previous.start) + Math.max(0.1, (duration - Number(previous.start)) / 2); + previous.end = Math.min(duration - 0.1, split); + clip.slots.splice(afterIndex + 1, 0, { start: previous.end, end: duration, text: "" }); + return; + } const previousEnd = afterIndex >= 0 ? Number(clip.slots[afterIndex]?.end) || 0 : 0; const remaining = Math.max(0.1, duration - previousEnd); clip.slots.splice(afterIndex + 1, 0, { @@ -86,6 +93,7 @@ function configure(node) { // All clips share the one authoritative project duration widget. const duration = chunkDuration; clip.duration = duration; + if (clip.slots.length) clip.slots[clip.slots.length - 1].end = duration; const durationRow = el("div"); durationRow.style.cssText = "display:flex;align-items:center;gap:8px;margin:4px 0;color:#b7d6bf"; durationRow.append(el("strong", `Clip ${active + 1}`), el("span", `· ${duration.toFixed(1)}s shared chunk duration`)); panel.append(durationRow); const timeline = el("div"); timeline.style.cssText = "position:relative;height:44px;margin:8px 0 3px;background:#15251a;border-radius:3px;overflow:hidden;border:1px solid #41634a";