feat(extension): 侧边栏与 popup 用视频标题替代链接显示

在任务未完成的早期阶段(PENDING/DOWNLOADING 等),侧边栏和 popup
只能回退到 videoUrl,用户看到的是一长串链接,难以辨认。

改动:
- TaskRecord 新增 title 字段,用于存储浏览器标签页标题
- popup 创建任务时保存 tab.title
- background startTask 接收可选 title,右键菜单和悬浮按钮均传入
- 显示优先级:result.audio_meta.title > title > videoUrl
- 所有平台(Bilibili / YouTube / Douyin / Kuaishou)均受益

测试:
- pnpm typecheck 通过
- pnpm build 通过
- 在 B 站、YouTube 视频页提交任务,侧边栏和 popup 均显示标题而非链接
This commit is contained in:
techotaku39
2026-05-24 00:05:47 +08:00
parent 717df2af7b
commit 1eb213e215
5 changed files with 24 additions and 11 deletions

View File

@@ -79,6 +79,8 @@ export interface TaskRecord {
createdAt: number
updatedAt: number
result?: NoteResult
// 从浏览器 tab.title 抓取,任务完成前用来替代 videoUrl 显示
title?: string
}
// 与 backend/app/gpt/prompt_builder.py note_styles 一一对齐