Skip to content

feat(studio): My Videos library — browse, replay and download exported MP4s#47

Draft
abin0515 wants to merge 2 commits into
nexu-io:mainfrom
abin0515:feat/studio-video-library
Draft

feat(studio): My Videos library — browse, replay and download exported MP4s#47
abin0515 wants to merge 2 commits into
nexu-io:mainfrom
abin0515:feat/studio-video-library

Conversation

@abin0515

Copy link
Copy Markdown

Closes #46

按 issue 里 maintainer 的范围建议,第一刀只做「浏览导出历史 + 浏览器内播放 + 导出后直达播放器」;rename / delete 等管理操作留给后续 PR,避免文件操作边界情况撑大本次改动面。

改动内容

core

  • 导出记录新增可选 displayName(默认人类可读的本地时间戳,分钟精度),并导出 formatExportDisplayName

studio-server

  • GET /api/library —— 跨项目汇总导出历史(最新在前);对只有 lastOutputMp4Path、没有 exports 记录的老项目做了兜底,旧导出不会丢
  • GET /preview/:id/exports/:filename.mp4 —— 按文件名提供某条历史导出;?download=1 时带 Content-Disposition,下载文件名取自 displayName
  • GET /preview/:id/export.mp4 —— 最新导出的快捷路由

project-studio(纯 vanilla JS/CSS,无新增依赖)

  • 顶栏新增 Create | My Videos 视图切换;进入库视图时创作工具自动隐藏
  • 库视图:导出卡片网格(显示名 + 项目名)→ 浏览器内 <video> 播放页,支持下载 / 继续编辑 / 返回列表,空状态引导回 Create
  • 导出完成后自动跳到该视频的播放页(不再只弹一个文件路径);聊天里的 "MP4 ready" 卡片加了 Play 按钮直达播放器
  • 中英文 i18n 文案补齐

顺带的 toolbar 适配(nav 多占 ~180px 引起)

验证(全部实跑,非 mock)

  • pnpm -r build 全过
  • API:/api/library 返回真实历史(含 displayName 新记录与仅 lastOutputMp4Path 老记录两种路径);MP4 路由 200 + 正确 MIME;?download=1 下载头正确;不存在的文件 404
  • Playwright 无头浏览器实测:nav 切换与 active 态、库视图卡片渲染、播放器加载真实 MP4(duration 26.9s)、继续编辑跳回创作视图、聊天卡片 Play 直达播放器——1100/1280/1440/1920 四档宽度 toolbar 零溢出,全程零 page error

🤖 Generated with Claude Code

…d MP4s

Adds a Create | My Videos view switcher to the studio toolbar. The library
view lists every persisted export across projects (the project.exports
history that core already records), plays them in an in-browser <video>
player, and offers download / continue-editing. After an MP4 export
finishes, the studio jumps straight to the player instead of only showing
the output path.

- core: add optional displayName to export records (human-readable local
  timestamp by default) and export formatExportDisplayName
- studio-server: GET /api/library (flattened export history, newest first),
  GET /preview/:id/exports/:filename.mp4 (+ ?download=1 with a
  Content-Disposition name derived from displayName), and keep
  /preview/:id/export.mp4 as a latest-export shortcut
- project-studio: nav switcher, library grid + player views, Play action on
  the chat MP4-ready card, i18n strings for both locales; vanilla JS/CSS,
  no new dependencies

Closes nexu-io#46

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lefarcen lefarcen requested a review from Siri-Ray June 12, 2026 18:59
@lefarcen lefarcen added size/L Size L (300-699 LOC) risk/medium Medium risk type/feature Feature change labels Jun 12, 2026
Entering My Videos always re-fetches /api/library (switchAppView), so the
button was redundant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/medium Medium risk size/L Size L (300-699 LOC) type/feature Feature change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(studio): 「我的视频」库 —— 在 studio 内浏览、回放和管理导出的 MP4(愿意提 PR)

2 participants