Match sequence editor to CSGlide timeline UI
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
- Add the DUMAS H3 Sequence Prompt Builder with clip tabs, local timeline
|
||||
slots, and one canonical absolute Timeline prompt output.
|
||||
- Refine its UI around the CSGlide shot-timeline pattern: one multiline shot
|
||||
editor, coloured shot bands, and shared boundary sliders.
|
||||
|
||||
## 3.9.4 — Registry packaging repair (2026-10-14)
|
||||
|
||||
|
||||
@@ -9,8 +9,9 @@ flattened to absolute timeline positions when the node executes, so it can be
|
||||
connected directly to `Sequence Prompt` with `Prompt Format = Timeline` (or
|
||||
`Auto`).
|
||||
|
||||
Each slot has CSGlide-style start/end sliders and numeric values. Use the
|
||||
`@ Add next time slot` button, or type `@` at the start of a new line in a slot
|
||||
The editor follows the CSGlide shot-timeline model: one prompt editor per
|
||||
clip, coloured shot bands, and draggable boundary sliders between shots. Use
|
||||
the `@ Add shot` button, or type `@` at the start of a new line in the prompt
|
||||
editor, to create the following timed section quickly.
|
||||
|
||||
The node keeps the shared visual directive, soundscape, and non-diegetic music
|
||||
|
||||
+5
-4
@@ -2,10 +2,11 @@
|
||||
|
||||
## 2026-10-15 — CSGlide-style timeline controls
|
||||
|
||||
- Add per-slot start/end range sliders, a visual duration bar, and numeric
|
||||
controls to the Sequence Prompt Builder.
|
||||
- Add `@ Add next time slot` plus a line-start `@` keyboard shortcut for rapid
|
||||
prompt authoring without changing the emitted Timeline format.
|
||||
- Match CSGlide's shot-timeline interaction: one prompt editor per clip,
|
||||
coloured shot bands, and boundary sliders that move adjacent shot edges
|
||||
together.
|
||||
- Add `@ Add shot` plus a line-start `@` keyboard shortcut for rapid prompt
|
||||
authoring without changing the emitted Timeline format.
|
||||
|
||||
## 2026-10-15 — Sequence prompt builder
|
||||
|
||||
|
||||
@@ -63,6 +63,16 @@ function configure(node) {
|
||||
text: "",
|
||||
});
|
||||
};
|
||||
const formatTime = (seconds) => `00:${Number(seconds).toFixed(3).padStart(6, "0")}`;
|
||||
const promptFor = (clip) => clip.slots.map((slot, index) =>
|
||||
`[Shot ${index + 1}] At ${formatTime(slot.start)}, ${slot.text || ""}`).join("\n\n");
|
||||
const syncPrompt = (clip, value) => {
|
||||
const blocks = String(value || "").split(/\n\s*\n(?=\[Shot\s+\d+\])/i);
|
||||
blocks.forEach((block, index) => {
|
||||
if (!clip.slots[index]) return;
|
||||
clip.slots[index].text = block.replace(/^\[Shot\s+\d+\][^\n]*\n?/i, "").trim();
|
||||
});
|
||||
};
|
||||
const render = () => {
|
||||
const count = Math.max(1, Math.min(MAX_CLIPS, Number(countWidget.value) || 1));
|
||||
while (state.clips.length < count) state.clips.push({ duration: Number(secondsWidget.value) || 4, slots: [] });
|
||||
@@ -72,41 +82,29 @@ function configure(node) {
|
||||
state.clips.forEach((clip, index) => { const button = el("button", `Clip ${index + 1}`); button.type = "button"; button.disabled = index === active; button.onclick = () => { active = index; render(); }; tabs.append(button); });
|
||||
panel.append(tabs);
|
||||
const clip = state.clips[active];
|
||||
const durationLabel = el("label", "Chunk duration (seconds)");
|
||||
panel.append(durationLabel, input("number", clip.duration, (value) => { clip.duration = Math.max(0.1, Number(value) || 0.1); clip.slots.forEach((slot) => { slot.end = Math.min(slot.end, clip.duration); }); setState(); render(); }));
|
||||
const heading = el("div", "Time slots are local to this clip; output is converted to absolute times."); heading.style.cssText = "margin:5px 0;color:#b7d6bf"; panel.append(heading);
|
||||
clip.slots.forEach((slot, slotIndex) => {
|
||||
const row = el("fieldset"); row.style.cssText = "border:1px solid #4a7255;margin:5px 0;padding:4px";
|
||||
const legend = el("legend", `Slot ${slotIndex + 1}`); row.append(legend);
|
||||
const track = el("div"); track.style.cssText = "height:7px;position:relative;margin:4px 0 7px;background:#15251a;border-radius:4px";
|
||||
const fill = el("div"); fill.style.cssText = "height:100%;position:absolute;background:#79c98a;border-radius:4px";
|
||||
const duration = Number(clip.duration) || 0.1;
|
||||
const updateTrack = () => { fill.style.left = `${Math.max(0, Number(slot.start) / duration * 100)}%`; fill.style.width = `${Math.max(0, (Number(slot.end) - Number(slot.start)) / duration * 100)}%`; };
|
||||
track.append(fill); row.append(track);
|
||||
const times = el("div"); times.style.cssText = "display:flex;gap:4px";
|
||||
const startSlider = input("range", slot.start, (value) => { slot.start = Math.min(Math.max(0, Number(value)), Number(slot.end) - 0.1); updateTrack(); setState(); });
|
||||
startSlider.min = 0; startSlider.max = Math.max(0.1, duration - 0.1); startSlider.step = 0.1;
|
||||
const endSlider = input("range", slot.end, (value) => { slot.end = Math.max(Number(slot.start) + 0.1, Math.min(duration, Number(value))); updateTrack(); setState(); });
|
||||
endSlider.min = 0.1; endSlider.max = duration; endSlider.step = 0.1;
|
||||
const startNumber = input("number", slot.start, (value) => { slot.start = Math.min(Math.max(0, Number(value) || 0), Number(slot.end) - 0.1); startSlider.value = slot.start; updateTrack(); setState(); });
|
||||
const endNumber = input("number", slot.end, (value) => { slot.end = Math.max(Number(slot.start) + 0.1, Math.min(duration, Number(value) || duration)); endSlider.value = slot.end; updateTrack(); setState(); });
|
||||
startNumber.step = endNumber.step = 0.1; startNumber.style.width = endNumber.style.width = "62px";
|
||||
const startLabel = el("label", "Start"); startLabel.append(startSlider, startNumber);
|
||||
const endLabel = el("label", "End"); endLabel.append(endSlider, endNumber);
|
||||
times.append(startLabel, endLabel); row.append(times); updateTrack();
|
||||
const text = el("textarea"); text.value = slot.text || ""; text.rows = 3; text.placeholder = "Describe this timed action. Type @ at the start of a new line to add the next slot."; text.style.cssText = "width:100%;box-sizing:border-box;color:#111";
|
||||
text.onchange = () => { slot.text = text.value; setState(); };
|
||||
text.onkeydown = (event) => {
|
||||
if (event.key !== "@") return;
|
||||
const cursor = text.selectionStart || 0;
|
||||
if (cursor !== 0 && text.value[cursor - 1] !== "\n") return;
|
||||
event.preventDefault(); addSlot(clip, slotIndex); setState(); render();
|
||||
};
|
||||
row.append(text);
|
||||
const remove = el("button", "Remove slot"); remove.type = "button"; remove.onclick = () => { clip.slots.splice(slotIndex, 1); setState(); render(); }; row.append(remove); panel.append(row);
|
||||
const durationRow = el("div"); durationRow.style.cssText = "display:flex;align-items:center;gap:8px;margin:4px 0";
|
||||
durationRow.append(el("strong", `Clip ${active + 1}`), el("span", "duration"));
|
||||
const duration = input("number", clip.duration, (value) => { clip.duration = Math.max(0.1, Number(value) || 0.1); clip.slots.forEach((slot) => { slot.end = Math.min(slot.end, clip.duration); }); setState(); render(); });
|
||||
duration.step = 0.1; duration.style.width = "70px"; durationRow.append(duration, el("span", "seconds")); panel.append(durationRow);
|
||||
const timeline = el("div"); timeline.style.cssText = "display:flex;height:38px;gap:2px;margin:8px 0 3px;background:#15251a;border-radius:3px;overflow:hidden";
|
||||
const palette = ["#4b9b67", "#4d7fb1", "#a87945", "#8c5aa8", "#a44f5d", "#3f8e8a"];
|
||||
clip.slots.forEach((slot, index) => { const segment = el("button", `Shot ${index + 1}\n${(slot.text || "unscripted").slice(0, 18)}`); segment.type = "button"; segment.title = `${slot.start.toFixed(1)}s–${slot.end.toFixed(1)}s`; segment.style.cssText = `flex:${Math.max(0.1, slot.end - slot.start)};border:0;color:white;background:${palette[index % palette.length]};white-space:pre-wrap;font-size:10px;overflow:hidden`; segment.onclick = () => { prompt.focus(); }; timeline.append(segment); });
|
||||
panel.append(timeline);
|
||||
const sliderHint = el("div", "Drag shot boundaries to retime the prompt. Grey areas are unscripted."); sliderHint.style.cssText = "color:#b7d6bf;margin-bottom:4px"; panel.append(sliderHint);
|
||||
clip.slots.slice(0, -1).forEach((slot, index) => {
|
||||
const next = clip.slots[index + 1]; const boundary = input("range", slot.end, (value) => { const point = Math.min(Number(clip.duration) - 0.1, Math.max(0.1, Number(value))); slot.end = point; next.start = point; setState(); render(); });
|
||||
boundary.min = 0.1; boundary.max = Math.max(0.1, Number(clip.duration) - 0.1); boundary.step = 0.1;
|
||||
const row = el("label", `Shot ${index + 1} / ${index + 2} · ${Number(slot.end).toFixed(1)}s`); row.style.cssText = "display:block;color:#d9f0dc"; row.append(boundary); panel.append(row);
|
||||
});
|
||||
const add = el("button", "@ Add next time slot"); add.type = "button"; add.title = "Add a new slot after the last slot"; add.onclick = () => { addSlot(clip); setState(); render(); }; panel.append(add);
|
||||
display.computeSize = (width) => [Math.max(360, Number(width) || 360), Math.min(620, 110 + clip.slots.length * 150)];
|
||||
const prompt = el("textarea"); prompt.rows = 9; prompt.value = promptFor(clip); prompt.placeholder = "[Shot 1] At 00:00.000, describe the opening action...\n\nType @ at the start of a new line to add the next shot."; prompt.style.cssText = "width:100%;box-sizing:border-box;color:#111;font:12px monospace;margin-top:6px";
|
||||
prompt.onchange = () => { syncPrompt(clip, prompt.value); setState(); render(); };
|
||||
prompt.onkeydown = (event) => { if (event.key !== "@") return; const cursor = prompt.selectionStart || 0; if (cursor !== 0 && prompt.value[cursor - 1] !== "\n") return; event.preventDefault(); addSlot(clip); setState(); render(); };
|
||||
panel.append(prompt);
|
||||
const actions = el("div"); actions.style.cssText = "display:flex;gap:5px;margin-top:5px";
|
||||
const add = el("button", "@ Add shot"); add.type = "button"; add.onclick = () => { addSlot(clip); setState(); render(); }; actions.append(add);
|
||||
if (clip.slots.length > 1) { const remove = el("button", "Remove last shot"); remove.type = "button"; remove.onclick = () => { clip.slots.pop(); clip.slots.at(-1).end = clip.duration; setState(); render(); }; actions.append(remove); }
|
||||
panel.append(actions);
|
||||
display.computeSize = (width) => [Math.max(360, Number(width) || 360), Math.min(620, 185 + clip.slots.length * 42)];
|
||||
node.setSize?.([Math.max(360, Number(node.size?.[0]) || 360), Number(node.computeSize?.()[1]) || 420]);
|
||||
};
|
||||
const refresh = () => { state = readState(stateWidget, Number(countWidget.value) || 2, Number(secondsWidget.value) || 4); render(); setState(); };
|
||||
|
||||
Reference in New Issue
Block a user