dsh-video-insight 0.9.1 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
4
4
  [![DeepSeek Harness](https://img.shields.io/badge/DeepSeek%20Harness-plugin-4d6bfe.svg)](https://github.com/deepseek-ai)
5
5
  [![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey.svg)](#已知限制)
6
- [![Version](https://img.shields.io/badge/dsh--video--insight-v0.9.1-blue.svg)](package.json)
6
+ [![Version](https://img.shields.io/badge/dsh--video--insight-v0.10.1-blue.svg)](package.json)
7
7
 
8
8
  ![dsh-video-insight](icon.svg)
9
9
 
@@ -23,11 +23,13 @@
23
23
 
24
24
  入口在左侧栏的面板列表(`sidebar.panellist`,`order: 30`,排在默认条目之后,可按需调整)。图标是粉色播放键 + 星芒。
25
25
 
26
- 首页是 Google 式的**居中大输入框 + 解析按钮**(粘贴链接回车即可),下面是「最近分析」的历史列表(历史区自己内联滚动,不带动整页),点历史项直接回到那个视频;不再有多余的平台介绍卡。解析出视频后才出现顶部的小号输入条,方便随时换一个链接。
26
+ 首页是 Google 式的**居中大输入框 + 解析按钮**(粘贴链接回车即可,示例 chips 与输入行同一块、不再堆多行小字),下面给三个真实示例(TED 演讲 / 哔哩哔哩科普 / 无字幕动画),点一下就能看完整效果;「最近分析」是**四列卡片流**(一屏两行放得下 8 条):封面、时长、标题、作者,以及总结/章节/导图状态徽标,卡片右上 `⋯` 可以重新解析、复制链接、收藏或删除(历史区自己内联滚动,不带动整页)。解析出视频后才出现顶部的小号输入条,方便随时换一个链接。
27
+
28
+ 面板顶部还有**全局任务条**:只要有视频在后台解析就常驻显示「解析队列 3/8 · 正在写总结 42%」,点「展开」是任务抽屉(运行中可取消、失败可重试、完成可打开,底部一键清除已完成)。详情页工具栏分两层:第一层是返回/封面/标题/重新生成▾/导出▾/历史/设置,第二层元信息(作者、时长、发布、播放数据)可收起。页签标题后面有小状态点:实心=已生成、呼吸=生成中、空心=还没生成。
27
29
 
28
30
  | 页签 | 做什么 |
29
31
  | --- | --- |
30
- | 总结 | 解析完自动流式生成;结构固定为 一句话总结 / 核心观点 / 内容脉络 / 关键要点 / 值得记住的说法 / 适合谁看,引用带 `[mm:ss]` 时间戳——**正文里的时间戳也可点击,点一下播放器跳到该时间点继续播放**。正文末尾还让模型顺手给出 **3 条「继续追问」**(只对本期内容成立的具体问题),host 会把它从正文里剥出来、单存成 `suggestions`,面板在追问空态里渲染成带虚线的 chip |
32
+ | 总结 | 解析完自动流式生成,**首屏是卡片化阅读**:一句话总结大卡 + 核心观点 / 适合谁看 / 值得记住的说法三张小卡,内容脉络与关键要点折叠在后面(点开可读全文);结构固定为 一句话总结 / 核心观点 / 内容脉络 / 关键要点 / 值得记住的说法 / 适合谁看,引用带 `[mm:ss]` 时间戳——**正文里的时间戳也可点击,点一下播放器跳到该时间点继续播放**。正文末尾还让模型顺手给出 **3 条「继续追问」**(只对本期内容成立的具体问题),host 会把它从正文里剥出来、单存成 `suggestions`,面板在追问空态里渲染成带虚线的 chip |
31
33
  | 章节 | 章节大纲**以思维导图的一级节点为准**(`GET /outline`;导图节点带时间点,直接作为章节起点),导图还没生成时退回模型按时间轴切的章节、视频自带章节或分 P;每行带一张 `GET /thumb` 章节缩略图,点行跳转到该章并继续播放,播放时当前章节高亮 |
32
34
  | 原文 | 字幕逐段列表(`[mm:ss] 文本`),可搜索过滤、点单条复制、一键复制全文;「双语」开关把每段翻译成中文/英文(`POST /translate`,按批送模型、结果按视频缓存),开启「跟随」后播放器播到哪、对应段落就高亮滚到视野里(时间轴同步由播放器外壳每秒回传) |
33
35
  | 思维导图 | 模型把字幕整理成 3 层树状大纲(`GET /mindmap`,带缓存),面板渲染成 **SVG 图形化横向树**(节点卡片 + 贝塞尔连线、按分支配色),点节点折叠/展开,支持全部展开/收起、缩放、重新生成;节点上带可点的时间徽标(模型按字幕定位),点一下跳到视频对应位置 |
package/client/client.js CHANGED
@@ -16,8 +16,9 @@ window.__ModuleLoader__.load({
16
16
 
17
17
  const PANEL_ID = 'video';
18
18
  const PLAYER_KEY = 'dsh-video.player.collapsed';
19
+ const META_KEY = 'dsh-video.meta.collapsed';
19
20
  const HISTORY_LIMIT = 100;
20
- const HOME_RECENT_LIMIT = 10;
21
+ const HOME_RECENT_LIMIT = 8;
21
22
  const SEGMENT_LIMIT = 400;
22
23
  /** 后台解析队列轮询间隔:有任务在跑时 2s,空闲时 10s。 */
23
24
  const JOBS_ACTIVE_MS = 2000;
@@ -75,6 +76,12 @@ window.__ModuleLoader__.load({
75
76
  en: 'English', 'en-us': 'English', 'en-gb': 'English', ja: '日本語', ko: '한국어',
76
77
  };
77
78
  const TABS = [['summary', '总结'], ['chapters', '章节'], ['transcript', '原文'], ['storyboard', '分镜'], ['mindmap', '思维导图']];
79
+ /** 首页示例链接:点一下直接解析。 */
80
+ const HOME_EXAMPLES = [
81
+ ['TED 演讲 · 24min', 'https://www.youtube.com/watch?v=iG9CE55wbtY'],
82
+ ['哔哩哔哩科普 · 16min', 'https://www.bilibili.com/video/BV14Asw6jE1J'],
83
+ ['无字幕动画 · 10min', 'https://www.youtube.com/watch?v=aqz-KE-bpKQ'],
84
+ ];
78
85
  const ASK_EXAMPLES = ['这个视频最核心的论点是什么?', '作者的观点有哪些可疑之处?', '用 5 句话讲给完全不懂的人听'];
79
86
 
80
87
  function platformMeta(platform) {
@@ -353,6 +360,17 @@ window.__ModuleLoader__.load({
353
360
  try { return window.localStorage.getItem(PLAYER_KEY) === '1'; }
354
361
  catch { return false; }
355
362
  }
363
+
364
+ /** 元信息行是否折叠(localStorage 记忆,默认展开)。 */
365
+ function readMetaCollapsed() {
366
+ try { return window.localStorage.getItem(META_KEY) === '1'; }
367
+ catch { return false; }
368
+ }
369
+
370
+ function writeMetaCollapsed(collapsed) {
371
+ try { window.localStorage.setItem(META_KEY, collapsed ? '1' : '0'); }
372
+ catch { /* 忽略隐私模式等异常 */ }
373
+ }
356
374
  function writePlayerCollapsed(collapsed) {
357
375
  try { window.localStorage.setItem(PLAYER_KEY, collapsed ? '1' : '0'); }
358
376
  catch { /* 隐私模式 / 配额满:只影响记住折叠状态 */ }
@@ -716,10 +734,41 @@ window.__ModuleLoader__.load({
716
734
  ]);
717
735
  }
718
736
 
737
+ /* ------------------------------------------------------------ 统一状态组件 */
738
+
739
+ /** 统一空态:标题 + 说明 + 可选操作。 */
740
+ function EmptyState({ title, note, action }) {
741
+ return h('div', { className: 'dvv-state dvv-state-empty' }, [
742
+ h('div', { key: 't', className: 'dvv-state-title' }, title || '暂无内容'),
743
+ note ? h('div', { key: 'n', className: 'dvv-state-note' }, note) : null,
744
+ action || null,
745
+ ].filter(Boolean));
746
+ }
747
+
748
+ /** 统一骨架屏:若干行 shimmer。 */
749
+ function Skeleton({ rows, note }) {
750
+ const count = Number(rows) > 0 ? Math.floor(Number(rows)) : 6;
751
+ return h('div', { className: 'dvv-state dvv-state-loading', 'aria-busy': 'true' }, [
752
+ h('div', { key: 'skel', className: 'dvv-skel-lines' }, Array.from({ length: count }, (_, index) =>
753
+ h('div', { key: index, className: 'dvv-skel', style: { width: `${92 - (index % 3) * 12}%` } }))),
754
+ note ? h('div', { key: 'n', className: 'dvv-state-note' }, note) : null,
755
+ ].filter(Boolean));
756
+ }
757
+
758
+ /** 统一错误态:中文信息 + 重试按钮。 */
759
+ function ErrorState({ text, onRetry, retryLabel }) {
760
+ return h('div', { className: 'dvv-state dvv-state-error' }, [
761
+ h('div', { key: 't', className: 'dvv-state-title' }, '出错了'),
762
+ h('div', { key: 'n', className: 'dvv-state-note' }, String(text || '请求失败,请稍后重试。')),
763
+ onRetry ? h('div', { key: 'a', className: 'dvv-actions' },
764
+ h('button', { type: 'button', className: 'dvv-btn', onClick: onRetry }, retryLabel || '重试')) : null,
765
+ ].filter(Boolean));
766
+ }
767
+
719
768
  /* ------------------------------------------------------------------ 空态 */
720
769
 
721
770
  /** 首页:Google 式居中的大号解析框 + 最近分析列表。 */
722
- function HomeHero({ url, busy, statusError, biliReady, onUrl, onSubmit, onGoSettings }) {
771
+ function HomeHero({ url, busy, statusError, biliReady, onUrl, onSubmit, onExample, onGoSettings }) {
723
772
  const canSubmit = !busy && String(url ?? '').trim().length > 0;
724
773
  const submit = (event) => {
725
774
  if (event && typeof event.preventDefault === 'function') event.preventDefault();
@@ -729,7 +778,7 @@ window.__ModuleLoader__.load({
729
778
  statusError ? h('div', { key: 'host', className: 'dvv-error' }, `插件主机未就绪:${statusError}(面板要等 host 半启动后才能解析)`) : null,
730
779
  h('div', { key: 'hero', className: 'dvv-home-hero' }, [
731
780
  h('h1', { key: 't', className: 'dvv-home-title' }, '视频解析'),
732
- h('p', { key: 's', className: 'dvv-home-sub' }, '粘贴 YouTube / 哔哩哔哩链接,自动抓字幕、生成总结、章节和思维导图,还能对着视频追问'),
781
+ h('p', { key: 's', className: 'dvv-home-sub' }, '粘贴一条链接,30 秒看清一个视频值不值得看。'),
733
782
  h('form', { key: 'form', className: 'dvv-home-form', onSubmit: submit }, [
734
783
  h('input', {
735
784
  key: 'i', className: 'dvv-home-input', type: 'text', value: url,
@@ -742,6 +791,14 @@ window.__ModuleLoader__.load({
742
791
  key: 'go', type: 'submit', className: 'dvv-btn dvv-home-btn', 'data-primary': 'true', disabled: !canSubmit,
743
792
  }, busy ? '解析中…' : '解析'),
744
793
  ]),
794
+ h('div', { key: 'chips', className: 'dvv-home-chips' }, [
795
+ ...HOME_EXAMPLES.map(([label, link]) => h('button', {
796
+ key: link, type: 'button', className: 'dvv-home-chip',
797
+ title: `解析示例:${link}`, disabled: busy,
798
+ onClick: () => { if (onExample) onExample(link); },
799
+ }, label)),
800
+ h('span', { key: 'tip', className: 'dvv-home-tip' }, '粘贴后回车解析'),
801
+ ]),
745
802
  !biliReady ? h('div', { key: 'cookie', className: 'dvv-home-hint' }, [
746
803
  h('span', { key: 't' }, 'B 站 AI 字幕需要登录 Cookie:'),
747
804
  h('button', { key: 'b', type: 'button', className: 'dvv-btn dvv-btn-mini', onClick: onGoSettings }, '去设置'),
@@ -793,49 +850,93 @@ window.__ModuleLoader__.load({
793
850
  * 顶部紧凑工具栏:返回 + 标题/平台/状态 + 历史/设置。
794
851
  * 视频信息压缩成两行(标题一行省略、元信息一行),不再占掉一整块纵向空间。
795
852
  */
796
- function VideoToolbar({ doc, job, historyCount, canGoBack, onBack, onHistory, onSettings, onCancelJob }) {
797
- let metaBits = [];
798
- if (doc) {
799
- const stats = doc.stats ?? {};
800
- metaBits = [
801
- h(PlatformBadge, { key: 'plat', platform: doc.platform, compact: true }),
802
- doc.duration ? h('span', { key: 'dur', className: 'dvv-dur' }, fmtTime(doc.duration)) : null,
803
- doc.author ? h('span', { key: 'author', className: 'dvv-note' }, doc.author) : null,
804
- doc.publishedAt ? h('span', { key: 'when', className: 'dvv-note' }, fmtDate(doc.publishedAt)) : null,
805
- ].filter(Boolean);
806
- const bits = [['播放', stats.views], ['点赞', stats.likes], ['评论', stats.comments]]
807
- .filter(([, value]) => Number(value) > 0)
808
- .map(([label, value], index) => h('span', { key: `s-${label}` }, `${index ? '· ' : ''}${label} ${fmtCount(value)}`));
809
- if (bits.length) metaBits.push(h('span', { key: 'stats', className: 'dvv-toolbar-stats' }, bits));
810
- }
853
+ function VideoToolbar({ doc, job, historyCount, canGoBack, onBack, onHistory, onSettings, onCancelJob, onRegenerate, onExport }) {
854
+ const [metaCollapsed, setMetaCollapsed] = useState(readMetaCollapsed);
855
+ const [menu, setMenu] = useState('');
856
+ const toggleMeta = () => {
857
+ const next = !metaCollapsed;
858
+ setMetaCollapsed(next);
859
+ writeMetaCollapsed(next);
860
+ };
861
+ const stats = doc ? (doc.stats ?? {}) : {};
862
+ const statBits = [['播放', stats.views], ['点赞', stats.likes], ['评论', stats.comments]]
863
+ .filter(([, value]) => Number(value) > 0)
864
+ .map(([label, value], index) => h('span', { key: `s-${label}` }, `${index ? '· ' : ''}${label} ${fmtCount(value)}`));
865
+ const closeMenu = () => setMenu('');
866
+ const runAction = (kind) => { closeMenu(); if (kind === 'summary' && onRegenerate) onRegenerate('summary'); if (kind === 'mindmap' && onRegenerate) onRegenerate('mindmap'); if (kind === 'storyboard' && onRegenerate) onRegenerate('storyboard'); };
867
+ const exportAction = (kind) => { closeMenu(); if (onExport) onExport(kind); };
868
+ const menuList = (items) => h('div', { className: 'dvv-menu-pop', role: 'menu' }, items.map(([key, label, action]) =>
869
+ h('button', { key, type: 'button', className: 'dvv-menu-item', role: 'menuitem', onClick: action }, label)));
811
870
  return h('header', { className: 'dvv-toolbar' }, [
812
- canGoBack ? h('button', {
813
- key: 'back', type: 'button', className: 'dvv-btn dvv-back',
814
- title: doc ? '返回首页' : '返回对话', 'aria-label': doc ? '返回首页' : '返回上一级',
815
- onClick: () => { if (onBack) onBack(); },
816
- }, '← 返回') : null,
817
- doc ? h('div', { key: 'cover', className: 'dvv-toolbar-cover' }, h(CoverImage, { src: doc.cover, alt: doc.title })) : null,
818
- h('div', { key: 'main', className: 'dvv-toolbar-main' }, doc ? [
819
- h('a', {
820
- key: 'title', className: 'dvv-toolbar-title', href: doc.url || '#', target: '_blank',
821
- rel: 'noreferrer noopener', title: doc.title || '',
822
- }, doc.title || '(无标题视频)'),
823
- h('div', { key: 'meta', className: 'dvv-toolbar-meta' }, metaBits),
824
- ] : null),
825
- h('div', { key: 'actions', className: 'dvv-toolbar-actions' }, [
826
- job && jobActive(job) ? h('div', {
827
- key: 'job', className: 'dvv-job-chip',
828
- title: `${jobStageText(job)} · ${jobPercent(job)}%`,
829
- }, [
830
- h('span', { key: 't', className: 'dvv-job-chip-text' }, `后台解析 ${jobPercent(job)}% · ${jobStageText(job)}`),
831
- h('button', {
832
- key: 'x', type: 'button', className: 'dvv-job-chip-x', title: '取消后台解析', 'aria-label': '取消后台解析',
833
- onClick: () => { if (onCancelJob) onCancelJob(job); },
834
- }, '×'),
835
- ]) : null,
836
- h('button', { key: 'history', type: 'button', className: 'dvv-btn', onClick: onHistory }, historyCount ? `历史 ${historyCount}` : '历史'),
837
- h('button', { key: 'settings', type: 'button', className: 'dvv-btn', onClick: onSettings }, '设置'),
871
+ h('div', { key: 'row', className: 'dvv-toolbar-row' }, [
872
+ canGoBack ? h('button', {
873
+ key: 'back', type: 'button', className: 'dvv-btn dvv-back',
874
+ title: doc ? '返回首页' : '返回对话', 'aria-label': doc ? '返回首页' : '返回上一级',
875
+ onClick: () => { if (onBack) onBack(); },
876
+ }, '← 返回') : null,
877
+ doc ? h('div', { key: 'cover', className: 'dvv-toolbar-cover' }, h(CoverImage, { src: doc.cover, alt: doc.title })) : null,
878
+ h('div', { key: 'main', className: 'dvv-toolbar-main' }, doc ? [
879
+ h('a', {
880
+ key: 'title', className: 'dvv-toolbar-title', href: doc.url || '#', target: '_blank',
881
+ rel: 'noreferrer noopener', title: doc.title || '',
882
+ }, doc.title || '(无标题视频)'),
883
+ h('div', { key: 'sub', className: 'dvv-toolbar-sub' }, [
884
+ h(PlatformBadge, { key: 'plat', platform: doc.platform, compact: true }),
885
+ doc.author ? h('span', { key: 'author', className: 'dvv-toolbar-author' }, doc.author) : null,
886
+ ].filter(Boolean)),
887
+ ] : [
888
+ h('div', { key: 't', className: 'dvv-toolbar-title-plain' }, '视频解析'),
889
+ h('div', { key: 's', className: 'dvv-toolbar-sub' }, '粘贴链接,自动抓字幕、做总结与思维导图'),
890
+ ]),
891
+ h('div', { key: 'actions', className: 'dvv-toolbar-actions' }, [
892
+ job && jobActive(job) ? h('div', {
893
+ key: 'job', className: 'dvv-job-chip',
894
+ title: `${jobStageText(job)} · ${jobPercent(job)}%`,
895
+ }, [
896
+ h('span', { key: 't', className: 'dvv-job-chip-text' }, `后台解析 ${jobPercent(job)}% · ${jobStageText(job)}`),
897
+ h('button', {
898
+ key: 'x', type: 'button', className: 'dvv-job-chip-x', title: '取消后台解析', 'aria-label': '取消后台解析',
899
+ onClick: () => { if (onCancelJob) onCancelJob(job); },
900
+ }, '×'),
901
+ ]) : null,
902
+ doc && onRegenerate ? h('div', { key: 'regen', className: 'dvv-menu' }, [
903
+ h('button', {
904
+ key: 'b', type: 'button', className: 'dvv-btn', 'aria-haspopup': 'menu',
905
+ 'data-open': menu === 'regen' ? 'true' : undefined,
906
+ onClick: () => setMenu(menu === 'regen' ? '' : 'regen'),
907
+ }, '重新生成 ▾'),
908
+ menu === 'regen' ? menuList([
909
+ ['summary', '重新生成总结', () => runAction('summary')],
910
+ ['mindmap', '重新生成思维导图', () => runAction('mindmap')],
911
+ ['storyboard', '重新生成分镜', () => runAction('storyboard')],
912
+ ]) : null,
913
+ ]) : null,
914
+ doc && onExport ? h('div', { key: 'export', className: 'dvv-menu' }, [
915
+ h('button', {
916
+ key: 'b', type: 'button', className: 'dvv-btn', 'aria-haspopup': 'menu',
917
+ 'data-open': menu === 'export' ? 'true' : undefined,
918
+ onClick: () => setMenu(menu === 'export' ? '' : 'export'),
919
+ }, '导出 ▾'),
920
+ menu === 'export' ? menuList([
921
+ ['md-copy', '复制 Markdown', () => exportAction('markdown')],
922
+ ['md-dl', '下载 .md', () => exportAction('download')],
923
+ ['full', '复制全文', () => exportAction('fulltext')],
924
+ ]) : null,
925
+ ]) : null,
926
+ h('button', { key: 'history', type: 'button', className: 'dvv-btn', onClick: onHistory }, historyCount ? `历史 ${historyCount}` : '历史'),
927
+ h('button', { key: 'settings', type: 'button', className: 'dvv-btn', onClick: onSettings }, '设置'),
928
+ ].filter(Boolean)),
838
929
  ]),
930
+ doc ? h('div', { key: 'meta', className: 'dvv-meta', 'data-collapsed': metaCollapsed ? 'true' : 'false' }, [
931
+ metaCollapsed
932
+ ? h('button', { key: 'expand', type: 'button', className: 'dvv-meta-toggle', onClick: toggleMeta }, '展开视频信息')
933
+ : [
934
+ doc.duration ? h('span', { key: 'dur', className: 'dvv-dur' }, `时长 ${fmtTime(doc.duration)}`) : null,
935
+ doc.publishedAt ? h('span', { key: 'when', className: 'dvv-note' }, fmtDate(doc.publishedAt)) : null,
936
+ statBits.length ? h('span', { key: 'stats', className: 'dvv-toolbar-stats' }, statBits) : null,
937
+ h('button', { key: 'toggle', type: 'button', className: 'dvv-meta-toggle', onClick: toggleMeta }, '收起视频信息'),
938
+ ].filter(Boolean),
939
+ ]) : null,
839
940
  ].filter(Boolean));
840
941
  }
841
942
 
@@ -931,6 +1032,87 @@ window.__ModuleLoader__.load({
931
1032
  return h('div', { className: 'dvv-asr-note' }, parts);
932
1033
  }
933
1034
 
1035
+ /* ---------------------------------------------------------- 总结卡片化 */
1036
+
1037
+ /** 把总结 markdown 按 `## 标题` 切成若干段(没有 `##` 时返回空数组,调用方回退整段渲染)。 */
1038
+ function parseSummarySections(text) {
1039
+ const source = String(text ?? '');
1040
+ if (!source.trim()) return [];
1041
+ const sections = [];
1042
+ let current = null;
1043
+ for (const line of source.split('\n')) {
1044
+ const match = /^##\s+(.+?)\s*$/.exec(line);
1045
+ if (match) {
1046
+ if (current) sections.push(current);
1047
+ current = { title: match[1].trim(), lines: [] };
1048
+ } else if (current) {
1049
+ current.lines.push(line);
1050
+ } else if (line.trim()) {
1051
+ current = { title: '', lines: [line] };
1052
+ }
1053
+ }
1054
+ if (current) sections.push(current);
1055
+ return sections
1056
+ .map((section) => ({ title: section.title, body: section.lines.join('\n').trim() }))
1057
+ .filter((section) => section.title || section.body);
1058
+ }
1059
+
1060
+ const SUMMARY_SMALL_SECTIONS = ['核心观点', '适合谁看', '值得记住的说法'];
1061
+ const SUMMARY_FOLDED_SECTIONS = ['内容脉络', '关键要点'];
1062
+
1063
+ /** 卡片化总结:一句话大卡 + 三张小卡 + 可折叠详读。没有 `##` 分段时由调用方回退。 */
1064
+ function SummaryCards({ text, onSeek }) {
1065
+ const sections = parseSummarySections(text);
1066
+ const [expanded, setExpanded] = useState({});
1067
+ const [showAllSmall, setShowAllSmall] = useState(false);
1068
+ if (!sections.length) return null;
1069
+ const matches = (names) => sections.filter((section) => names.some((name) => section.title.includes(name)));
1070
+ const bigSection = sections.find((section) => /一句话|总结/.test(section.title)) || sections[0];
1071
+ const smallSections = matches(SUMMARY_SMALL_SECTIONS);
1072
+ const foldedSections = matches(SUMMARY_FOLDED_SECTIONS);
1073
+ const otherSections = sections.filter((section) => section !== bigSection
1074
+ && !smallSections.includes(section) && !foldedSections.includes(section));
1075
+ const body = (section) => h('div', { className: 'dvv-md dvv-sum-md' }, renderMarkdown(section.body, onSeek));
1076
+ const isOpen = (key, fallback) => (key in expanded ? Boolean(expanded[key]) : Boolean(fallback));
1077
+ const toggle = (key, fallback) => setExpanded((current) => ({ ...current, [key]: !isOpen(key, fallback) }));
1078
+ const parts = [
1079
+ h('div', { key: 'big', className: 'dvv-sum-big' }, [
1080
+ bigSection.title ? h('div', { key: 't', className: 'dvv-sum-big-title' }, bigSection.title === '一句话总结' ? '一句话总结' : bigSection.title) : null,
1081
+ bigSection.body ? body(bigSection) : null,
1082
+ ].filter(Boolean)),
1083
+ ];
1084
+ if (smallSections.length) {
1085
+ parts.push(h('div', { key: 'small', className: 'dvv-sum-cards' }, smallSections.map((section, index) => {
1086
+ const lines = section.body.split('\n').filter((line) => line.trim());
1087
+ const limited = !showAllSmall && lines.length > 6;
1088
+ const shown = limited ? lines.slice(0, 6).join('\n') : section.body;
1089
+ return h('div', { key: `s-${index}`, className: 'dvv-sum-card' }, [
1090
+ h('div', { key: 't', className: 'dvv-sum-card-title' }, section.title || '要点'),
1091
+ h('div', { key: 'b', className: 'dvv-md' }, renderMarkdown(shown, onSeek)),
1092
+ limited ? h('button', {
1093
+ key: 'more', type: 'button', className: 'dvv-btn dvv-btn-mini',
1094
+ onClick: () => setShowAllSmall(true),
1095
+ }, '展开更多') : null,
1096
+ ].filter(Boolean));
1097
+ })));
1098
+ }
1099
+ for (const section of [...foldedSections, ...otherSections]) {
1100
+ const key = section.title || '其他';
1101
+ const defaultOpen = section.title.includes('内容脉络');
1102
+ const open = isOpen(key, defaultOpen);
1103
+ parts.push(h('div', { key: `f-${key}`, className: 'dvv-sum-fold', 'data-open': open ? 'true' : 'false' }, [
1104
+ h('button', {
1105
+ key: 'h', type: 'button', className: 'dvv-sum-fold-head', onClick: () => toggle(key, defaultOpen),
1106
+ }, [
1107
+ h('span', { key: 't', className: 'dvv-sum-fold-title' }, key),
1108
+ h('span', { key: 'x', className: 'dvv-sum-fold-arrow' }, open ? '收起' : '展开'),
1109
+ ]),
1110
+ open ? body(section) : null,
1111
+ ].filter(Boolean)));
1112
+ }
1113
+ return h('div', { className: 'dvv-sum' }, parts);
1114
+ }
1115
+
934
1116
  /* ------------------------------------------------------------------ 总结 */
935
1117
 
936
1118
  function SummaryTab({ doc, summary, job, onRun, onStop, onCopy, onCopyMarkdown, onDownloadMarkdown, onGoSettings, onSeek }) {
@@ -966,13 +1148,17 @@ window.__ModuleLoader__.load({
966
1148
  ]));
967
1149
  }
968
1150
  if (summary.loading && !summary.text) {
969
- parts.push(h('div', { key: 'loading', className: 'dvv-loading-block' }, [h('span', { key: 's', className: 'dvv-spinner' }), summary.phase || '正在生成总结…']));
1151
+ parts.push(h(Skeleton, { key: 'loading', rows: 6, note: summary.phase || '正在生成总结…' }));
970
1152
  }
971
1153
  if (summary.text) {
972
- parts.push(h('div', { key: 'md', className: 'dvv-md dvv-md-wrap' }, [
973
- ...renderMarkdown(summary.text, onSeek),
974
- summary.loading ? h('span', { key: 'caret', className: 'dvv-caret' }) : null,
975
- ].filter(Boolean)));
1154
+ const sections = parseSummarySections(summary.text);
1155
+ parts.push(sections.length
1156
+ ? h(SummaryCards, { key: 'cards', text: summary.text, onSeek })
1157
+ : h('div', { key: 'md', className: 'dvv-md dvv-md-wrap' }, [
1158
+ ...renderMarkdown(summary.text, onSeek),
1159
+ summary.loading ? h('span', { key: 'caret', className: 'dvv-caret' }) : null,
1160
+ ].filter(Boolean)));
1161
+ if (summary.loading) parts.push(h('span', { key: 'caret', className: 'dvv-caret' }));
976
1162
  }
977
1163
  if (summary.loading && summary.text && summary.phase) parts.push(h('div', { key: 'phase', className: 'dvv-note' }, summary.phase));
978
1164
  const actions = [];
@@ -1037,10 +1223,9 @@ window.__ModuleLoader__.load({
1037
1223
  }
1038
1224
 
1039
1225
  function ChaptersTab({ outline, doc, currentSeconds, view, onView, onSeek, onRetry, onGenerate, onCancel, hint, titlesBusy, onGenerateTitles, onGoMindmap }) {
1040
- if (!doc) return h('div', { className: 'dvv-tabpane' }, h('div', { className: 'dvv-empty-note' }, '先解析一个视频,再来看章节。'));
1226
+ if (!doc) return h('div', { className: 'dvv-tabpane' }, h(EmptyState, { title: '先解析一个视频,再来看章节。', note: '在首页粘贴链接,解析完成后这里会列出章节。' }));
1041
1227
  if (outline.loading) {
1042
- return h('div', { className: 'dvv-tabpane' }, h('div', { className: 'dvv-chlist' },
1043
- [0, 1, 2, 3].map((index) => h('div', { key: index, className: 'dvv-skel' }))));
1228
+ return h('div', { className: 'dvv-tabpane' }, h(Skeleton, { rows: 4, note: '正在读取章节…' }));
1044
1229
  }
1045
1230
  const data = outline.data && typeof outline.data === 'object' ? outline.data : {};
1046
1231
  const items = Array.isArray(data.items) ? data.items.filter(Boolean) : [];
@@ -1091,10 +1276,7 @@ window.__ModuleLoader__.load({
1091
1276
  ]));
1092
1277
  }
1093
1278
  if (outline.genError) parts.push(h('div', { key: 'gerr', className: 'dvv-error' }, outline.genError));
1094
- if (outline.error) parts.push(h('div', { key: 'err', className: 'dvv-error' }, [
1095
- h('span', { key: 'm' }, outline.error),
1096
- h('button', { key: 'r', type: 'button', className: 'dvv-btn', onClick: onRetry }, '重试'),
1097
- ]));
1279
+ if (outline.error) parts.push(h(ErrorState, { key: 'err', text: outline.error, onRetry }));
1098
1280
  if (items.length) {
1099
1281
  if (view === 'grid') {
1100
1282
  parts.push(h('div', { key: 'grid', className: 'dvv-kf-grid' }, items.map((item, index) => h(KeyframeCard, { key: `card-${index}`, doc, item, onSeek }))));
@@ -1104,10 +1286,10 @@ window.__ModuleLoader__.load({
1104
1286
  }))));
1105
1287
  }
1106
1288
  } else if (!outline.loading && !outline.error) {
1107
- parts.push(h('div', { key: 'empty', className: 'dvv-notice' }, [
1108
- h('div', { key: 't', className: 'dvv-notice-title' }, '还没有可用的章节'),
1109
- h('div', { key: 'd', className: 'dvv-note' }, '这个视频可能太短,或者还没有字幕可以切分。'),
1110
- ]));
1289
+ parts.push(h(EmptyState, {
1290
+ key: 'empty', title: '还没有可用的章节',
1291
+ note: '这个视频可能太短,或者还没有字幕可以切分。',
1292
+ }));
1111
1293
  }
1112
1294
  return h('div', { className: 'dvv-tabpane' }, parts);
1113
1295
  }
@@ -1147,13 +1329,13 @@ window.__ModuleLoader__.load({
1147
1329
  if (!visible && typeof row.scrollIntoView === 'function') row.scrollIntoView({ block: 'nearest' });
1148
1330
  }, [follow, currentIndex]);
1149
1331
  if (!hasTranscript(doc)) {
1150
- return h('div', { className: 'dvv-tabpane' }, h('div', { className: 'dvv-notice' }, [
1151
- h('div', { key: 't', className: 'dvv-notice-title' }, '这个视频没拿到字幕'),
1152
- h('div', { key: 'd', className: 'dvv-note' }, doc && doc.platform === 'bilibili'
1332
+ return h('div', { className: 'dvv-tabpane' }, h(EmptyState, {
1333
+ title: '这个视频没拿到字幕',
1334
+ note: doc && doc.platform === 'bilibili'
1153
1335
  ? 'B 站要登录 Cookie 才能读 AI 字幕。去「设置」里粘贴 SESSDATA,再重新解析。'
1154
- : 'YouTube 视频可能没有字幕,或作者关闭了自动字幕。'),
1155
- h('div', { key: 'a', className: 'dvv-actions' }, h('button', { type: 'button', className: 'dvv-btn', 'data-primary': 'true', onClick: onGoSettings }, '去设置')),
1156
- ]));
1336
+ : 'YouTube 视频可能没有字幕,或作者关闭了自动字幕。',
1337
+ action: h('div', { className: 'dvv-actions' }, h('button', { type: 'button', className: 'dvv-btn', 'data-primary': 'true', onClick: onGoSettings }, '去设置')),
1338
+ }));
1157
1339
  }
1158
1340
  const keyword = String(query ?? '').trim().toLowerCase();
1159
1341
  const entries = segments.map((segment, index) => {
@@ -1581,22 +1763,18 @@ window.__ModuleLoader__.load({
1581
1763
  ]);
1582
1764
  let body;
1583
1765
  if (mindmap.loading) {
1584
- body = h('div', { key: 'loading', className: 'dvv-loading-block' }, [
1585
- h('span', { key: 's', className: 'dvv-spinner' }),
1586
- h('span', { key: 't' }, '正在生成思维导图…'),
1587
- ]);
1766
+ body = h(Skeleton, { key: 'loading', rows: 5, note: '正在生成思维导图…' });
1588
1767
  } else if (mindmap.error) {
1589
1768
  const canRetry = mindmap.code === 'no-transcript' && doc && !hasTranscript(doc);
1590
- body = h('div', { key: 'error', className: 'dvv-error dvv-mm-error' }, [
1591
- h('div', { key: 'm' }, mindmap.error),
1592
- canRetry ? h('button', {
1593
- key: 'go', type: 'button', className: 'dvv-btn', 'data-primary': 'true', onClick: onGoTranscript,
1594
- }, '本地转写') : null,
1595
- ].filter(Boolean));
1769
+ body = h(ErrorState, {
1770
+ key: 'error', text: mindmap.error,
1771
+ onRetry: canRetry ? onGoTranscript : onRetry,
1772
+ retryLabel: canRetry ? '本地转写' : '重试',
1773
+ });
1596
1774
  } else if (!mindmap.data) {
1597
- body = h('div', { key: 'empty', className: 'dvv-note' }, '还没有生成思维导图。点「重新生成」开始。');
1775
+ body = h(EmptyState, { key: 'empty', title: '还没有生成思维导图', note: '点「重新生成」开始生成。' });
1598
1776
  } else if (!layout || !layout.nodes.length) {
1599
- body = h('div', { key: 'empty', className: 'dvv-note' }, '导图内容是空的。点「重新生成」再试一次。');
1777
+ body = h(EmptyState, { key: 'empty', title: '导图内容是空的', note: '点「重新生成」再试一次。' });
1600
1778
  } else {
1601
1779
  const edges = h('svg', {
1602
1780
  key: 'edges',
@@ -1653,7 +1831,7 @@ window.__ModuleLoader__.load({
1653
1831
  useEffect(() => { setBrokenSheets({}); }, [data && data.generatedAt]);
1654
1832
  if (!doc) {
1655
1833
  return h('div', { className: 'dvv-tabpane dvv-sb-tab' },
1656
- h('div', { className: 'dvv-empty-note' }, '先解析一个视频,再来看它的分镜。'));
1834
+ h(EmptyState, { title: '先解析一个视频,再来看它的分镜。', note: '解析完成后「分镜」页会把整段视频的画面拼成网格。' }));
1657
1835
  }
1658
1836
  const budget = data && data.budget ? data.budget : null;
1659
1837
  const sheets = data
@@ -1693,18 +1871,17 @@ window.__ModuleLoader__.load({
1693
1871
  if (loading) {
1694
1872
  body = h('div', { key: 'progress', className: 'dvv-sb-progress' }, [
1695
1873
  h(AsrProgress, { key: 'progress', percent: storyboard.percent }),
1696
- h('div', { key: 'phase', className: 'dvv-asr-phase' }, storyboard.phase || '正在生成分镜…'),
1874
+ h(Skeleton, { key: 'skel', rows: 4, note: storyboard.phase || '正在生成分镜…' }),
1697
1875
  h('div', { key: 'actions', className: 'dvv-actions' },
1698
1876
  h('button', { key: 'cancel', type: 'button', className: 'dvv-btn', onClick: onCancel }, '取消')),
1699
1877
  ]);
1700
1878
  } else if (error) {
1701
- body = h('div', { key: 'error', className: 'dvv-error' }, [
1702
- h('span', { key: 'text' }, error),
1703
- h('button', { key: 'retry', type: 'button', className: 'dvv-btn', onClick: () => onGenerate() }, '重试'),
1704
- ]);
1879
+ body = h(ErrorState, { key: 'error', text: error, onRetry: () => onGenerate() });
1705
1880
  } else if (!data) {
1706
- body = h('div', { key: 'empty', className: 'dvv-empty-note' },
1707
- '这个视频还没有分镜。点「生成分镜」,把整段视频的画面拼成一张图。');
1881
+ body = h(EmptyState, {
1882
+ key: 'empty', title: '这个视频还没有分镜',
1883
+ note: '点「生成分镜」,把整段视频的画面拼成一张图。',
1884
+ });
1708
1885
  } else {
1709
1886
  const allCells = Array.isArray(data.cells) ? data.cells : [];
1710
1887
  const sheetNodes = sheets.map((sheet, index) => {
@@ -1781,6 +1958,91 @@ window.__ModuleLoader__.load({
1781
1958
  ]);
1782
1959
  }
1783
1960
 
1961
+ /* ------------------------------------------------------ 全局任务条 / 任务抽屉 */
1962
+
1963
+ /** 常驻任务条:有进行中任务才渲染。 */
1964
+ function GlobalJobbar({ jobs, onExpand }) {
1965
+ const list = Array.isArray(jobs) ? jobs : [];
1966
+ const active = list.filter((job) => jobActive(job));
1967
+ if (!active.length) return null;
1968
+ const running = list.find((job) => job && job.status === 'running');
1969
+ const queued = list.filter((job) => job && job.status === 'queued');
1970
+ const finished = Math.max(0, list.length - active.length);
1971
+ const top = running || queued[0] || active[0];
1972
+ const stage = top && top.status === 'queued' ? '排队中' : jobStageText(top);
1973
+ const percent = top && top.status === 'running' ? ` ${jobPercent(top)}%` : '';
1974
+ return h('div', { className: 'dvv-jobbar-global', role: 'status' }, [
1975
+ h('span', { key: 'dot', className: 'dvv-jobbar-global-dot', 'aria-hidden': 'true' }),
1976
+ h('span', { key: 't', className: 'dvv-jobbar-global-text' }, `解析队列 ${finished}/${list.length}`),
1977
+ h('span', { key: 's', className: 'dvv-jobbar-global-stage' }, `· ${stage}${percent}`),
1978
+ h('div', { key: 'sp', className: 'dvv-spacer' }),
1979
+ h('button', { key: 'open', type: 'button', className: 'dvv-btn dvv-btn-mini', onClick: onExpand }, '展开'),
1980
+ ].filter(Boolean));
1981
+ }
1982
+
1983
+ /** 任务抽屉:运行中 / 排队中 / 最近完成。 */
1984
+ function JobDrawer({ jobs, onCancel, onRetry, onOpen, onClearDone, onClose }) {
1985
+ const list = Array.isArray(jobs) ? jobs : [];
1986
+ const running = list.filter((job) => job && job.status === 'running');
1987
+ const queued = list.filter((job) => job && job.status === 'queued');
1988
+ const recent = list.filter((job) => job && (job.status === 'done' || job.status === 'failed')).slice(0, 8);
1989
+ const row = (job, index) => h('div', {
1990
+ key: `${job.id || job.docId || 'job'}-${index}`,
1991
+ className: 'dvv-jd-row',
1992
+ 'data-status': String(job.status || ''),
1993
+ }, [
1994
+ h('div', { key: 'main', className: 'dvv-jd-main' }, [
1995
+ h('div', { key: 't', className: 'dvv-jd-title', title: String(job.title || '') }, job.title || job.docId || '未命名视频'),
1996
+ h('div', { key: 's', className: 'dvv-jd-sub' }, job.status === 'failed'
1997
+ ? `解析失败:${String(job.error || '未知错误')}`
1998
+ : `${jobStageText(job)}${job.status === 'running' ? ` · ${jobPercent(job)}%` : ''}`),
1999
+ jobActive(job) ? h('div', { key: 'bar', className: 'dvv-jobbar', 'data-queued': job.status === 'queued' ? 'true' : undefined },
2000
+ h('div', { key: 'fill', className: 'dvv-jobbar-fill', style: { width: `${jobPercent(job)}%` } })) : null,
2001
+ ].filter(Boolean)),
2002
+ h('div', { key: 'actions', className: 'dvv-jd-actions' }, [
2003
+ jobActive(job) ? h('button', {
2004
+ key: 'cancel', type: 'button', className: 'dvv-btn dvv-btn-mini', onClick: () => onCancel(job),
2005
+ }, '取消') : null,
2006
+ job.status === 'failed' ? h('button', {
2007
+ key: 'retry', type: 'button', className: 'dvv-btn dvv-btn-mini', onClick: () => onRetry(job),
2008
+ }, '重试') : null,
2009
+ job.status === 'done' ? h('button', {
2010
+ key: 'open', type: 'button', className: 'dvv-btn dvv-btn-mini', onClick: () => onOpen(job),
2011
+ }, '打开') : null,
2012
+ ].filter(Boolean)),
2013
+ ].filter(Boolean));
2014
+ const section = (key, title, items) => (items.length
2015
+ ? h('div', { key, className: 'dvv-jd-section' }, [
2016
+ h('div', { key: 'h', className: 'dvv-jd-head' }, `${title} · ${items.length}`),
2017
+ ...items.map((job, index) => row(job, index)),
2018
+ ])
2019
+ : null);
2020
+ return h('div', { className: 'dvv-overlay', 'data-quiet': 'true', onClick: onClose }, h('div', {
2021
+ key: 'drawer', className: 'dvv-drawer dvv-job-drawer',
2022
+ onClick: (event) => { if (event && typeof event.stopPropagation === 'function') event.stopPropagation(); },
2023
+ }, [
2024
+ h('div', { key: 'head', className: 'dvv-drawer-head' }, [
2025
+ h('div', { key: 't', className: 'dvv-drawer-title' }, '解析队列'),
2026
+ h('span', { key: 'n', className: 'dvv-note' }, `${running.length} 个进行中 · ${queued.length} 个排队`),
2027
+ h('button', { key: 'close', type: 'button', className: 'dvv-btn', onClick: onClose }, '关闭'),
2028
+ ]),
2029
+ h('div', { key: 'body', className: 'dvv-drawer-body' }, [
2030
+ section('running', '运行中', running),
2031
+ section('queued', '排队中', queued),
2032
+ section('recent', '最近完成', recent),
2033
+ (!running.length && !queued.length && !recent.length)
2034
+ ? h('div', { key: 'empty', className: 'dvv-empty-note' }, '目前没有后台任务。在首页或历史里重新解析视频即可开始。')
2035
+ : null,
2036
+ ].filter(Boolean)),
2037
+ h('div', { key: 'foot', className: 'dvv-drawer-foot' }, [
2038
+ h('button', {
2039
+ key: 'clear', type: 'button', className: 'dvv-btn', disabled: !recent.length,
2040
+ onClick: onClearDone,
2041
+ }, '清除已完成'),
2042
+ ]),
2043
+ ]));
2044
+ }
2045
+
1784
2046
  /* ---------------------------------------------------------- 历史列表 / 抽屉 */
1785
2047
 
1786
2048
  /** 封面缩略图:没有 cover 或加载失败时用纯色占位。 */
@@ -1863,6 +2125,97 @@ window.__ModuleLoader__.load({
1863
2125
  ].filter(Boolean));
1864
2126
  }
1865
2127
 
2128
+ /** 首页卡片流里的一张最近分析卡:封面/时长、标题、作者时间、状态徽标、任务进度与快捷操作。 */
2129
+ function HistoryCard({ item, job, onOpen, onRemove, onFavorite, onCancelJob }) {
2130
+ const platform = item.platform || guessPlatform(item.url);
2131
+ const duration = Number(item.duration) > 0 ? fmtTime(item.duration) : '';
2132
+ const [menu, setMenu] = useState(false);
2133
+ const stop = (event) => { if (event && typeof event.stopPropagation === 'function') event.stopPropagation(); };
2134
+ const open = () => onOpen(item);
2135
+ return h('article', {
2136
+ className: 'dvv-vcard', role: 'button', tabIndex: 0,
2137
+ 'data-doc': item.docId || '', title: item.title || '',
2138
+ onClick: open,
2139
+ onKeyDown: (event) => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); open(); } },
2140
+ }, [
2141
+ h('div', { key: 'cover', className: 'dvv-vcard-cover' }, [
2142
+ h(HistoryCover, { key: 'img', src: item.cover, alt: item.title }),
2143
+ duration ? h('span', { key: 'dur', className: 'dvv-vcard-dur' }, duration) : null,
2144
+ h('span', { key: 'plat', className: 'dvv-vcard-plat' }, h(PlatformBadge, { platform, compact: true })),
2145
+ ]),
2146
+ h('div', { key: 'body', className: 'dvv-vcard-body' }, [
2147
+ h('div', { key: 'title', className: 'dvv-vcard-title', title: item.title || '' }, item.title || '(无标题视频)'),
2148
+ h('div', { key: 'sub', className: 'dvv-vcard-sub' }, [
2149
+ item.author ? h('span', { key: 'author' }, item.author) : null,
2150
+ h('span', { key: 'when' }, fmtRelative(item.analyzedAt)),
2151
+ ].filter(Boolean)),
2152
+ h('div', { key: 'badges', className: 'dvv-vcard-badges' }, [
2153
+ item.hasSummary ? h('span', { key: 'sum', className: 'dvv-mini' }, '总结') : null,
2154
+ item.hasChapters ? h('span', { key: 'ch', className: 'dvv-mini' }, '章节') : null,
2155
+ item.hasMindmap ? h('span', { key: 'mm', className: 'dvv-mini' }, '导图') : null,
2156
+ h('span', { key: 'cap', className: 'dvv-mini', 'data-ok': item.hasTranscript ? 'true' : 'false' }, item.hasTranscript ? '字幕' : '无字幕'),
2157
+ ].filter(Boolean)),
2158
+ ]),
2159
+ job && jobActive(job) ? h('div', {
2160
+ key: 'job', className: 'dvv-job dvv-vcard-job', onClick: stop,
2161
+ }, [
2162
+ h('div', { key: 'bar', className: 'dvv-jobbar', 'data-queued': job.status === 'queued' ? 'true' : undefined },
2163
+ h('div', { key: 'fill', className: 'dvv-jobbar-fill', style: { width: `${jobPercent(job)}%` } })),
2164
+ h('span', { key: 'label', className: 'dvv-job-label' }, job.status === 'queued' ? '排队中…' : `${jobPercent(job)}% · ${jobStageText(job)}`),
2165
+ onCancelJob ? h('button', {
2166
+ key: 'cancel', type: 'button', className: 'dvv-del', title: '取消后台解析', 'aria-label': '取消后台解析',
2167
+ onClick: (event) => { stop(event); onCancelJob(job); },
2168
+ }, '×') : null,
2169
+ ]) : (job && job.status === 'failed'
2170
+ ? h('span', { key: 'jobfail', className: 'dvv-job-failed', title: String(job.error || '') }, '解析失败')
2171
+ : null),
2172
+ h('div', { key: 'actions', className: 'dvv-vcard-actions' }, [
2173
+ onFavorite ? h('button', {
2174
+ key: 'fav', type: 'button', className: 'dvv-fav', 'data-on': item.favorite ? 'true' : 'false',
2175
+ title: item.favorite ? '取消收藏' : '收藏', 'aria-label': item.favorite ? '取消收藏' : '收藏',
2176
+ onClick: (event) => { stop(event); onFavorite(item); },
2177
+ }, item.favorite ? '★' : '☆') : null,
2178
+ h('button', {
2179
+ key: 'more', type: 'button', className: 'dvv-vcard-more', title: '更多操作', 'aria-label': '更多操作',
2180
+ onClick: (event) => { stop(event); setMenu((value) => !value); },
2181
+ }, '⋯'),
2182
+ menu ? h('div', { key: 'menu', className: 'dvv-vcard-menu', onClick: stop }, [
2183
+ h('button', { key: 're', type: 'button', className: 'dvv-vcard-mi', onClick: () => { setMenu(false); open(); } }, '重新解析'),
2184
+ h('button', { key: 'cp', type: 'button', className: 'dvv-vcard-mi', onClick: () => { setMenu(false); void copyText(String(item.url || ''), '已复制链接'); } }, '复制链接'),
2185
+ onFavorite ? h('button', { key: 'fv', type: 'button', className: 'dvv-vcard-mi', onClick: () => { setMenu(false); onFavorite(item); } }, item.favorite ? '取消收藏' : '收藏') : null,
2186
+ onRemove ? h('button', { key: 'rm', type: 'button', className: 'dvv-vcard-mi', onClick: () => { setMenu(false); onRemove(item); } }, '删除') : null,
2187
+ ].filter(Boolean)) : null,
2188
+ ]),
2189
+ ].filter(Boolean));
2190
+ }
2191
+
2192
+ /** 首页「最近分析」卡片流:最多 10 张,更多去历史抽屉。 */
2193
+ function HistoryCards({ items, jobs, activeCount, parseAllBusy, parseAllConfirm, onOpen, onRemove, onFavorite, onOpenAll, onCancelJob, onParseAll }) {
2194
+ const all = Array.isArray(items) ? items : [];
2195
+ if (!all.length) return null;
2196
+ const shown = all.slice(0, HOME_RECENT_LIMIT);
2197
+ return h('section', { className: 'dvv-recent dvv-recent-cards dvv-home-recent' }, [
2198
+ h('div', { key: 'head', className: 'dvv-recent-head' }, [
2199
+ h('span', { key: 't', className: 'dvv-label' }, '最近分析'),
2200
+ h('span', { key: 'c', className: 'dvv-note' }, `共 ${all.length} 条 · 最多保留 ${HISTORY_LIMIT} 条`),
2201
+ h('div', { key: 's', className: 'dvv-spacer' }),
2202
+ onParseAll ? h('button', {
2203
+ key: 'parseAll', type: 'button', className: 'dvv-btn dvv-btn-mini',
2204
+ 'data-danger': parseAllConfirm ? 'true' : undefined, disabled: Boolean(parseAllBusy),
2205
+ onClick: () => onParseAll(),
2206
+ }, parseAllConfirm ? '确认解析?' : (Number(activeCount) > 0 ? `解析中 ${Number(activeCount)}` : '全部解析')) : null,
2207
+ all.length > HOME_RECENT_LIMIT && onOpenAll
2208
+ ? h('button', { key: 'more', type: 'button', className: 'dvv-btn dvv-btn-mini', onClick: onOpenAll }, '打开历史查看全部')
2209
+ : null,
2210
+ ].filter(Boolean)),
2211
+ h('div', { key: 'grid', className: 'dvv-cards-grid' }, shown.map((item, index) => h(HistoryCard, {
2212
+ key: `${item.docId || item.url || 'item'}-${index}`, item,
2213
+ job: jobs && typeof jobs.get === 'function' ? jobs.get(item.docId) : null,
2214
+ onOpen, onRemove, onFavorite, onCancelJob,
2215
+ }))),
2216
+ ]);
2217
+ }
2218
+
1866
2219
  /** 无视频空态时直接铺在主区的历史列表:只展示前 10 条,更多去抽屉。 */
1867
2220
  function HistoryList({ items, jobs, activeCount, parseAllBusy, parseAllConfirm, onOpen, onRemove, onFavorite, onOpenAll, onCancelJob, onParseAll }) {
1868
2221
  const all = Array.isArray(items) ? items : [];
@@ -3158,6 +3511,32 @@ window.__ModuleLoader__.load({
3158
3511
  }
3159
3512
  }, [refreshJobs, showToast]);
3160
3513
 
3514
+ /** 任务抽屉「重试」:把失败的 docId 重新入队。 */
3515
+ const retryJob = useCallback(async (job) => {
3516
+ const docId = String((job && job.docId) || '');
3517
+ if (!docId) { showToast('这条任务缺少 docId,无法重试'); return; }
3518
+ try {
3519
+ await post('jobs', { docId, describe: true });
3520
+ if (!mounted.current) return;
3521
+ showToast('已重新加入解析队列');
3522
+ void refreshJobs();
3523
+ } catch (caught) {
3524
+ if (mounted.current) showToast(`重试失败:${String(caught?.message ?? caught)}`);
3525
+ }
3526
+ }, [refreshJobs, showToast]);
3527
+
3528
+ /** 任务抽屉「清除已完成」。 */
3529
+ const clearDoneJobs = useCallback(async () => {
3530
+ try {
3531
+ await post('jobs/clear', {});
3532
+ if (!mounted.current) return;
3533
+ showToast('已清除已完成任务');
3534
+ void refreshJobs();
3535
+ } catch (caught) {
3536
+ if (mounted.current) showToast(`清除失败:${String(caught?.message ?? caught)}`);
3537
+ }
3538
+ }, [refreshJobs, showToast]);
3539
+
3161
3540
  /** 首页「全部解析」:第一次点击进入确认,第二次才真正提交。 */
3162
3541
  const parseAllJobs = useCallback(async () => {
3163
3542
  if (parseAllBusy) return;
@@ -3567,6 +3946,8 @@ window.__ModuleLoader__.load({
3567
3946
  void copy(lines.join('\n'), `已复制 ${items.length} 条字幕`);
3568
3947
  };
3569
3948
 
3949
+ const jobList = Array.isArray(jobs.jobs) ? jobs.jobs.filter(Boolean) : [];
3950
+ const jobActiveCount = jobList.filter((job) => jobActive(job)).length;
3570
3951
  const jobsByDoc = buildJobsByDoc(jobs.jobs);
3571
3952
  const currentJob = doc ? jobsByDoc.get(doc.docId) : null;
3572
3953
  const jobsActiveCount = Number(jobs.active) > 0 ? Number(jobs.active) : Array.from(jobsByDoc.values()).filter(jobActive).length;
@@ -3673,6 +4054,34 @@ window.__ModuleLoader__.load({
3673
4054
  try { getLayoutService()?.selectPanel(null); } catch { /* 服务不可用:按钮已隐藏 */ }
3674
4055
  };
3675
4056
 
4057
+ /** 页签状态点:ready(有内容)/ loading(后台在跑且未生成)/ empty(还没生成)。 */
4058
+ const tabDotState = (id) => {
4059
+ const jobRunning = Boolean(currentJob && jobActive(currentJob));
4060
+ if (id === 'summary') {
4061
+ if (summary.text) return 'ready';
4062
+ return summary.loading || jobRunning ? 'loading' : 'empty';
4063
+ }
4064
+ if (id === 'chapters') {
4065
+ const items = outline.data && Array.isArray(outline.data.items) ? outline.data.items : [];
4066
+ if (items.length) return 'ready';
4067
+ return outline.loading || jobRunning ? 'loading' : 'empty';
4068
+ }
4069
+ if (id === 'transcript') {
4070
+ if (hasTranscript(doc)) return 'ready';
4071
+ return transcribe.loading || jobRunning ? 'loading' : 'empty';
4072
+ }
4073
+ if (id === 'storyboard') {
4074
+ const cells = storyboard.data && Array.isArray(storyboard.data.cells) ? storyboard.data.cells : [];
4075
+ if (cells.length) return 'ready';
4076
+ return storyboard.loading || jobRunning ? 'loading' : 'empty';
4077
+ }
4078
+ if (id === 'mindmap') {
4079
+ if (mindmap.data) return 'ready';
4080
+ return mindmap.loading || jobRunning ? 'loading' : 'empty';
4081
+ }
4082
+ return 'empty';
4083
+ };
4084
+
3676
4085
  const banners = [];
3677
4086
  if (error) banners.push(h('div', { key: 'error', className: 'dvv-error' }, error));
3678
4087
  if (resolveBusy) {
@@ -3688,10 +4097,11 @@ window.__ModuleLoader__.load({
3688
4097
  biliReady: Boolean(status && status.bilibili && status.bilibili.cookie),
3689
4098
  onUrl: setUrl,
3690
4099
  onSubmit: () => { void resolve(url); },
4100
+ onExample: (link) => { setUrl(link); void resolve(link); },
3691
4101
  onGoSettings: openSettings,
3692
4102
  }),
3693
4103
  historyItems.length
3694
- ? h('div', { key: 'recent', className: 'dvv-home-recent' }, h(HistoryList, {
4104
+ ? h('div', { key: 'recent', className: 'dvv-home-recent' }, h(HistoryCards, {
3695
4105
  items: historyItems, jobs: jobsByDoc, activeCount: jobsActiveCount,
3696
4106
  parseAllBusy, parseAllConfirm,
3697
4107
  onOpen: openHistoryItem,
@@ -3727,7 +4137,10 @@ window.__ModuleLoader__.load({
3727
4137
  }),
3728
4138
  h('div', { key: 'tabs', className: 'dvv-tabbar' }, TABS.map(([id, label]) => h('button', {
3729
4139
  key: id, type: 'button', className: 'dvv-tab', 'data-active': tab === id ? 'true' : undefined, onClick: () => setTab(id),
3730
- }, label))),
4140
+ }, [
4141
+ h('span', { key: 'l', className: 'dvv-tab-label' }, label),
4142
+ h('span', { key: 'd', className: 'dvv-tab-dot', 'data-state': tabDotState(id), 'aria-hidden': 'true' }),
4143
+ ]))),
3731
4144
  h('div', { key: 'pane', className: 'dvv-pane' }, tabBody),
3732
4145
  ]),
3733
4146
  ]);
@@ -3737,6 +4150,18 @@ window.__ModuleLoader__.load({
3737
4150
  h(VideoToolbar, {
3738
4151
  key: 'toolbar', doc, job: currentJob, historyCount: historyItems.length, canGoBack, onBack: goBack,
3739
4152
  onCancelJob: (job) => { void cancelJob(job); },
4153
+ onRegenerate: (kind) => {
4154
+ const target = docRef.current;
4155
+ if (!target) return;
4156
+ if (kind === 'summary') void runSummary(target);
4157
+ else if (kind === 'mindmap') void loadMindmap(target, true);
4158
+ else if (kind === 'storyboard') void loadStoryboard(target, { force: true, describe: sbDescribe });
4159
+ },
4160
+ onExport: (kind) => {
4161
+ if (kind === 'markdown') void copyMarkdown();
4162
+ else if (kind === 'download') downloadMarkdown();
4163
+ else if (kind === 'fulltext') copyAllSegments(transcriptSegments(doc));
4164
+ },
3740
4165
  onHistory: () => setOverlay(overlay === 'history' ? '' : 'history'),
3741
4166
  onSettings: () => {
3742
4167
  if (overlay === 'settings') { setOverlay(''); return; }
@@ -3753,6 +4178,9 @@ window.__ModuleLoader__.load({
3753
4178
  }),
3754
4179
  h('button', { key: 'go', type: 'button', className: 'dvv-btn', 'data-primary': 'true', disabled: resolveBusy, onClick: () => { void resolve(url); } }, resolveBusy ? '解析中…' : '解析'),
3755
4180
  ]) : null,
4181
+ jobActiveCount > 0 ? h(GlobalJobbar, {
4182
+ key: 'jobbar', jobs: jobList, onExpand: () => setOverlay(overlay === 'jobs' ? '' : 'jobs'),
4183
+ }) : null,
3756
4184
  banners.length ? h('div', { key: 'banners', className: 'dvv-banners' }, banners) : null,
3757
4185
  body,
3758
4186
  overlay === 'history' ? h(HistoryDrawer, {
@@ -3767,6 +4195,19 @@ window.__ModuleLoader__.load({
3767
4195
  onClear: () => { void clearHistory(); },
3768
4196
  onClose: () => setOverlay(''),
3769
4197
  }) : null,
4198
+ overlay === 'jobs' ? h(JobDrawer, {
4199
+ key: 'jobdrawer', jobs: jobList,
4200
+ onCancel: (job) => { void cancelJob(job); },
4201
+ onRetry: (job) => { void retryJob(job); },
4202
+ onOpen: (job) => {
4203
+ setOverlay('');
4204
+ const item = historyItems.find((entry) => entry.docId === job.docId)
4205
+ || { docId: job.docId, url: job.url, title: job.title };
4206
+ openHistoryItem(item);
4207
+ },
4208
+ onClearDone: () => { void clearDoneJobs(); },
4209
+ onClose: () => setOverlay(''),
4210
+ }) : null,
3770
4211
  overlay === 'settings' ? h(SettingsModal, {
3771
4212
  key: 'modal', status, cookie, saving: savingCookie, note: cookieNote,
3772
4213
  onCookie: (value) => setCookie(value),
@@ -3789,17 +4230,28 @@ window.__ModuleLoader__.load({
3789
4230
  const CSS = `
3790
4231
  .dvv-root{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;background:var(--dsw-alias-bg-base,Canvas);color:var(--dsw-alias-label-primary,CanvasText)}
3791
4232
  /* 顶部紧凑工具栏 */
3792
- .dvv-toolbar{flex:none;display:flex;align-items:center;gap:10px;padding:10px 18px 8px;border-bottom:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.08))}
4233
+ .dvv-toolbar{flex:none;display:flex;flex-direction:column;gap:4px;padding:8px 18px 6px;border-bottom:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.08))}
4234
+ .dvv-toolbar-row{display:flex;align-items:center;gap:10px;min-width:0}
3793
4235
  .dvv-back{flex:none}
3794
- .dvv-toolbar-cover{flex:none;width:72px}
3795
- .dvv-toolbar-cover .dvv-cover{width:72px;border-radius:8px}
4236
+ .dvv-toolbar-cover{flex:none;width:56px}
4237
+ .dvv-toolbar-cover .dvv-cover{width:56px;aspect-ratio:16/9;border-radius:6px;object-fit:cover}
3796
4238
  .dvv-toolbar-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
3797
- .dvv-toolbar-title{font-size:14px;line-height:20px;font-weight:650;color:var(--dsw-alias-label-primary,inherit);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
4239
+ .dvv-toolbar-title{font-size:14px;line-height:20px;font-weight:650;color:var(--dsw-alias-label-primary,inherit);text-decoration:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-all}
4240
+ .dvv-toolbar-title-plain{font-size:14px;line-height:20px;font-weight:650}
3798
4241
  a.dvv-toolbar-title:hover{color:var(--dsw-alias-brand-primary)}
3799
4242
  .dvv-toolbar-sub{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,CanvasText)}
3800
4243
  .dvv-toolbar-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,CanvasText)}
3801
4244
  .dvv-toolbar-stats{font-variant-numeric:tabular-nums}
3802
- .dvv-toolbar-actions{flex:none;display:flex;gap:8px}
4245
+ .dvv-toolbar-actions{flex:none;display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
4246
+ .dvv-toolbar-author{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
4247
+ .dvv-meta{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:1px 0 2px 66px;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
4248
+ .dvv-meta[data-collapsed="true"]{padding-left:66px}
4249
+ .dvv-meta-toggle{appearance:none;border:none;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;line-height:16px;padding:0 2px;cursor:pointer;text-decoration:underline;text-underline-offset:2px}
4250
+ .dvv-meta-toggle:hover{color:var(--dsw-alias-brand-primary)}
4251
+ .dvv-menu{position:relative}
4252
+ .dvv-menu-pop{position:absolute;right:0;top:calc(100% + 4px);z-index:30;min-width:160px;display:flex;flex-direction:column;padding:4px;border-radius:10px;border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.12));background:var(--dsw-alias-bg-overlay,#fff);box-shadow:0 8px 24px rgba(0,0,0,.16)}
4253
+ .dvv-menu-item{appearance:none;border:none;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;line-height:18px;text-align:left;padding:6px 10px;border-radius:6px;cursor:pointer}
4254
+ .dvv-menu-item:hover{background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.14))}
3803
4255
  .dvv-btn{appearance:none;border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.14));background:transparent;color:var(--dsw-alias-label-primary,inherit);font:inherit;font-size:12px;line-height:22px;padding:2px 12px;border-radius:999px;cursor:pointer;white-space:nowrap}
3804
4256
  .dvv-btn:hover{background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.14))}
3805
4257
  .dvv-btn[data-primary="true"]{background:var(--dsw-alias-brand-primary);border-color:transparent;color:var(--dsw-alias-bg-base,Canvas);font-weight:600}
@@ -3826,17 +4278,43 @@ a.dvv-toolbar-title:hover{color:var(--dsw-alias-brand-primary)}
3826
4278
  .dvv-warn{display:flex;gap:8px;align-items:flex-start;font-size:12px;line-height:19px;color:var(--dsw-alias-state-warn-primary);background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.1));border-left:3px solid var(--dsw-alias-state-warn-primary);border-radius:8px;padding:8px 12px;margin:8px 0}
3827
4279
  .dvv-spacer{flex:1}
3828
4280
  .dvv-note{font-size:12px;line-height:19px;color:var(--dsw-alias-label-secondary)}
3829
- .dvv-home{flex:none;display:flex;flex-direction:column;gap:16px;width:100%;max-width:760px;margin:0 auto;padding:5vh 18px 10px}
3830
- .dvv-home-hero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px}
3831
- .dvv-home-title{margin:0;font-size:26px;line-height:34px;font-weight:700;letter-spacing:-.4px;color:var(--dsw-alias-label-primary,inherit)}
3832
- .dvv-home-sub{margin:0;max-width:560px;font-size:13px;line-height:21px;color:var(--dsw-alias-label-secondary)}
3833
- .dvv-home-form{display:flex;gap:10px;width:100%;max-width:640px;margin-top:6px}
4281
+ .dvv-home{flex:none;display:flex;flex-direction:column;gap:14px;width:100%;max-width:820px;margin:0 auto;padding:3.5vh 18px 10px}
4282
+ .dvv-home-hero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:9px}
4283
+ .dvv-home-title{margin:0;font-size:21px;line-height:28px;font-weight:700;letter-spacing:-.2px;color:var(--dsw-alias-label-primary,inherit)}
4284
+ .dvv-home-sub{margin:0;max-width:560px;font-size:13px;line-height:20px;font-weight:400;color:var(--dsw-alias-label-secondary)}
4285
+ .dvv-home-chips{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;max-width:600px;margin-top:1px}
4286
+ .dvv-home-chip{appearance:none;font:inherit;font-size:12px;line-height:18px;padding:5px 12px;border-radius:999px;cursor:pointer;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1,transparent);border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.12));transition:border-color .15s ease,background .15s ease}
4287
+ .dvv-home-chip:hover{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.1))}
4288
+ .dvv-home-chip:disabled{opacity:.55;cursor:not-allowed}
4289
+ .dvv-home-tip{flex:none;font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary);opacity:.7;margin-left:2px}
4290
+ .dvv-home-form{display:flex;gap:8px;width:100%;max-width:560px;margin-top:3px}
3834
4291
  .dvv-home-input{flex:1;min-width:0;font:inherit;font-size:14px;line-height:26px;padding:9px 18px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.14));background:var(--dsw-alias-bg-layer-1,transparent);color:inherit;outline:none;transition:border-color .15s ease,box-shadow .15s ease}
3835
4292
  .dvv-home-input:focus{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-brand-primary) 16%,transparent)}
3836
4293
  .dvv-home-btn{flex:none;padding:0 22px;border-radius:999px;font-size:13px}
3837
4294
  .dvv-home-hint{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;font-size:12px;line-height:19px;color:var(--dsw-alias-label-secondary)}
3838
4295
  .dvv-btn-mini{padding:0 10px;line-height:22px;font-size:12px;border-radius:999px}
3839
- .dvv-home-recent{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;width:100%;max-width:640px;margin:10px auto 0;padding:0 2px 18px}
4296
+ .dvv-home-recent{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;width:100%;max-width:960px;margin:8px auto 0;padding:0 2px 12px}
4297
+ .dvv-recent-cards .dvv-recent-head{justify-content:flex-start}
4298
+ .dvv-cards-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(196px,1fr));gap:12px}
4299
+ @media (min-width:820px){.dvv-cards-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
4300
+ .dvv-vcard{position:relative;display:flex;flex-direction:column;min-width:0;border-radius:12px;border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.1));background:var(--dsw-alias-bg-layer-1,transparent);cursor:pointer;overflow:hidden;transition:border-color .15s ease,transform .12s ease}
4301
+ .dvv-vcard:hover{border-color:var(--dsw-alias-brand-primary);transform:translateY(-1px)}
4302
+ .dvv-vcard-cover{position:relative;aspect-ratio:16/9;background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.12));overflow:hidden}
4303
+ .dvv-vcard-cover .dvv-hist-cover{width:100%;height:100%;aspect-ratio:auto;border-radius:0;object-fit:cover}
4304
+ .dvv-vcard-dur{position:absolute;right:6px;bottom:6px;padding:1px 6px;border-radius:5px;background:var(--dsw-alias-bg-overlay,rgba(0,0,0,.55));color:var(--dsw-alias-label-primary);font-size:10px;line-height:15px;font-variant-numeric:tabular-nums}
4305
+ .dvv-vcard-plat{position:absolute;left:6px;top:6px}
4306
+ .dvv-vcard-body{display:flex;flex-direction:column;gap:4px;padding:8px 10px 6px;min-width:0}
4307
+ .dvv-vcard-title{font-size:13px;line-height:19px;font-weight:600;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-all}
4308
+ .dvv-vcard-sub{display:flex;flex-wrap:wrap;gap:8px;font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary)}
4309
+ .dvv-vcard-badges{display:flex;flex-wrap:wrap;gap:6px;margin-top:1px}
4310
+ .dvv-vcard-job{padding:0 10px 8px}
4311
+ .dvv-vcard .dvv-job-failed{display:block;padding:0 10px 8px}
4312
+ .dvv-vcard-actions{position:absolute;right:6px;top:6px;display:flex;align-items:center;gap:4px;opacity:0;transition:opacity .15s ease}
4313
+ .dvv-vcard:hover .dvv-vcard-actions,.dvv-vcard:focus-within .dvv-vcard-actions{opacity:1}
4314
+ .dvv-vcard-more{width:22px;height:22px;border-radius:50%;border:none;padding:0;line-height:20px;text-align:center;cursor:pointer;background:var(--dsw-alias-bg-overlay,rgba(0,0,0,.5));color:var(--dsw-alias-label-primary);font-size:14px}
4315
+ .dvv-vcard-menu{position:absolute;right:0;top:26px;z-index:25;display:flex;flex-direction:column;min-width:132px;padding:4px;border-radius:10px;border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.12));background:var(--dsw-alias-bg-overlay,#fff);box-shadow:0 8px 24px rgba(0,0,0,.18)}
4316
+ .dvv-vcard-mi{appearance:none;border:none;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;line-height:18px;text-align:left;padding:6px 10px;border-radius:6px;cursor:pointer;white-space:nowrap}
4317
+ .dvv-vcard-mi:hover{background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.14))}
3840
4318
  .dvv-home-none{flex:none;width:100%;max-width:640px;margin:14px auto 0;padding:18px 0;text-align:center;font-size:12px;color:var(--dsw-alias-label-secondary)}
3841
4319
  .dvv-cover{flex:none;width:212px;aspect-ratio:16/9;border-radius:10px;overflow:hidden;background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.12))}
3842
4320
  .dvv-cover img{display:block;width:100%;height:100%;object-fit:cover}
@@ -3850,6 +4328,11 @@ a.dvv-toolbar-title:hover{color:var(--dsw-alias-brand-primary)}
3850
4328
  .dvv-tab{appearance:none;border:none;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:24px;padding:3px 14px;border-radius:999px;cursor:pointer}
3851
4329
  .dvv-tab:hover{background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.12));color:var(--dsw-alias-label-primary)}
3852
4330
  .dvv-tab[data-active="true"]{background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.16));color:var(--dsw-alias-label-primary);font-weight:600}
4331
+ .dvv-tab{display:inline-flex;align-items:center;gap:6px}
4332
+ .dvv-tab-dot{width:6px;height:6px;border-radius:50%;flex:none;background:var(--dsw-alias-label-secondary);opacity:.35}
4333
+ .dvv-tab-dot[data-state="ready"]{background:var(--dsw-alias-brand-primary);opacity:1}
4334
+ .dvv-tab-dot[data-state="loading"]{background:var(--dsw-alias-brand-primary);opacity:.9;animation:dvv-pulse 1.1s ease-in-out infinite}
4335
+ @keyframes dvv-pulse{0%,100%{transform:scale(1);opacity:.45}50%{transform:scale(1.35);opacity:1}}
3853
4336
  .dvv-tabpane{padding-top:8px}
3854
4337
  .dvv-pane{flex:1;min-height:0;overflow:auto;padding:4px 0 8px}
3855
4338
  .dvv-md{font-size:13.5px;line-height:24px;color:var(--dsw-alias-label-primary,inherit)}
@@ -3875,7 +4358,29 @@ a.dvv-toolbar-title:hover{color:var(--dsw-alias-brand-primary)}
3875
4358
  .dvv-spinner{display:inline-block;width:12px;height:12px;border-radius:50%;border:2px solid var(--dsw-alias-border-l2,rgba(127,127,127,.35));border-top-color:var(--dsw-alias-brand-primary);animation:dvv-spin .8s linear infinite}
3876
4359
  @keyframes dvv-spin{to{transform:rotate(360deg)}}
3877
4360
  .dvv-notice{border:1px dashed var(--dsw-alias-border-l1,rgba(0,0,0,.14));border-radius:10px;padding:12px 14px;margin:8px 0}
4361
+ .dvv-state{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:18px 16px;margin:8px 0;border:1px dashed var(--dsw-alias-border-l1,rgba(0,0,0,.14));border-radius:12px}
4362
+ .dvv-state-title{font-size:13px;line-height:20px;font-weight:600;color:var(--dsw-alias-label-primary)}
4363
+ .dvv-state-note{font-size:12px;line-height:19px;color:var(--dsw-alias-label-secondary)}
4364
+ .dvv-state-error{border-color:var(--dsw-alias-state-error-primary,var(--dsw-alias-border-l1))}
4365
+ .dvv-state-error .dvv-state-title{color:var(--dsw-alias-state-error-primary,inherit)}
4366
+ .dvv-state-loading{gap:6px;border-style:solid}
4367
+ .dvv-skel-lines{display:flex;flex-direction:column;gap:8px;width:100%}
4368
+ .dvv-state-loading .dvv-skel{height:14px;border-radius:6px;margin:0}
3878
4369
  .dvv-notice-title{font-size:13px;line-height:20px;font-weight:600;margin-bottom:4px}
4370
+ .dvv-sum{display:flex;flex-direction:column;gap:12px}
4371
+ .dvv-sum-big{padding:14px 16px;border-radius:14px;border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.1));background:var(--dsw-alias-bg-layer-1,transparent)}
4372
+ .dvv-sum-big-title{font-size:11px;line-height:16px;letter-spacing:.06em;text-transform:uppercase;color:var(--dsw-alias-label-secondary);margin-bottom:4px}
4373
+ .dvv-sum-big .dvv-sum-md{font-size:22px;line-height:32px;font-weight:700;letter-spacing:-.2px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
4374
+ .dvv-sum-big .dvv-sum-md p{margin:0}
4375
+ .dvv-sum-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
4376
+ .dvv-sum-card{display:flex;flex-direction:column;gap:6px;padding:12px 14px;border-radius:12px;border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.1));background:var(--dsw-alias-bg-layer-1,transparent);min-width:0}
4377
+ .dvv-sum-card-title{font-size:12px;line-height:18px;font-weight:650;color:var(--dsw-alias-label-primary)}
4378
+ .dvv-sum-card .dvv-md{font-size:12px;line-height:19px}
4379
+ .dvv-sum-fold{border-top:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.1));padding-top:8px}
4380
+ .dvv-sum-fold-head{appearance:none;border:none;background:transparent;font:inherit;width:100%;display:flex;align-items:center;gap:8px;padding:4px 0;cursor:pointer;color:var(--dsw-alias-label-primary)}
4381
+ .dvv-sum-fold-title{font-size:13px;line-height:20px;font-weight:600}
4382
+ .dvv-sum-fold-arrow{margin-left:auto;font-size:11px;color:var(--dsw-alias-label-secondary)}
4383
+ .dvv-sum-fold .dvv-md{font-size:13px;line-height:21px}
3879
4384
  .dvv-official{border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.1));border-radius:10px;padding:10px 12px;margin:10px 0;background:var(--dsw-alias-bg-layer-1,transparent)}
3880
4385
  .dvv-skel{height:44px;border-radius:10px;margin-bottom:8px;background:linear-gradient(90deg,var(--dsw-alias-bg-layer-1,rgba(127,127,127,.08)) 25%,var(--dsw-alias-bg-layer-2,rgba(127,127,127,.18)) 37%,var(--dsw-alias-bg-layer-1,rgba(127,127,127,.08)) 63%);background-size:400% 100%;animation:dvv-shimmer 1.3s ease infinite}
3881
4386
  @keyframes dvv-shimmer{0%{background-position:100% 0}100%{background-position:0 0}}
@@ -3963,6 +4468,18 @@ a.dvv-toolbar-title:hover{color:var(--dsw-alias-brand-primary)}
3963
4468
  .dvv-home-recent .dvv-recent-head{justify-content:center;padding:2px 0 10px}
3964
4469
  .dvv-recent-head{display:flex;align-items:baseline;gap:8px;padding:2px 0 8px}
3965
4470
  .dvv-hist-list{display:flex;flex-direction:column;gap:2px}
4471
+ .dvv-jobbar-global{flex:none;display:flex;align-items:center;gap:8px;margin:0 18px;padding:6px 10px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.1));background:var(--dsw-alias-bg-layer-1,transparent);font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
4472
+ .dvv-jobbar-global-dot{width:6px;height:6px;border-radius:50%;background:var(--dsw-alias-brand-primary);animation:dvv-pulse 1.1s ease-in-out infinite}
4473
+ .dvv-jobbar-global-text{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums}
4474
+ .dvv-jobbar-global-stage{color:var(--dsw-alias-label-secondary)}
4475
+ .dvv-jd-section{display:flex;flex-direction:column;gap:6px;padding:10px 0 4px;border-bottom:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.08))}
4476
+ .dvv-jd-head{font-size:11px;line-height:16px;letter-spacing:.05em;color:var(--dsw-alias-label-secondary)}
4477
+ .dvv-jd-row{display:flex;align-items:flex-start;gap:10px;padding:6px 0}
4478
+ .dvv-jd-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
4479
+ .dvv-jd-title{font-size:13px;line-height:19px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
4480
+ .dvv-jd-sub{font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary)}
4481
+ .dvv-jd-row[data-status="failed"] .dvv-jd-sub{color:var(--dsw-alias-state-error-primary,#c0392b)}
4482
+ .dvv-jd-actions{flex:none;display:flex;gap:6px}
3966
4483
  .dvv-hist-sub{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:2px;font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary)}
3967
4484
  /* 历史搜索 / 收藏筛选 / 星标(第 5 步) */
3968
4485
  .dvv-hist-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:2px 0 8px}
@@ -4157,7 +4674,7 @@ a.dvv-toolbar-title:hover{color:var(--dsw-alias-brand-primary)}
4157
4674
  apply,
4158
4675
  inject,
4159
4676
  // 布局是纯函数,暴露给测试直接断言坐标/连线(Host 会忽略额外字段)。
4160
- __test: { buildMindmapLayout, mindmapTextLines, defaultMindmapExpanded, allMindmapPaths, renderMarkdown, clockToSeconds, buildNoteMarkdown, sanitizeFileName, JOBS_ACTIVE_MS, JOBS_IDLE_MS },
4677
+ __test: { buildMindmapLayout, mindmapTextLines, defaultMindmapExpanded, allMindmapPaths, renderMarkdown, clockToSeconds, buildNoteMarkdown, sanitizeFileName, parseSummarySections, JOBS_ACTIVE_MS, JOBS_IDLE_MS },
4161
4678
  };
4162
4679
  return exports_;
4163
4680
  },
package/lib/index.js CHANGED
@@ -64,7 +64,7 @@ export const name = 'dsh-video-insight';
64
64
  /** Route prefix the panel calls; same origin as the GUI, so no CORS preflight. */
65
65
  export const API_PREFIX = '/dsh-video/api';
66
66
 
67
- const VERSION = '0.9.1';
67
+ const VERSION = '0.10.1';
68
68
  const CREDENTIALS_FILE = join(homedir(), '.dsh', 'video-credentials.json');
69
69
 
70
70
  const DEFAULTS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-video-insight",
3
- "version": "0.9.1",
3
+ "version": "0.10.1",
4
4
  "description": "在 DeepSeek Harness 里快速分析视频:左侧栏「视频解析」面板,粘贴 YouTube / 哔哩哔哩链接,自动抓字幕并生成总结、章节、要点、原文与追问;无字幕时可用本机 Whisper / SenseVoice 转写兜底(音频不出本机),纯无声视频还能用画面文字识别(OCR)或视觉模型描述画面;右栏有 AI 思维导图;追问是基于转写稿的 RAG 问答(回答带「依据」时间戳);分析结果按视频缓存,历史记录可回看。",
5
5
  "license": "MIT",
6
6
  "author": "Jerry (Azerz)",