Extend final shot to chunk boundary
tests / test (push) Canceled after 0s
tests / windows-storage (push) Canceled after 0s

This commit is contained in:
2026-10-15 08:36:32 +00:00
parent 70ba74bc78
commit 3f006030c6
4 changed files with 16 additions and 0 deletions
+8
View File
@@ -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";