Skip to content

feat(web): /app 新增 HTML 動畫 → MP4 上傳介面#88

Merged
dofliu merged 2 commits into
mainfrom
claude/html-animation-frontend-ui
Jun 26, 2026
Merged

feat(web): /app 新增 HTML 動畫 → MP4 上傳介面#88
dofliu merged 2 commits into
mainfrom
claude/html-animation-frontend-ui

Conversation

@dofliu

@dofliu dofliu commented Jun 25, 2026

Copy link
Copy Markdown
Owner

這個 PR 做什麼

延續 #87(後端 HTML→MP4,已合併),把功能接到 /app 前端,讓使用者直接拖一支 .html 或貼一個 URL 就能產影片,不必手動打 API。

變更

  • types.tsSourceTypehtml_animation
  • api.tsuploadHtmlAnimation():multipart 送 file/url + duration/fps/width/height + options_json,對齊後端 POST /upload/html 契約。
  • CreateJobForm.tsxhtml_animation 走專屬分支:
    • 上傳 .html 或貼 URL 二擇一(無 server-path 模式)。
    • 影片長度(秒,必填)/ fps / 解析度 三欄;解析度含 1080p–4K 與 **9:16 直向(Shorts)**預設。
    • theme / length_mode / cover / outro 等 deck 專屬選項自動隱藏(themeApplicable 本就不含它),避免無關欄位干擾。
  • SourceBadge.tsx — 加 html_animation 徽章(HTML)。

使用流程

/app → 新增 Job → Source type 選 html_animation → 上傳 .html 或貼 URL → 設長度/fps/解析度 → 建立。Job 背景 render(rendering → done)完成後,MP4 自動出現在 /library,按既有的 YouTube 一鍵上傳即可發佈。

驗證

  • tsc --noEmit0 errorvite build通過(60 modules,無警告)。
  • 後端 TestClient前端實際送出的 FormData(url 模式 + .html 上傳模式,mock=true)打 /upload/html → 皆回 201,背景 mock render 產出 MP4。
  • 本 repo 無前端單元測試框架,故以 build + 契約整合驗證為準。

範圍

純前端接線,後端不動。含外部 asset 的 zip 包裹仍未支援(單一自含 .html 或 URL),留待後續。

🤖 Generated with Claude Code


Generated by Claude Code

接上已合併的後端 POST /upload/html (PR #87), 讓使用者直接從 /app 操作,
不必手動打 API。

- types.ts: SourceType 加 html_animation。
- api.ts: uploadHtmlAnimation() — multipart 送 file/url + duration/fps/
  width/height, 對齊 /upload/html 契約。
- CreateJobForm.tsx: html_animation 走專屬分支 — 上傳 .html 或貼 URL 二擇一
  (無 server-path 模式), 加 duration(必填)/fps/解析度三欄 (含 9:16 直向預設);
  theme/length/cover/outro 等 deck 專屬選項自動隱藏 (themeApplicable 不含它)。
- SourceBadge.tsx: 加 html_animation 徽章 (HTML)。

驗證: tsc --noEmit 0 error; vite build 通過; TestClient 以前端送出的
FormData (url 模式 + .html 上傳模式, mock=true) 實打 /upload/html 皆回 201。

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MGT1mi2KPYyD76U1BKEhMo
…-frontend-ui

# Conflicts:
#	web/src/api.ts
#	web/src/components/CreateJobForm.tsx
#	web/src/components/ui/SourceBadge.tsx
#	web/src/types.ts
@dofliu
dofliu merged commit 76d7b01 into main Jun 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants