Commit Graph

39 Commits

Author SHA1 Message Date
a64e200ca5 fix: pause/resume now manually updates file status in cache
Root cause: backend pause updates monitor_jobs table, but frontend
displays status from videos table (via get_files API). These are separate.

Fix:
- ctxPause: manually sets file.status = 'paused' in filesCache + fileStatusCache
- batchPause: same manual cache update for each file
- ctxResume/batchResume: calls loadFiles() to refresh from backend
- Added console.log debug for troubleshooting
- Fixed i18n: removed duplicate emoji from translation strings
2026-10-18 21:38:47 +08:00
67e806037f fix: pause/resume now reloads files to update status badge
- ctxPause and ctxResume now call loadFiles() + loadPausedFiles()
- batchPause and batchResume also reload after completion
- Use new Set() for proper Vue reactivity
- Fixes status badge not updating after pause
2026-10-18 21:13:39 +08:00
4e90f832d9 feat: add pause/resume to library context menu and batch operations
- Add pause/resume buttons to file context menu (right-click)
- Add batch pause/resume buttons to section titles
- Support concurrent pause/resume with pLimit(3)
- Add paused status badge (⏸) with warning color
- Integrate with Core API /api/v1/jobs/:uuid/pause|resume
- Track paused files via Redis jobs:paused set
- Add i18n translations (zh-TW, en)
2026-10-18 21:09:05 +08:00
f298626487 feat: 实现四阶段进度显示
问题:
- 当前进度显示使用旧的处理器列表
- 显示了所有独立的处理步骤,而不是分阶段

解决方案:
- 将处理步骤聚合到四个主要阶段
- 实现阶段级进度计算
- 更新阶段名称显示

四阶段结构:
1. Processors (30%)
   - 包含所有处理器 (ASR, FACE, OCR, etc.)

2. Knowledge Graph (35%)
   - tkg_nodes
   - tkg_edges

3. Moment Extraction (6%)
   - vlm_summary
   - scene_vlm
   - moment_chunks

4. Integration (29%)
   - rule1_ingestion
   - rule2_ingestion
   - face_tracing
   - face_dedup

实现细节:
- loadPipelineStats() 中添加阶段聚合逻辑
- 根据步骤权重计算阶段进度
- 根据步骤状态确定阶段状态
- formatStageName() 更新阶段名称映射

进度计算:
- 阶段进度 = 加权平均步骤进度
- 阶段状态 = 优先级: failed > completed > running > pending
- 总体进度 = 加权阶段进度之和

显示效果:
- ✗ Processors: 0%
- ✓ Knowledge Graph: 100%
- ✗ Moment Extraction: 33%
- ✗ Integration: 50%

优势:
- 更清晰的阶段划分
- 更好的进度概览
- 更符合实际处理流程
2026-10-14 20:23:42 +08:00
af60ea118a feat: 添加 Scene VLM 阶段到 Pipeline Progress 显示
问题:
- Core API 新增 scene_vlm 阶段
- Studio 需要同步更新权重映射和显示名称

修复:
- 更新 WEIGHT_MAP,添加 scene_vlm (0.03)
- 调整 vlm_summary 权重从 0.04 到 0.03
- 更新 formatStageName 函数,添加 'Scene VLM' 显示名称

权重映射:
- processors: 0.30
- rule1_ingestion: 0.05
- face_tracing: 0.05
- face_dedup: 0.10
- tkg_nodes: 0.20
- tkg_edges: 0.15
- rule2_ingestion: 0.10
- vlm_summary: 0.03
- scene_vlm: 0.03
- moment_chunks: 0.01

影响:
- 文件处理流程显示 Scene VLM 阶段
- 深度扫描文件显示完整的处理进度
- 用户可以实时监控 Scene VLM 处理状态

测试:
✅ 编译通过 (npm run build)
✅ 阶段显示名称正确
2026-10-10 14:57:22 +08:00
086278616e 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)' 并可点击查看详情
2026-10-10 14:07:35 +08:00
670ef45c32 fix: 修复 LibraryView formatDate 函数日期格式化错误
问题:
- Library 页面渲染时崩溃
- Console 错误: RangeError: Invalid time value
- formatDate 函数未处理无效日期

原因:
- formatDate(date) 没有 null/undefined 检查
- new Date(date) 对无效字符串创建 Invalid Date
- Invalid Date.toISOString() 抛出 RangeError

修复:
- 添加 null/undefined 检查
- 添加 try-catch 错误处理
- 验证日期有效性后才格式化

测试:
- ✅ TypeScript 编译通过
- ✅ Vite build 成功
- ✅ 错误处理正确

影响:
- Library 页面正常显示文件列表
- 无效日期显示为空字符串
- 不会崩溃
2026-10-09 23:02:58 +08:00
4f2dc359fb fix: 使用 p-limit API 准确显示队列状态
问题:
- 手动计算队列数量不准确
- 无法正确反映 p-limit 内部的队列状态

修复:
- 使用 limit.pendingCount 获取等待中的任务数量
- 使用 limit.activeCount 获取正在处理的任务数量
- 显示更详细的进度:"Processing 1/5 (3 queuing, 2 active)..."

优点:
- 准确反映 p-limit 内部状态
- 用户可以清楚看到有多少任务在排队
- 可以看到有多少任务正在并发处理
2026-10-08 01:49:53 +08:00
e83d5c7a8c fix: 添加延迟确保批量 Deep Scan 严格限制并发为 2
问题:
- re_scan_file API 是异步的,立即返回成功
- 后端可能同时启动多个扫描任务
- 导致有 4 个文件同时在 scanning 状态

临时修复:
- 在每个文件启动扫描后等待 2 秒
- 确保后端有足够时间开始处理并释放资源
- 保持前端并发控制为 2,避免过多任务同时启动

未来改进:
- 需要在后端实现真正的队列机制
- 或者检查当前 scanning 状态,动态调整启动速度
2026-10-08 01:37:35 +08:00
4e1df67857 fix: 修复批量 Deep Scan 队列显示问题
问题:
- 使用静态的 position 计算 queuePosition,导致队列显示不准确
- 任务实际执行时间不确定,导致队列状态显示错误

修复:
- 使用 processing 变量跟踪正在处理的任务数量
- 动态计算队列数量:queueCount = filesToProcess.length - successCount - failCount - processing
- 确保队列状态实时更新

改进:
- 添加 processing 变量跟踪正在处理的任务
- 在 finally 块中递减 processing 计数器
- 实时更新队列显示,反映真实状态
2026-10-08 01:32:43 +08:00
593b83d61a refactor: 批量 Deep Scan 并发数改为 2,优化排队显示
修改:
- maxConcurrent 从 3 改为 2
- 开始时显示:"Starting: 2 immediate, 3 queuing..."
- 处理时显示:"Processing 1/5" 或 "Processing 3/5 (1 queuing)..."
- 更清晰的队列状态显示
2026-10-08 01:00:24 +08:00
d3df1e54d0 feat: 添加批量 Deep Scan 功能
功能:
- 在 Registered 和 Completed section 添加批量 Deep Scan 按钮
- 显示条件:当有已选择的 registered/completed 文件时
- 使用 p-limit 控制并发(maxConcurrent = 3)
- 超过并发的文件自动排队等待

实现细节:
- 添加 batchProcessing ref 跟踪批量处理状态
- 实现 batchDeepScan 函数,调用 re_scan_file API
- 显示处理进度和队列信息
- 成功后更新文件状态为 'scanning'
- 处理完成后清空选择并刷新文件列表

用户体验:
- 点击按钮 → 确认对话框 → 显示进度
- 显示格式:"Processing 1/10 (7 in queue)..."
- 完成后显示成功/失败统计
2026-10-08 00:50:24 +08:00
a1e0519170 feat: 在 Registered section 添加批量 unregister 按钮
功能:
- 在 Registered section 标题中添加批量 unregister 按钮
- 显示条件:当有已选择的 registered/completed 文件时
- 显示已选择的总数(selectedRegisteredFiles.length)

改进:
- 用户可以在 Registered 或 Completed section 中看到批量 unregister 按钮
- 方便用户批量管理已注册文件
2026-10-08 00:43:08 +08:00
53e23037ec fix: 修复 registered 卡片 checkbox 无法勾选的问题
问题:
- toggleSelect 函数使用 'f.file_path || f.file_uuid' 作为 key
- 对于 registered 文件,如果有 file_path 属性,会优先使用 file_path
- 但是 is-selected class 和 checkbox 显示都检查 file_uuid
- 导致 selectedFiles 中存的是 file_path,但检查的是 file_uuid,不匹配

修复:
- 修改 toggleSelect 函数,优先使用 file_uuid('f.file_uuid || f.file_path')
- 对于 registered 文件,确保使用 file_uuid
- 对于 unregistered 文件,使用 file_path(因为没有 file_uuid)
2026-10-08 00:12:16 +08:00
73532c2e3e fix: 修复 LibraryView registered/completed 卡片 checkbox 缩进错误
问题:
- registered 卡片的 ms-fm-badges div 没有缩进,导致 HTML 结构错误
- completed 卡片的 ms-fm-badges div 也没有缩进
- 这导致 checkbox 功能失效

修复:
- 为 registered 卡片的 ms-fm-badges 添加正确的缩进(15个空格)
- 为 completed 卡片的 ms-fm-badges 添加正确的缩进(15个空格)
- 确保 checkbox 在正确的 DOM 位置,功能正常
2026-10-07 23:56:30 +08:00
e65d5648b8 feat: 批量 unregister 功能 + 性能优化
功能:
- LibraryView 添加批量 unregister 按钮(勾选多个已注册文件后显示)
- 添加确认对话框,支持批量取消注册
- 添加中英日三语翻译

性能优化:
- search_agents API timeout 提升到 90s(避免前端超时)
- thumbnail 并发数从 32 降到 10(减少服务器压力)

修复:
- PeopleView 添加 group_uuid 字段映射
- LibraryView 排序优化(scanning/preparing 优先)
2026-10-07 23:39:31 +08:00
22fd55b0ab fix: 修复 LibraryView pose 过滤结构问题
**问题:**
- v-for 后的空 div 可能导致渲染问题
- 影响整个页面显示

**修复:**
- 使用 template + v-if 组合
- 避免创建多余的空 div
- 保持 TypeScript 类型安全

**测试:**
- 编译成功
- proxy 正常运行
- Library 页面应恢复正常

相关需求: A-8 (移除 pose)
2026-10-05 12:15:44 +08:00
7b83d987e4 fix: LibraryView 过滤 pose 显示(避免 HTML 结构问题)
**修改方法:**
- 使用嵌套 div + v-if 过滤 pose
- 避免使用 template 标签(可能导致结构问题)

**修改位置:**
- Line 353-357: processor output 过滤 pose
- Line 555: QC 检查移除 POSE

**原因:**
- pose 已从 pipeline 移除 (A-8)
- 之前的方法可能导致 HTML 结构问题

**过滤逻辑:**
```vue
<div v-for="(info, proc) in processors">
  <div v-if="proc !== 'pose'">
    <!-- 显示内容 -->
  </div>
</div>
```

相关需求: A-8 (移除 pose)
2026-10-05 11:58:06 +08:00
8758255eee feat: LibraryView 补全 stage 名称映射
**添加内容:**
- 添加 moment_chunks 到 formatStageName 映射
- 返回 'Moment Chunks' 作为显示名称

**Core API Stages 完整列表:**
- processors: Processors (weight: 0.30)
- rule1_ingestion: Rule1 Ingestion
- face_tracing: Face Tracing
- face_dedup: Face Dedup
- tkg_nodes: TKG Nodes
- tkg_edges: TKG Edges
- rule2_ingestion: Rule2 Ingestion
- vlm_summary: VLM Summary (weight: 0.04)
- moment_chunks: Moment Chunks (weight: 0.01)

**前端处理:**
- ✅ 直接使用 API 返回的 overall_progress
- ✅ 直接使用 API 返回的 stages[].weight
- ✅ 直接使用 API 返回的 stages[].progress
- ✅ 无前端权重计算

**API Endpoint:**
- GET /api/v1/pipeline-progress/:file_uuid
- 返回 PipelineProgress 结构

参考文件:
- Core: /Users/accusys/momentry_core/src/core/progress.rs:42-111
- API: /Users/accusys/momentry_core/src/api/scan.rs:1254
2026-10-05 05:03:31 +08:00
ed971c5f98 fix: LibraryView 移除 pose 相关代码
**移除内容:**
- 移除 pose 处理器选项(Line 305-310)
- 移除 procPose 变量定义(Line 1055)
- 移除 selectedProcessors 中的 procPose(Line 1142)
- 移除 processors 列表中的 'pose'(Line 1348, 1408)

**原因:**
- pose 已从 pipeline 移除(A-8)
- 无需在 Library 卡片中显示

**后续:**
- 待确认 VLM Summary 和 moment_chunks 是否需要合并
- 待确认百分比是否需要重新配置

相关需求: A-8 (移除 pose)
2026-10-05 04:57:25 +08:00
26ac0e90df fix: 完成 B-1, B-2, B-4(proxy 硬编码移除 + re-scan 端点)
B-1: 移除 proxy 硬编码路径
- 移除 API_KEY 常量,改为 get_api_key() 从环境变量读取
- 移除 PROFILE_DIRS,改为 get_output_dir() 从环境变量读取
- 移除 output_bases (identity_matches, trace_profile),改为环境变量驱动
- 移除 ADMIN_CONFIG_PATH,改为 get_admin_config_path() 从环境变量读取
- 添加 dev fallback 支持开发环境

B-2: API key 改为环境变量
- MOMENTRY_API_KEY 环境变量必须设置
- 未设置时会明确报错启动

B-4: 改用 re-scan 端点
- 简化 doReprocess 函数从 92 行减少到 32 行
- 改用单一 POST /api/v1/re-scan API
- 显式传 auto_pipeline: true
- 移除 unregister → register → process 手动串接
- 原子性操作,避免中间失败留下不一致状态

环境变量:
- MOMENTRY_API_KEY (必需)
- MOMENTRY_OUTPUT_DIR (可选,默认 /Users/accusys/momentry/output)
- MOMENTRY_DATA_DIR (可选,默认 /Users/accusys/momentry/data)
- MOMENTRY_ADMIN_CONFIG (可选,默认 /Users/accusys/momentry/config/admin_config.json)
2026-10-04 15:00:45 +08:00
f3d75ebce8 feat: Library 批量注册 + PeopleView 修复 + 国际化
Library:
- 添加 checkbox 和鼠标框选功能
- Unregistered 卡片添加快速注册按钮
- 状态标签移至左下方,人脸图标移至左侧中间
- Deep Scan 改为 unregister -> register -> process
- 完整国际化(日语、繁体中文、英语)

PeopleView:
- 修复卡片不显示问题(使用 get_file_traces API)
- 移除对 identity_id 字段的依赖

其他:
- 添加日语语言包
- 添加 useDragSelect composable
- 新增文档:Face Bbox Null Bug Report
2026-10-01 00:42:13 +08:00
9d58fdb9d9 fix: unregister timeout 200s + async mode
- Add UNREGISTER_TIMEOUT=200000 (200s) for large file unregister
- Add timeout field to buildHttpRequest return type
- httpCall now uses per-request timeout override
- unregister_file now uses asyncMode: true for better UX
- Show "Removing in background..." toast for async mode

Fixes timeout error when unregistering large files (83K faces, 20K nodes).
2026-07-31 18:32:50 +08:00
c347c200b2 fix: load pipeline stats in syncFileStatus and handle missing pipeline data
Problem:
- syncFileStatus() doesn't load pipeline progress data
- Files stuck in 'processing' without percentage display
- pollPipelineProgress() not started when pipeline data missing

Solution:
1. Add loadPipelineStats() call in syncFileStatus() for processing files
2. Start pollPipelineProgress() even when pipeline data is missing
3. Ensure progress bar always has data to display

Impact:
- Progress bar now shows percentage during deep scan
- Files no longer stuck in 'processing' state indefinitely
- Better handling of edge cases when API data is missing

Related: Core team needs to verify get_pipeline_stats API accuracy
2026-07-25 01:36:28 +08:00
58e614cb5c fix: unify status text to 'Scanning...' in LibraryView
Problem:
- Status badge showed 'Scanning'
- Progress bar showed 'Processing...'
- Two different texts displayed simultaneously

Solution:
- Change progress bar text to 'Scanning...'
- Now both badge and progress bar use consistent terminology
2026-07-25 01:27:16 +08:00
a3b45e12c5 refactor: rename Face Cluster to Face Deduplication in LibraryView
- Update processor label from 'Face Cluster' to 'Face Deduplication'
- More accurate description of face_cluster processor functionality
2026-07-25 00:46:13 +08:00
717e2deb6a fix: remove hardcoded frame range from LibraryView title
When playing full video, only show filename.
Don't show F0-F99999 which is misleading.
2026-07-24 22:56:04 +08:00
c2901338e1 feat: enforce 100% frame-based positioning (no time)
Core Principle: Frame is the ONLY standard

Changes:
- VideoPlayer: Remove startTime/endTime props
- VideoPlayer: Add mandatory startFrame/endFrame check
- VideoPlayer: UI shows F123 (51.2s) format
- All Views: Only set startFrame/endFrame
- All Views: Only pass :start-frame/:end-frame
- Remove all startTime/endTime from currentVideo refs

Time is only used for display (auxiliary).
Frame is the source of truth for all positioning.
2026-07-24 22:49:35 +08:00
55d0216083 feat: add real-time files watch for LibraryView
Implement comprehensive monitoring system:
- Watch for new registered files (5s interval)
- Detect file status changes (registered → processing → completed)
- Monitor file additions/removals

Functions added:
- startFilesWatch(): Poll get_files API every 5s
- stopFilesWatch(): Clean up interval

LibraryView integration:
- Enable on mount
- Disable on unmount

Enables cross-machine monitoring: one operates, another watches changes
2026-07-24 21:49:06 +08:00
2af8ffaf93 feat: add face_cluster processor support to LibraryView
Core Changes (P0):
- Add 'face_cluster' to processors array (2 locations)
- Add data.clusters branch to getJsonCount()
- Add FACE_CLUSTER to QC Pipeline Stage 2 filter

Additional Changes (P1):
- Add Face Cluster UI to context menu
- Add procFaceCluster ref and selectedProcessors()

Backend: Always-Produce rule ensures face_cluster.json always exists
Ref: /Users/accusys/momentry_core/docs_v1.0/GUIDES/QC_FaceCluster_Support.md
2026-07-24 20:52:27 +08:00
5951aca086 feat: frame-based positioning and mark system foundation
Core Changes:
- Fix SearchView to use start_frame/end_frame directly (no time*fps conversion)
- Add hard_delete support to delete_trace API
- VideoPlayer: Main timeline + Mark system foundation
- Proxy: Add local routes for auth, media, identity-matches, cluster-results
- Add .gitignore to exclude build artifacts and dependencies

Design Documents:
- Multi-track Mark system design (.opencode/plans/)
- Video editing positioning standards research

Files Modified:
- src/views/SearchView.vue: Frame positioning, ensureMinDuration (240 frames)
- src/views/PeopleView.vue: batchDeleteGroups with hard_delete
- src/api/index.ts: delete_trace with hard_delete body
- src/components/VideoPlayer.vue: Timeline + Mark UI
- src-tauri/src/proxy.rs: New local routes
- AGENTS.md: Update documentation
2026-07-24 20:19:47 +08:00
bf7fbce458 fix: remove Identity processor option and deprecated trace_chunks
- Removed Identity checkbox from processor selection in context menu
- Removed trace_chunks from PostgreSQL section (deprecated)
- Added relationship_chunks to PostgreSQL section
2026-07-02 16:22:48 +08:00
f915aaf794 feat: pending identity sorting, face detail modal, video player fps, processor counts 2026-06-24 02:02:33 +08:00
7855983dc1 feat: bind/unbind by id, video streaming proxy, unmute default, library refresh, hamburger click-outside
- Core API: bind/unbind accept id (integer PK) when face_id is null
- Tauri proxy: stream video responses instead of buffering for seek bar
- VideoPlayer: remove muted attribute, unmute by default
- LibraryView: call invalidateFiles() before ensureFiles() on register/unregister
- PeopleView: close sort panel on click-outside, not just hamburger toggle
- bind_face: prefer face_id, fallback to id when face_id is null
2026-06-18 22:24:03 +08:00
6b961612f7 fix: Library thumbnail loading + People right-click context menu 2026-06-14 22:41:38 +08:00
07d9ebda29 fix: Library thumbnail guard, Search People/Agent modes, People pagination debug 2026-06-14 20:34:36 +08:00
b8bd7c05be fix: Library isRegistered checkmark, Search add People+Agent modes 2026-06-14 20:26:48 +08:00
3ba2120c8e All API through Rust proxy, fix unregistered files null uuid, People enhancements 2026-06-14 11:05:23 +08:00
79e0a862d4 Initial commit: Momentry Studio v0.1.0 2026-06-13 17:49:02 +08:00