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.

Past chats show a small cover from their first finished video

Bowen Xueaab8820f390c
diff --git a/freevideo_engine/agent/routes.py b/freevideo_engine/agent/routes.py
index 26a3577..e47d59b 100644
--- a/freevideo_engine/agent/routes.py
+++ b/freevideo_engine/agent/routes.py
@@ -956,12 +956,32 @@ def register():
@guarded
async def chat_list(request):
def read():
+ from urllib.parse import quote
store = work_sessions()
here = chat_session(store)
rows = store.history(chat['client']) if here else []
- active = [r.get('session') for r in jobs.rows() if r['status'] in ACTIVE]
+ listed = {row['id'] for row in rows}
+ running, covers = {}, {}
+ # One job snapshot supplies both counts and the first completed video, without reading session logs or files.
+ for job in jobs.rows():
+ sid = job.get('session')
+ if sid not in listed:
+ continue
+ if job['status'] in ACTIVE:
+ running[sid] = running.get(sid, 0) + 1
+ if job['status'] != 'succeeded' or job['kind'] == 'image':
+ continue
+ work = (job.get('result') or {}).get('library_id')
+ if not isinstance(work, str) or not work:
+ continue
+ finished = job.get('finished_at')
+ order = (finished if finished is not None else job['created_at'], job['created_at'], job['id'])
+ if sid not in covers or order < covers[sid][0]:
+ covers[sid] = (order, work)
return dict(agent=agent_state(), here=here,
- conversations=[dict(row, running=active.count(row['id'])) for row in rows])
+ conversations=[dict(row, running=running.get(row['id'], 0),
+ cover='/freevideo/library/thumbnail?id=' + quote(covers[row['id']][1], safe='')
+ if row['id'] in covers else None) for row in rows])
return reply(await asyncio.to_thread(read))
@routes.post('/freevideo/agent/chat/new')
diff --git a/web/autopilot_chat.css b/web/autopilot_chat.css
index 5d49dff..41d8974 100644
--- a/web/autopilot_chat.css
+++ b/web/autopilot_chat.css
@@ -12,6 +12,9 @@
.fv-studio .fv-chat-conversations button:focus-visible{outline-offset:-2px}
.fv-studio .fv-chat-conversation[aria-current]{background:var(--fv-raised);border-color:var(--fv-accent-dim)}
.fv-chat-conversation span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
+/* Fit the cover inside the existing row padding without changing the title's line height. */
+.fv-chat-cover{flex:none;width:48px;height:27px;margin-block:-4px;overflow:hidden;border-radius:var(--fv-chats-radius);background:color-mix(in srgb,var(--fv-ink) 7%,transparent)}
+.fv-chat-cover img{display:block;width:100%;height:100%;object-fit:cover}
/* The row button keeps its full frame; the inset action only takes space from the title. */
.fv-chat-conversation-row{position:relative;min-width:0;display:flex;align-items:center;border-radius:var(--fv-chats-radius)}
.fv-chat-conversation-row:is(:hover,:focus-within,[data-menu-open=true]){background:var(--fv-raised)}
diff --git a/web/autopilot_chat.js b/web/autopilot_chat.js
index afe125b..6ad7751 100644
--- a/web/autopilot_chat.js
+++ b/web/autopilot_chat.js
@@ -284,12 +284,29 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
if (!node) {
const container = el('div', 'fv-chat-conversation-row');
const button = press('fv-chat-conversation', null, () => chooseChat(row.id)), dot = el('i', 'fv-chat-running'), title = el('span');
- button.dataset.session = row.id; dot.setAttribute('aria-hidden', 'true'); button.append(dot, title);
+ // Every row keeps the cover frame so titles line up whether or not a picture loads.
+ const frame = el('i', 'fv-chat-cover');
+ button.dataset.session = row.id; dot.setAttribute('aria-hidden', 'true'); frame.setAttribute('aria-hidden', 'true');
+ button.append(dot, frame, title);
const more = press('fv-chat-more', null, () => openMenu(row.id));
more.title = t('More', '更多'); more.setAttribute('aria-haspopup', 'menu'); more.setAttribute('aria-controls', menu.id);
more.append(glyph('M5 12h.01M12 12h.01M19 12h.01', 3.5));
more.addEventListener('focusout', leaveMenu); container.append(button, more);
- listNodes.set(row.id, node = {row: container, button, dot, title, more});
+ listNodes.set(row.id, node = {row: container, button, dot, frame, title, more, cover: null, image: null});
+ }
+ if (node.cover !== row.cover) {
+ node.image?.remove(); node.image = null; node.cover = row.cover;
+ delete node.row.dataset.coverError;
+ if (row.cover) {
+ const image = el('img');
+ image.alt = ''; image.setAttribute('aria-hidden', 'true'); image.loading = 'lazy'; image.decoding = 'async';
+ image.width = 48; image.height = 27;
+ image.onerror = () => {
+ if (node.image !== image) return;
+ image.hidden = true; node.row.dataset.coverError = 'true';
+ };
+ node.image = image; image.src = row.cover; node.frame.append(image);
+ }
}
node.row.dataset.temporary = String(!!row.temporary);
node.title.textContent = row.title; node.button.title = row.title; node.dot.hidden = row.running <= 0;
diff --git a/web/autopilot_conversations.js b/web/autopilot_conversations.js
index 9974dd1..0b63efd 100644
--- a/web/autopilot_conversations.js
+++ b/web/autopilot_conversations.js
@@ -27,7 +27,10 @@ export function mergeConversations(state, data, status = 200) {
for (const row of data.conversations) {
if (typeof row?.id !== 'string' || !row.id || typeof row.title !== 'string' || !row.title.trim() || seen.has(row.id)) continue;
seen.add(row.id);
+ const cover = typeof row.cover === 'string' && row.cover.startsWith('/') && !row.cover.startsWith('//')
+ && !/[\\\s\u0000-\u001f\u007f]/.test(row.cover) ? row.cover : null;
conversations.push({id: row.id, title: row.title, updated_at: row.updated_at,
+ cover,
running: Math.max(0, Math.floor(Number(row.running) || 0))});
if (conversations.length === 50) break;
}