Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Editor: the generation bar keeps its layout while a part is made; the wait line clears when it ends

Bowen Xue45be45623980
diff --git a/web/editor.css b/web/editor.css
index 645fb2e..89de825 100644
--- a/web/editor.css
+++ b/web/editor.css
@@ -69,6 +69,8 @@
.fv-ed-gen-stage{flex:0 1000 auto}
.fv-ed-gen-time{flex:none;max-width:100%}
.fv-ed-genbar[data-mode=selected] .fv-ed-gen-hint{flex:none}
+.fv-ed-genbar[data-mode=running] .fv-ed-gen-hint{order:1;flex:none}
+.fv-ed-genbar[data-mode=running]>button:not(.fv-ed-generate){order:2}
.fv-ed-gen-note{font-size:13px;color:var(--fv-ink);flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fv-ed-gen-note[hidden]{display:none}
.fv-editor:has(.fv-ed-gen-failure:not([hidden])){--fv-ed-generation-row:max-content}
diff --git a/web/editor.js b/web/editor.js
index 1030562..d5a44d0 100644
--- a/web/editor.js
+++ b/web/editor.js
@@ -241,7 +241,7 @@ export function openEditor({api, app, from = null, panel = {}, components: given
return true;
}
const content = record => JSON.stringify({...record, id: null, revision: 0});
- function notify(text) { if (disposed) return; notice.textContent = text; notice.hidden = false; clearTimeout(noticeTimer); noticeTimer = setTimeout(() => { notice.hidden = true; }, 9000); }
+ function notify(text) { if (disposed) return; if (!text) { clearTimeout(noticeTimer); notice.hidden = true; return; } notice.textContent = text; notice.hidden = false; clearTimeout(noticeTimer); noticeTimer = setTimeout(() => { notice.hidden = true; }, 9000); }
// `step` names what was being done, so a failure there says which step went wrong.
function error(value, step = null) {
const code = value?.reason || value?.code || value?.message;
diff --git a/web/editor_genbar.js b/web/editor_genbar.js
index 137a2cf..2e2c459 100644
--- a/web/editor_genbar.js
+++ b/web/editor_genbar.js
@@ -74,7 +74,9 @@ export function createEditorGenbar(host, {state, t, actions, text = ''}) {
const opening = (starting || !!actions.selectionSending?.()) && !held;
const stopped = ['failed', 'cancelled', 'interrupted'].includes(status?.state);
host.dataset.mode = busy ? 'running' : selected ? 'selected' : 'idle';
- hint.hidden = !busy && !other; input.hidden = generate.hidden = busy;
+ hint.hidden = !busy && !other;
+ // The description and Generate stay where they are while a part is made, greyed, so nothing around them moves.
+ input.hidden = generate.hidden = false;
// A choice that will move to an empty spot can still be described first.
const writable = selected || !previewSelection && !!selection && !!actions.selectionMovable?.();
input.disabled = !writable || busy;
diff --git a/web/editor_references.js b/web/editor_references.js
index e085128..5f2f8ec 100644
--- a/web/editor_references.js
+++ b/web/editor_references.js
@@ -12,7 +12,7 @@ export function createEditorReferences({t, source, size = () => null, error = ()
const menu = el('div', 'fv-ed-ref-menu'); menu.hidden = true; menu.setAttribute('role', 'menu');
const picker = el('input'); picker.type = 'file'; picker.accept = 'image/*'; picker.multiple = true; picker.hidden = true;
root.append(add, chips, menu, picker);
- let shown = false, busy = false, working = false, opener = null, disposed = false, entries = [];
+ let shown = false, busy = false, working = false, opener = null, disposed = false, entries = [], waited = false;
const active = () => source.rows().map((row, index) => ({row, index})).filter(({row}) => row.enabled !== false);
const isImage = file => IMAGE.test(file || '');
// On hover without a full stop; in the notice line with one.
@@ -109,7 +109,10 @@ export function createEditorReferences({t, source, size = () => null, error = ()
if (rows[entry.index]?.file === entry.row.file) { rows[entry.index] = {...rows[entry.index], enabled: false}; write(rows); }
})];
}
+ // The line said on a click while a part is made; it goes away with the busy state it describes.
+ const wait = () => { waited = true; notify(sentence(waitText())); };
function update(isBusy = busy, visible = shown) {
+ if (waited && busy && !isBusy) { waited = false; notify(''); }
busy = isBusy; shown = visible;
root.hidden = !shown || !source.available();
if ((root.hidden || busy) && !menu.hidden) close(false);
@@ -125,12 +128,12 @@ export function createEditorReferences({t, source, size = () => null, error = ()
chip.title = busy ? waitText() : label(entry.row.role); chip.setAttribute('aria-haspopup', 'menu');
chip.setAttribute('aria-label', label(entry.row.role));
chip.append(thumb(entry.row.file, 'fv-ed-ref-thumb'));
- chip.onclick = () => { if (busy) { notify(sentence(waitText())); return; } if (!menu.hidden && opener === chip) close(); else open(chip, chipMenu(entry)); };
+ chip.onclick = () => { if (busy) { wait(); return; } if (!menu.hidden && opener === chip) close(); else open(chip, chipMenu(entry)); };
return chip;
}));
}
add.onclick = () => {
- if (busy) { notify(sentence(waitText())); return; }
+ if (busy) { wait(); return; }
if (active().length >= MAX) { notify(sentence(fullText())); return; }
if (!menu.hidden && opener === add) close(); else open(add, addMenu()); };
picker.onchange = () => addFiles(Array.from(picker.files));