Extend final shot to chunk boundary
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user