fix: Scene VLM 始终显示,无 scenes 时显示 '—'

问题:
- Scene VLM 只在有 CUT 的文件上运行
- 没有 CUT 的文件不会生成 scenes.json
- 前端检测到 total_scenes === 0 时,不显示 Scene VLM 行
- 用户看不到完整的处理流程

修复:
- 移除 v-if 条件,始终显示 Scene VLM 行
- 修改 sceneVlmLabel 函数:
  - total_scenes > 0: 显示 '(X)'
  - total_scenes = 0: 显示 '—'
- 添加 hasSceneVlm 函数,控制点击事件
- 添加 ms-proc-clickable 样式,提供视觉提示

影响:
- 用户可以看到所有处理步骤
- 清楚知道 Scene VLM 不适用于该文件
- 更好的用户体验

测试:
✅ 编译通过
✅ 无 scenes 的文件显示 '—'
✅ 有 scenes 的文件显示 '(X)' 并可点击查看详情
This commit is contained in:
2026-10-10 14:07:35 +08:00
parent 7a295bb9b4
commit 086278616e

View File

@@ -330,10 +330,10 @@
<span class="ms-proc-count">{{ vlmSummaryLabel(ctxMenuFile?.file_uuid) }}</span>
<button class="ms-proc-redo" @click.stop="triggerVlmSummary(ctxMenuFile?.file_uuid)" title="Generate VLM Summaries">🔄</button>
</div>
<div v-if="sceneVlmLabel(ctxMenuFile?.file_uuid)" class="ms-proc-line" :class="sceneVlmClass(ctxMenuFile?.file_uuid)">
<div class="ms-proc-line" :class="sceneVlmClass(ctxMenuFile?.file_uuid)">
<label class="ms-fm-check-label">Scene VLM</label>
<span class="ms-proc-status">{{ sceneVlmIcon(ctxMenuFile?.file_uuid) }}</span>
<span class="ms-proc-count" @click.stop="viewScenesJson()">{{ sceneVlmLabel(ctxMenuFile?.file_uuid) }}</span>
<span class="ms-proc-count" :class="{ 'ms-proc-clickable': hasSceneVlm(ctxMenuFile?.file_uuid) }" @click.stop="hasSceneVlm(ctxMenuFile?.file_uuid) && viewScenesJson()">{{ sceneVlmLabel(ctxMenuFile?.file_uuid) }}</span>
</div>
</div>
<div v-if="ctxMenuFile?.file_uuid && ctxMenuFile?.status === 'scanning'" class="ms-ctx-progress">
@@ -1307,6 +1307,11 @@ function sceneVlmStats(fileUuid: string | undefined) {
return getFileStats(fileUuid)?.scene_vlm || null
}
function hasSceneVlm(fileUuid: string | undefined): boolean {
const s = sceneVlmStats(fileUuid)
return s !== null && s.total_scenes > 0
}
function sceneVlmClass(fileUuid: string | undefined): string {
const s = sceneVlmStats(fileUuid)
if (!s || s.total_scenes === 0) return ''
@@ -1323,7 +1328,8 @@ function sceneVlmIcon(fileUuid: string | undefined): string {
function sceneVlmLabel(fileUuid: string | undefined): string {
const s = sceneVlmStats(fileUuid)
if (!s || s.total_scenes === 0) return ''
if (!s) return '—'
if (s.total_scenes === 0) return '—'
return `(${s.total_scenes})`
}
@@ -2297,6 +2303,8 @@ function resetFilters() {
.ms-proc-line { display: flex; align-items: center; }
.ms-face-th-input { margin-left: auto; width: 90px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--text-primary); background: var(--bg-card); }
.ms-proc-count { margin-left: 4px; font-size: 11px; color: var(--text-secondary); }
.ms-proc-clickable { cursor: pointer; text-decoration: underline; }
.ms-proc-clickable:hover { color: var(--primary-color); }
.ms-fm-progress { position: relative; height: 20px; background: var(--border-light); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.ms-fm-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary-color), #4285f4); border-radius: 4px; transition: width 0.3s; }
.ms-fm-progress-bar.indeterminate { width: 100%; background: linear-gradient(90deg, transparent, var(--primary-color), #4285f4, transparent); background-size: 200% 100%; animation: shimmer 1.5s infinite; }