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.
Diagnostic report button and a GitHub submission card (0.3.4) (#89)
Bowen Xuefb85ad6c021d
diff --git a/.github/ISSUE_TEMPLATE/report.yml b/.github/ISSUE_TEMPLATE/report.ymlnew file mode 100644index 0000000..6aa232d--- /dev/null+++ b/.github/ISSUE_TEMPLATE/report.yml@@ -0,0 +1,42 @@+name: Diagnostic report / 诊断报告+description: Submit a diagnostic report for hardware-specific optimization / 提交诊断报告,针对您的硬件配置进行专门优化+title: "[Report] "+labels: ["report"]+body:+ - type: markdown+ attributes:+ value: |+ Thank you for submitting a diagnostic report. We'll use it to optimize FreeVideo specifically for your hardware configuration, and it helps other users too. The report contains hardware details, generation settings and timings only, with no prompts, reference images or videos.++ 感谢您提交诊断报告。我们会据此针对您的硬件配置进行专门优化,也能帮助其他用户。报告仅包含硬件信息、生成参数和耗时,不含提示词、参考图或视频。+ - type: textarea+ id: report+ attributes:+ label: Diagnostic report / 诊断报告+ description: Please drag video.debug.json here. In FreeVideo, select Diagnostic report under a finished video. / 请将 video.debug.json 拖到这里(在 FreeVideo 视频下方点击「诊断报告」即可获得)。+ placeholder: Drop video.debug.json here / 将 video.debug.json 拖到这里+ validations:+ required: true+ - type: input+ id: version+ attributes:+ label: FreeVideo version / FreeVideo 版本+ - type: input+ id: hardware+ attributes:+ label: Graphics card and memory / 显卡和内存+ placeholder: RTX 4060 Ti 16 GB · 32 GB RAM · Windows+ - type: input+ id: request+ attributes:+ label: Video size and length / 视频尺寸和时长+ placeholder: 1344×768 · 10 s+ - type: input+ id: timing+ attributes:+ label: Time taken / 用时+ - type: textarea+ id: notes+ attributes:+ label: Anything else? (optional) / 其他补充(选填)+ description: For example, too slow, ran out of memory, or the video looked wrong. / 例如速度太慢、显存不足或画面异常。diff --git a/freevideo_engine/release_notes.json b/freevideo_engine/release_notes.jsonindex 5f885be..abb2544 100644--- a/freevideo_engine/release_notes.json+++ b/freevideo_engine/release_notes.json@@ -1,18 +1,18 @@{"schema": 1,- "product_version": "0.3.3",+ "product_version": "0.3.4","en": {- "summary": "Runs the int8 model on 6 GB graphics cards and imports the int8 offline packs.",+ "summary": "Diagnostic report saves the diagnostic report in one click. If you submit it on GitHub, we'll optimize FreeVideo specifically for your setup.","changes": [- "Graphics cards with 6 GB of memory, such as a laptop RTX 3060, can now generate with the int8 model instead of being refused, and 8 to 12 GB cards can make longer videos. These runs use a low-memory mode, which is slower, and FreeVideo says so while generating. When a request still does not fit, the message names sizes and lengths that fit now.",- "The launcher imports the new int8 offline packs: video model, text encoder, video & audio decoder, and sampling caches."+ "Diagnostic report saves the redacted diagnostic report in one click. If you submit it on GitHub, we'll optimize FreeVideo specifically for your setup, and it helps other users too. The report has hardware details, settings and timings only, with no prompts, reference images or videos.",+ "After a video finishes, a card under the buttons invites you to submit the report. Once closed, it does not come back, and it never covers the video."]},"zh": {- "summary": "6 GB 显存的显卡可以用 int8 模型生成,并支持导入 int8 离线包。",+ "summary": "新增「诊断报告」按钮,一键保存诊断报告;欢迎在 GitHub 提交,我们会针对您的硬件配置进行专门优化。","changes": [- "6 GB 显存的显卡(例如笔记本 RTX 3060)现在可以用 int8 模型生成,不再被拒绝;8 到 12 GB 的显卡也能生成更长的视频。这时会改用省显存方式,速度会慢一些,生成时会提示。如果仍然放不下,提示里会给出这台电脑现在能生成的尺寸和时长。",- "启动器支持导入新的 int8 离线包:视频模型、文本编码器、视频与音频解码器、采样缓存。"+ "新增「诊断报告」按钮,一键保存脱敏的诊断报告。欢迎在 GitHub 提交,我们会针对您的硬件配置进行专门优化,也能帮助其他用户。报告仅包含硬件信息、生成参数和耗时,不含提示词、参考图或视频。",+ "视频生成完成后,按钮下方会显示提交诊断报告的提示;关闭后不再出现,也不会遮挡视频。"]}}diff --git a/web/generation_progress.js b/web/generation_progress.jsindex 37dd3c7..881bf8a 100644--- a/web/generation_progress.js+++ b/web/generation_progress.js@@ -1,4 +1,5 @@// One whole-video estimate shared by Studio and node view; real stage counters remain separate.+import { saveReport } from './report_issue.js';const css = document.createElement('link');css.rel = 'stylesheet'; css.href = new URL('./generation_progress.css', import.meta.url).href;document.head.append(css);@@ -134,18 +135,16 @@ export function createGenerationProgress(t, now = () => Date.now(), {compact = f// only a new request clears it.return reportId;}- // Download the redacted diagnostic export; throws when it is unavailable.- async function downloadReport() {+ // The redacted diagnostic export; throws when it is unavailable.+ async function fetchReport() {const id = reportId;if (!id) throw new Error('Report unavailable');const path = `/freevideo/report/${id}`;const response = await (api ? api.fetchApi(path) : fetch(path));if (!response.ok) throw new Error('Report unavailable');- const blob = await response.blob(), url = URL.createObjectURL(blob);- const link = document.createElement('a'); link.href = url; link.download = 'video.debug.json';- document.body.append(link); link.click(); link.remove();- setTimeout(() => URL.revokeObjectURL(url), 1000);+ return response.blob();}+ async function downloadReport() { saveReport(await fetchReport()); }report.onclick = async () => {if (!reportId || report.disabled) return;const id = reportId;@@ -382,6 +381,6 @@ export function createGenerationProgress(t, now = () => Date.now(), {compact = fif (timer !== null) clearInterval(timer); timer = null; state = {}; overall = {}; shownFraction = null;stopCount(); countShown = null;}- return {element, report, updateReport, downloadReport, hasReport: () => reportId !== null, update, hide, dispose: hide,+ return {element, report, updateReport, fetchReport, downloadReport, hasReport: () => reportId !== null, update, hide, dispose: hide,noticeCount: () => trims.size};}diff --git a/web/report_issue.js b/web/report_issue.jsnew file mode 100644index 0000000..04c27ee--- /dev/null+++ b/web/report_issue.js@@ -0,0 +1,172 @@+// Send the redacted diagnostic report as a GitHub issue: the report menu's+// entry, and a tip above that menu after a finished video, shown until the+// user closes it once.+const ISSUE_FORM = 'https://github.com/FlashML-org/FreeVideo/issues/new';+const TIP_KEY = 'freevideo.report-tip';+const REPORT_FILE = 'video.debug.json';++const gb = bytes => Number.isFinite(bytes) && bytes > 0 ? Math.round(bytes / 2 ** 30) : null;++// The issue form, prefilled from the redacted report. The report carries no+// prompt, reference or video, so neither does the address.+export function reportIssueURL(report, productVersion = null) {+ const analysis = report?.analysis || {};+ const hardware = analysis.hardware || {};+ const geometry = analysis.geometry || {};+ const gpu = String(hardware.gpu_name || '').replace(/^NVIDIA\s+(GeForce\s+)?/i, '').trim();+ // Cards are sold in whole gigabytes; installed RAM shows a little under+ // its size, so it keeps a decimal rather than rounding down a size.+ const vram = gb(hardware.vram_total);+ const ram = Number.isFinite(hardware.ram_total) && hardware.ram_total > 0+ ? (hardware.ram_total / 2 ** 30).toFixed(1).replace(/\.0$/, '') : null;+ const card = gpu ? gpu + (vram ? ` ${vram} GB` : '') : '';+ const seconds = geometry.frames && geometry.fps ? Math.round(geometry.frames / geometry.fps * 10) / 10 : null;+ const video = [geometry.width && geometry.height ? `${geometry.width}×${geometry.height}` : '',+ seconds ? `${seconds} s` : ''].filter(Boolean).join(' · ');+ const total = report?.summary?.request_seconds;+ const fields = {+ template: 'report.yml',+ title: ['[Report]', [card, video].filter(Boolean).join(' · ')].join(' ').trim(),+ version: [productVersion ? `v${productVersion}` : '', analysis.version ? `(${analysis.version})` : ''].filter(Boolean).join(' '),+ hardware: [card, ram ? `${ram} GB RAM` : '', hardware.system || ''].filter(Boolean).join(' · '),+ request: video,+ timing: Number.isFinite(total) && total > 0 ? `${Math.round(total)} s` : '',+ };+ const params = new URLSearchParams();+ for (const [key, value] of Object.entries(fields)) if (value) params.set(key, value);+ return `${ISSUE_FORM}?${params}`;+}++export function saveReport(blob) {+ const url = URL.createObjectURL(blob);+ const link = document.createElement('a'); link.href = url; link.download = REPORT_FILE;+ document.body.append(link); link.click(); link.remove();+ setTimeout(() => URL.revokeObjectURL(url), 1000);+}++// Open the prefilled form, saving the report first unless the user just+// downloaded it; GitHub cannot take a file from a link, so the user drags the+// saved file in. Resolves to the form's address.+export async function reportIssue(fetchReport, productVersion = null, {save = true, open = url => window.open(url, '_blank', 'noopener')} = {}) {+ const blob = await fetchReport();+ if (save) saveReport(blob);+ let report = null;+ try { report = JSON.parse(await blob.text()); } catch { /* The form still opens, without prefilled fields. */ }+ const address = reportIssueURL(report, productVersion);+ open(address);+ return address;+}++export function reportTipClosed() {+ try { return localStorage.getItem(TIP_KEY) === '1'; } catch { return false; }+}++function closeForGood() {+ try { localStorage.setItem(TIP_KEY, '1'); } catch { /* Shown again after the next video. */ }+}++const el = (tag, cls, text) => {+ const e = document.createElement(tag); if (cls) e.className = cls; if (text) e.textContent = text;+ return e;+};++const ICON = {+ report: '<path d="M9.5 2H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.5L9.5 2Z"/><path d="M9.5 2v2.5H12M6.5 8h3M6.5 10.5h3"/>',+ done: '<path d="m3.8 8.4 2.7 2.7 5.7-6"/>',+ close: '<path d="m4.5 4.5 7 7m0-7-7 7"/>',+ external: '<path d="M6.5 3.5h-3v9h9v-3M9 2.5h4.5V7M13.5 2.5 7.5 8.5"/>',+ lock: '<rect x="3.5" y="7" width="9" height="6.5" rx="1.5"/><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"/>',+};+const glyph = (name, cls = 'fv-report-tip-glyph') => {+ const span = el('span', cls); span.setAttribute('aria-hidden', 'true');+ span.innerHTML = `<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">${ICON[name]}</svg>`;+ return span;+};++const reducedMotion = () => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;++// A card on its own row under the result's action bar, so it never covers the+// video, with a notch under the Report button. It opens and closes by height,+// so the picture above eases instead of jumping. `mode` is 'invite' (after a+// finished video: Submit saves the report too) or 'downloaded' (the user just+// saved it: Submit only opens the form). `submit` resolves to the form's+// address; `onHide` runs when the user closes the card, not on a redraw;+// `animate: false` redraws a card that was already showing.+export function showReportTip(bar, anchor, t, {mode = 'invite', submit, onHide = null, animate = true} = {}) {+ bar.parentElement.querySelector(':scope > .fv-report-tip:not(.fv-report-tip-leaving)')?.remove();+ const tip = el('div', 'fv-report-tip'); tip.setAttribute('role', 'region');+ tip.setAttribute('aria-label', t('Send the diagnostic report', '提交诊断报告'));+ const card = el('div', 'fv-report-tip-card');+ const mark = el('span', 'fv-report-tip-mark'); mark.setAttribute('aria-hidden', 'true');+ const text = el('div', 'fv-report-tip-text');+ const title = el('strong', 'fv-report-tip-title');+ const lead = el('p', 'fv-report-tip-lead');+ const note = el('small', 'fv-report-tip-note');+ // `fv-actions` lends the row the result bar's button styles.+ const row = el('div', 'fv-report-tip-actions fv-actions');+ const close = el('button', 'fv-report-tip-close'); close.type = 'button'; close.setAttribute('aria-label', t('Close', '关闭'));+ close.append(glyph('close'));+ const hide = () => {+ anchor.classList.remove('fv-report-attention'); onHide?.();+ if (reducedMotion() || typeof tip.animate !== 'function' || !tip.isConnected) { tip.remove(); return; }+ tip.classList.add('fv-report-tip-leaving');+ tip.animate([{maxHeight: `${tip.offsetHeight}px`, paddingTop: '6px', opacity: 1}, {maxHeight: '0px', paddingTop: '0px', opacity: 0}],+ {duration: 240, easing: 'cubic-bezier(.4,0,.2,1)', fill: 'forwards'}).finished.then(() => tip.remove(), () => tip.remove());+ };+ const dismiss = () => { closeForGood(); hide(); };+ close.onclick = dismiss;+ function sent(address) {+ tip.classList.add('fv-report-tip-sent'); anchor.classList.remove('fv-report-attention');+ mark.replaceChildren(glyph('done'));+ title.textContent = t('Last step', '最后一步');+ lead.textContent = t(`Please drag ${REPORT_FILE} into "Diagnostic report", then select Submit new issue.`,+ `请将 ${REPORT_FILE} 拖入「诊断报告」,再点击 Submit new issue 即可。`);+ const link = el('a', null, t("Page didn't open? Go to GitHub", '页面没有打开?点此前往 GitHub'));+ link.href = address; link.target = '_blank'; link.rel = 'noopener';+ note.replaceChildren(link);+ const done = el('button', 'fv-action fv-action-secondary', t('Done', '完成')); done.type = 'button';+ done.onclick = dismiss;+ row.replaceChildren(done);+ close.remove();+ done.focus({preventScroll: true});+ }+ mark.append(glyph('report'));+ if (mode === 'downloaded') {+ title.textContent = t('Diagnostic report downloaded', '诊断报告已下载');+ } else {+ title.textContent = t('Share a diagnostic report?', '欢迎提交诊断报告');+ }+ lead.textContent = t("We'll optimize specifically for your setup, and it helps other users too.",+ '我们会针对您的硬件配置进行专门优化,也能帮助其他用户。');+ note.append(glyph('lock', 'fv-report-tip-lock'), t('Hardware, settings and timings only. No prompts, images or videos.',+ '仅包含硬件信息、生成参数和耗时,不含提示词、参考图或视频。'));+ const send = el('button', 'fv-action fv-action-primary'); send.type = 'button';+ const sendText = el('span', null, t('Submit on GitHub', '前往 GitHub 提交'));+ send.append(sendText, glyph('external'));+ send.title = t('Opens the GitHub issue form', '打开 GitHub 上的 issue 页面');+ send.onclick = async () => {+ if (send.disabled) return;+ send.disabled = true; sendText.textContent = t('Preparing…', '正在整理…');+ try { const address = await submit(); closeForGood(); sent(address); }+ catch { send.disabled = false; sendText.textContent = t('Report unavailable · retry', '报告暂不可用 · 重试'); }+ };+ row.append(send);+ text.append(title, lead, note);+ card.append(mark, text, row, close);+ tip.append(card);+ tip.addEventListener('keydown', event => {+ if (event.key !== 'Escape') return;+ event.preventDefault(); event.stopPropagation(); dismiss(); anchor.focus();+ });+ if (mode === 'invite') anchor.classList.add('fv-report-attention');+ bar.after(tip);+ // The notch sits under the Report button's centre.+ const notch = anchor.getBoundingClientRect(), box = card.getBoundingClientRect();+ tip.style.setProperty('--fv-tip-notch', `${Math.max(18, Math.min(box.width - 18, notch.left + notch.width / 2 - box.left))}px`);+ // Open from nothing to the card's own height, so the picture eases up.+ if (animate && !reducedMotion() && typeof tip.animate === 'function') {+ tip.animate([{maxHeight: '0px', paddingTop: '0px', opacity: 0}, {maxHeight: `${tip.offsetHeight}px`, paddingTop: '6px', opacity: 1}],+ {duration: 340, easing: 'cubic-bezier(.22,1,.36,1)'});+ }+ return tip;+}diff --git a/web/result_actions.css b/web/result_actions.cssindex 05fda82..ac5e3f0 100644--- a/web/result_actions.css+++ b/web/result_actions.css@@ -29,5 +29,37 @@.fv-actions .fv-confirm-actions .fv-action{height:34px;min-height:34px;padding:0 14px}.fv-actions .fv-action-danger{border-color:transparent;background:var(--fv-danger-subtle,#30212a);color:var(--fv-danger,#f09aa2)}.fv-actions .fv-action-danger:hover{border-color:color-mix(in srgb,var(--fv-danger,#f09aa2) 45%,transparent);background:var(--fv-danger-subtle,#30212a);color:var(--fv-danger,#f09aa2)}+/* The report card: its own row under the action bar, never over the video. Script+ opens and closes the row by height, so the picture above eases instead of jumping. */+.fv-result-links>.fv-report-tip{flex:1 0 100%;box-sizing:border-box;padding-top:6px;overflow:hidden;container-type:inline-size}+.fv-result-links>.fv-report-tip .fv-report-tip-card{position:relative;display:flex;align-items:center;gap:14px;box-sizing:border-box;padding:12px 12px 12px 14px;border:1px solid color-mix(in srgb,var(--fv-accent,#6db8fa) 28%,var(--fv-border,#2a3443));border-radius:14px;background:color-mix(in srgb,var(--fv-accent,#6db8fa) 8%,var(--fv-card,#1a222e));box-shadow:inset 0 1px 0 #ffffff0a;color:var(--fv-ink,#eee);font:13px/1.55 var(--fv-font,system-ui);text-align:left}+.fv-result-links>.fv-report-tip .fv-report-tip-card::before{content:'';position:absolute;top:-6px;left:calc(var(--fv-tip-notch,50%) - 5px);width:10px;height:10px;box-sizing:border-box;border:solid color-mix(in srgb,var(--fv-accent,#6db8fa) 28%,var(--fv-border,#2a3443));border-width:1px 0 0 1px;border-radius:2px 0 0 0;background:color-mix(in srgb,var(--fv-accent,#6db8fa) 8%,var(--fv-card,#1a222e));transform:rotate(45deg)}+.fv-result-links>.fv-report-tip .fv-report-tip-glyph,.fv-result-links>.fv-report-tip .fv-report-tip-lock{display:inline-flex;flex:none}+.fv-result-links>.fv-report-tip .fv-report-tip-glyph svg,.fv-result-links>.fv-report-tip .fv-report-tip-lock svg{width:100%;height:100%}+.fv-result-links>.fv-report-tip .fv-report-tip-mark{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:11px;background:linear-gradient(150deg,color-mix(in srgb,var(--fv-accent,#6db8fa) 30%,transparent),color-mix(in srgb,var(--fv-accent,#6db8fa) 10%,transparent));color:var(--fv-accent,#6db8fa);transition:background .2s,color .2s}+.fv-result-links>.fv-report-tip .fv-report-tip-mark .fv-report-tip-glyph{width:18px;height:18px}+.fv-result-links>.fv-report-tip.fv-report-tip-sent .fv-report-tip-mark{background:linear-gradient(150deg,color-mix(in srgb,var(--fv-success,#76d9b3) 30%,transparent),color-mix(in srgb,var(--fv-success,#76d9b3) 10%,transparent));color:var(--fv-success,#76d9b3)}+.fv-result-links>.fv-report-tip .fv-report-tip-text{flex:1;min-width:0;display:grid;gap:2px}+/* Chinese breaks at its punctuation when it can; two lines come out even. */+.fv-result-links>.fv-report-tip .fv-report-tip-title,.fv-result-links>.fv-report-tip .fv-report-tip-lead,.fv-result-links>.fv-report-tip .fv-report-tip-note{text-wrap:balance;word-break:keep-all;overflow-wrap:anywhere}+.fv-result-links>.fv-report-tip .fv-report-tip-title{font-size:13.5px;font-weight:600;line-height:1.45;color:var(--fv-ink,#eee)}+.fv-result-links>.fv-report-tip .fv-report-tip-lead{margin:0;font-size:13px;line-height:1.55;color:color-mix(in srgb,var(--fv-ink,#eee) 86%,var(--fv-muted,#a5b3c6))}+.fv-result-links>.fv-report-tip .fv-report-tip-note{display:flex;align-items:flex-start;gap:5px;margin-top:2px;font-size:12px;line-height:1.45;color:var(--fv-muted,#a5b3c6)}+.fv-result-links>.fv-report-tip .fv-report-tip-lock{width:12px;height:12px;margin-top:2.5px;opacity:.85}+.fv-result-links>.fv-report-tip .fv-report-tip-note a{display:inline;height:auto;min-height:0;margin:0;padding:0;border:0;background:none;box-shadow:none;color:var(--fv-accent,#6db8fa);font:inherit;text-decoration:none}+.fv-result-links>.fv-report-tip .fv-report-tip-note a:hover{text-decoration:underline}+.fv-result-links>.fv-report-tip .fv-report-tip-actions{flex:none;gap:6px}+.fv-result-links>.fv-report-tip .fv-report-tip-actions .fv-action{height:34px;min-height:34px;padding:0 14px;gap:6px}+.fv-result-links>.fv-report-tip .fv-report-tip-actions .fv-action .fv-report-tip-glyph{width:13px;height:13px;opacity:.85}+.fv-result-links>.fv-report-tip .fv-report-tip-close{flex:none;display:grid;place-items:center;width:30px;height:30px;margin:0;padding:0;border:0;border-radius:9px;background:none;color:var(--fv-muted,#a5b3c6);cursor:pointer;box-shadow:none}+.fv-result-links>.fv-report-tip .fv-report-tip-close:hover{background:color-mix(in srgb,var(--fv-ink,#eee) 8%,transparent);color:var(--fv-ink,#eee)}+.fv-result-links>.fv-report-tip .fv-report-tip-close:focus-visible{outline:2px solid color-mix(in srgb,var(--fv-accent,#6db8fa) 70%,transparent);outline-offset:1px}+.fv-result-links>.fv-report-tip .fv-report-tip-close .fv-report-tip-glyph{width:14px;height:14px}+/* While the invitation shows, a dot on the Diagnostic report button ties the two together. */+.fv-actions .fv-action-report{position:relative}+.fv-actions .fv-action-report.fv-report-attention::after{content:'';position:absolute;top:-3px;right:-3px;width:9px;height:9px;border-radius:50%;background:var(--fv-accent,#6db8fa);box-shadow:0 0 0 2px var(--fv-bg,#111720)}+/* A narrow card keeps the text on full-width lines and moves the button below it. */+@container (max-width:640px){.fv-result-links>.fv-report-tip .fv-report-tip-card{flex-wrap:wrap;align-items:flex-start;padding-right:40px}.fv-result-links>.fv-report-tip .fv-report-tip-text{flex:1 1 calc(100% - 50px)}.fv-result-links>.fv-report-tip .fv-report-tip-actions{margin-left:50px}.fv-result-links>.fv-report-tip .fv-report-tip-close{position:absolute;top:8px;right:8px}}+@media(prefers-reduced-motion:reduce){.fv-result-links>.fv-report-tip .fv-report-tip-mark{transition:none}}@keyframes fv-menu-enter{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.fv-actions *{transition:none!important;animation:none!important}}diff --git a/web/result_actions.js b/web/result_actions.jsindex ca9cb68..dc1b835 100644--- a/web/result_actions.js+++ b/web/result_actions.js@@ -97,13 +97,13 @@ function deleteAction(t, remove) {return menu;}-// Download the video first; share and the reports follow, one entry each.-// A first-pass preview leads with `secondPass` instead, and saved creations end-// with `remove`. `diagnostic` is an async callback for the redacted support-// report, when one exists.+// Download the video first; share and the report follow. A first-pass preview+// leads with `secondPass` instead, and saved creations end with `remove`.+// `diagnostic` downloads the redacted report (and may offer to send it); a+// result without one shows no report entry, because the full generation+// record keeps local paths and is not meant to be shared.export function resultActions(record, t, {diagnostic = null, secondPass = null, remove = null} = {}) {const bar = document.createElement('div'); bar.className = 'fv-actions';- const finish = () => { if (remove) bar.append(deleteAction(t, remove)); return bar; };if (secondPass) bar.append(secondPassAction(t, secondPass));if (record.video) {const download = action('a', t('Download video', '下载视频'), 'download', secondPass ? 'fv-action-secondary' : 'fv-action-primary');@@ -115,46 +115,20 @@ export function resultActions(record, t, {diagnostic = null, secondPass = null,const label = document.createElement('span'); label.textContent = share.textContent;share.replaceChildren(icon('share'), label);bar.append(share);- const recordLink = record.report ? outputDownloadURL(api, record.report) : null;- if (!diagnostic) {- if (recordLink) {- const report = action('a', t('Report', '报告'), 'report', 'fv-action-secondary');- report.href = recordLink; report.download = record.report.split('/').pop(); report.title = t('Generation record (JSON)', '生成记录(JSON)');- bar.append(report);- }- return finish();+ if (diagnostic) {+ const reportLabel = t('Diagnostic report', '诊断报告');+ const report = action('button', reportLabel, 'report', 'fv-action-secondary fv-action-report');+ report.title = t('Redacted diagnostic report: hardware, settings and timings', '已脱敏的诊断报告:硬件、设置和耗时');+ const text = report.lastElementChild;+ report.onclick = async () => {+ if (report.disabled) return;+ report.disabled = true; text.textContent = t('Preparing…', '正在整理…');+ try { await diagnostic(); text.textContent = reportLabel; }+ catch { text.textContent = t('Report unavailable · retry', '报告暂不可用 · 重试'); }+ finally { report.disabled = false; }+ };+ bar.append(report);}- const menu = document.createElement('details'); menu.className = 'fv-action-menu';- const summary = document.createElement('summary'); summary.className = 'fv-action fv-action-secondary';- const text = document.createElement('span'); text.textContent = t('Report', '报告');- summary.append(icon('report'), text, icon('chevron'));- const list = document.createElement('div'); list.className = 'fv-menu';- const item = (tag, title, hint) => {- const e = document.createElement(tag); e.className = 'fv-menu-item';- const strong = document.createElement('strong'); strong.textContent = title;- const small = document.createElement('small'); small.textContent = hint;- e.append(strong, small);- return e;- };- const supportLabel = t('Diagnostic report', '诊断报告');- const support = item('button', supportLabel, t('Redacted, for problem reports', '已脱敏,可用于反馈问题')); support.type = 'button';- const supportTitle = support.querySelector('strong');- support.onclick = async () => {- if (support.disabled) return;- support.disabled = true; supportTitle.textContent = t('Preparing…', '正在整理…');- try { await diagnostic(); supportTitle.textContent = supportLabel; menu.open = false; }- catch { supportTitle.textContent = t('Report unavailable · retry', '报告暂不可用 · 重试'); }- finally { support.disabled = false; }- };- list.append(support);- if (recordLink) {- const full = item('a', t('Generation record', '生成记录'), t('Every setting of this run (JSON)', '本次生成的完整参数(JSON)'));- full.href = recordLink; full.download = record.report.split('/').pop();- full.onclick = () => { menu.open = false; };- list.append(full);- }- menu.append(summary, list);- popover(menu, summary, () => { if (!support.disabled) supportTitle.textContent = supportLabel; });- bar.append(menu);- return finish();+ if (remove) bar.append(deleteAction(t, remove));+ return bar;}diff --git a/web/studio.js b/web/studio.jsindex 1b9e103..06d5cb8 100644--- a/web/studio.js+++ b/web/studio.js@@ -5,7 +5,8 @@ import { openSetup } from './setup.js';import { wordmark } from './branding.js';import { createGenerationProgress, referenceTrimText } from './generation_progress.js';import { viewSwitch, viewChanged } from './view_navigation.js';-import { createUpdateNotice, createVersionInfo } from './updates.js';+import { createUpdateNotice, createVersionInfo, productVersion } from './updates.js';+import { reportIssue, reportTipClosed, showReportTip } from './report_issue.js';import { createPreviewScene } from './preview_scene.js?v=20260929-swell';import { animateDetails, closeDialog } from './motion.js';import { openLibrary, latestVideo } from './library.js';@@ -420,6 +421,22 @@ export function openStudio(node) {progress.updateReport({report_id: node.freevideoReportId});cleanup.push(() => progress.dispose());cleanup.push(createPreviewScene(stage, progress.element, stageMedia));+ // The report card under the result: 'invite' after a watched video,+ // 'downloaded' once the user saved the report themselves.+ function reportCard(mode, animate = true) {+ const bar = links.querySelector('.fv-actions'), anchor = bar?.querySelector('.fv-action-report');+ if (disposed || !anchor) return;+ showReportTip(bar, anchor, t, {mode, animate, onHide: () => { reportTipFor = null; },+ submit: () => reportIssue(progress.fetchReport, productVersion(), {save: mode === 'invite'})});+ }+ async function downloadReport() { await progress.downloadReport(); reportCard('downloaded'); }+ function placeReportTip(delay) {+ clearTimeout(reportTipTimer);+ reportTipTimer = setTimeout(() => {+ // A card already on screen is redrawn in place, without opening again.+ if (!reportTipClosed() && result?.video === reportTipFor) reportCard('invite', delay > 0);+ }, delay);+ }let revealTimer = null;function hideProgress() {clearTimeout(revealTimer); revealTimer = null;@@ -456,6 +473,7 @@ export function openStudio(node) {const previewObserver = new ResizeObserver(fitPreview);previewObserver.observe(previewSpace); cleanup.push(() => previewObserver.disconnect());function showProgress(message) {+ watchedRun = true; reportTipFor = null; clearTimeout(reportTipTimer);reuseRow.hidden = true;stats.hidden = true;budget.textContent = '';@@ -494,6 +512,9 @@ export function openStudio(node) {output.append(el('div', null, 'fv-preview-end'));if (node.freevideoFailure) failure.show(node.freevideoFailureReport || node.freevideoFailure, false);let result = node.freevideoLastResult || app.nodeOutputs?.[node.id]?.freevideo_summary?.[0];+ // A run this window watched. Its result can arrive before or after the+ // final progress message, and more than once; the tip stays with that video.+ let reportTipTimer = null, watchedRun = false, reportTipFor = null;function showResult(r) {if (!r?.video || disposed) return; result = r;refreshEffortEstimate(true);@@ -518,8 +539,15 @@ export function openStudio(node) {: (Number.isFinite(r.gpu_budget_bytes) ? `${t('VRAM budget', '可用显存预算')} ${number(r.gpu_budget_bytes, 2 ** 30, 'GiB')} · ${t('Device', '显卡总量')} ${number(r.gpu_total_bytes, 2 ** 30, 'GiB')}` : '');// One report entry: the diagnostic export joins the report menu once a result exists.progress.report.dataset.covered = 'true';- links.replaceChildren(resultActions(r, t, {diagnostic: progress.hasReport() ? progress.downloadReport : null,+ const reported = progress.hasReport();+ const tipShowing = !!links.querySelector('.fv-report-tip:not(.fv-report-tip-leaving)');+ links.replaceChildren(resultActions(r, t, {diagnostic: reported ? downloadReport : null,secondPass: r.preview ? secondPass(r) : null}));+ // After a video finished just now, point at the report menu until the+ // user closes the tip once, whichever version they first saw it in.+ if (watchedRun && reported && !r.preview && !r.result_cache_hit && !reportTipClosed()) reportTipFor = r.video;+ watchedRun = false;+ if (reportTipFor && reportTipFor === r.video) placeReportTip(tipShowing ? 0 : 650);const g = r.geometry; if (g?.width && g?.height) previewSize(g.width, g.height);if (!progress.element.hidden) {progress.update({phase: 'complete', overall: {status: 'complete', fraction: 1, remaining_seconds: 0}});diff --git a/web/updates.js b/web/updates.jsindex 5eb6306..85e9aed 100644--- a/web/updates.js+++ b/web/updates.js@@ -15,6 +15,8 @@ try { dismissed = sessionStorage.getItem(storageKey); } catch { /* Session memorconst languageHint = (() => { try { return new URLSearchParams(location.search).get('freevideo_lang'); } catch { return null; } })();const identity = candidate => candidate ? [candidate.version, candidate.revision, candidate.built_at].join(':') : '';const displayVersion = release => release?.product_version ? 'v' + release.product_version : release?.version || '—';+// The running release's product version ("0.3.4"), once the first check has answered.+export const productVersion = () => value?.current_release?.product_version || null;const localizedNotes = (release, cn) => release?.release_notes?.[cn ? 'zh' : 'en'];const publish = () => { for (const render of listeners) render(); };const later = ms => { clearTimeout(timer); timer = setTimeout(checkUpdates, ms); };