@q253595422/dsh-imagegen-video 1.15.3 → 1.16.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/CHANGELOG.md CHANGED
@@ -5,6 +5,109 @@ Attribution for third-party code is in [NOTICE](./NOTICE).
5
5
 
6
6
  ## Releases
7
7
 
8
+ ### 1.16.1 — 历史详情补全、两块结果板互斥、发布产物真正可重现
9
+
10
+ - **历史记录不显示生成参数,是前端从没渲染过。** 宿主从生成那一刻就把
11
+ `prompt` / `size` / `quality` / `detail` 写进索引,`historyList` 一直原样
12
+ 返回,只是从 1.16.0 起结果板只画「本次生成 N 张」和时间。现在图片板与
13
+ 素材库的 `canvasMeta` 统一取自这条历史自己的 `viewingImageEntry`——不是
14
+ 表单里「下次要生成」的值;数量取 `images.length` 而不是条目上的 `n`,两者
15
+ 在「一张图生成失败」时会分叉。视频板补 `prompt` 与 `resolution`,i18n 只
16
+ 复用现成 key。
17
+ - **两块结果板的条件互不排斥。** 视频板判 `kind === 'video'`,图片格判
18
+ `images.length > 0`;生成完成时 `setImages(...)` 会把图片格重新长出来贴在
19
+ 视频下面。1.16.0 的第一次修法是「两个板面各加一个条件」,那正是成因。现在
20
+ 由 `resultSurfaceOf(boardView, viewingVideoEntry)`
21
+ (`src/client/ImageGenPanel.tsx:2689`)单一派生四种状态,两个板面只读它,
22
+ `switch` 穷尽 + `assertNever`:以后加第五种状态编译期就报错。
23
+ - **`verify-reproducible.mjs` 只在同一目录构建两次**,所以「绝对路径进了 CSS
24
+ Module 类名哈希」它永远看不见。`tsdown.config.ts` 改用仓库相对路径
25
+ (`cssRepoPath()`,`:60-66`);检查改为在另一个目录再构建一次,逐字节比对
26
+ `lib/` 下全部 5 个产物(此前漏了同样随包发布的 `client.js.map`),
27
+ `BUILD_INPUTS` 补上 `tsconfig.json`——tsdown 自己不读它,rolldown 读,改一条
28
+ `target` 就能让产物变字节。四种破坏(绝对路径 / 只让 `.map` 依赖 cwd /
29
+ 删掉 tsconfig 输入 / 恢复)逐条确认会红。
30
+ - **参数行换行。** `.canvasMeta` 加 `flex-wrap: wrap` 与 `row-gap: 4px`
31
+ (必须写在 `gap` 之后,简写会覆盖它)。1440px 下短提示词与改前逐像素一致;
32
+ 真实数据里那条 2257 字符的提示词改前在 1440px 下会被压成「本次生成 3 张」
33
+ 每行一个字,这一版顺带修好。
34
+ - **验证**:`tsc --noEmit` / `pnpm build` / `verify-native-ui.mjs` /
35
+ `pnpm test` 全 EXIT=0;真 Chrome 断言 42 PASS(改前 14 FAIL)。
36
+ - **已知未做**:`smoke-canvas-video.mjs` 的 E1 是既有 flake(未改动树上同样偶发
37
+ 失败);CI 的 apt 超时未修;契约守卫两处盲区(选择器语法校验、`token-must-exist`
38
+ 对带 fallback 的报错文案)未补;三处 `HEAD` 写死 `5px` 的按钮未统一。
39
+
40
+ ### 1.16.0 — 视频历史有封面了,侧栏不再猜宿主的类名
41
+
42
+ - **视频历史此前没有封面,这是设计遗漏。** The host never generated a poster
43
+ frame when saving a clip, and `poster` was only populated when the upstream
44
+ happened to return `last_frame_url` — so every row rendered the same film
45
+ glyph. New `src/video-poster.ts` + `src/video-tools.ts` extract a frame with
46
+ the local ffmpeg at 10% of the duration (frame 0 is routinely a black frame
47
+ or a transition), scale it to 320px wide, and store it as
48
+ `<clip名>-poster.jpg`. `src/video-store.ts` gains `StoredVideoFile.posterFile`
49
+ and serves it through the existing `poster` field, so
50
+ `VideoHistoryFile.poster` keeps its meaning — an upstream URL or a same-origin
51
+ host-extracted one, either way just an `<img src>`.
52
+ - **老记录惰性回填,且这一次请求内做完。** Three defects stacked here:
53
+ `BACKFILL_BATCH = 3` left the rest to "the next request"; the panel's
54
+ `initialDataRequestedRef` let `loadInitialData()` run only once per panel
55
+ lifetime on HEAD, so that request never came; and one unreadable clip blocked
56
+ the head of the queue forever. Now `drainVideoPosters()` empties the backlog
57
+ within the request, `posterFailures` (`src/video-store.ts:348`) remembers
58
+ clips that fail so they cost one slot instead of all of them, and the drain's
59
+ fixed point is `attempted === 0` rather than `filled === 0` — a batch whose
60
+ three slots were all unreadable clips fills nothing yet must not stop the
61
+ drain. `src/routes.ts:2501` keeps the drain unawaited but adds the `.catch`
62
+ an unawaited rejection needs: the host's fail-loud handler would otherwise
63
+ turn one unwritable index into `proc.exit(1)`.
64
+ - **侧栏插件条目不再猜宿主的 class 名。** `sidebar-entry.ts` matched
65
+ `[class*="logoRow"]`-style guesses; the host re-hashes CSS Module class names
66
+ every release, and a selector that stops matching fails silently — the entry
67
+ simply disappears. It now reads the slot anchors the host writes into the DOM
68
+ (`[data-slot="sidebar.workspaces"]`, `sidebar.brand.mark`/`.name`,
69
+ `sidebar.footer.action`, `sidebar.settings`), which are a contract rather than
70
+ a build artifact. The middle-column takeover moves the same way:
71
+ `MAIN_SLOT_ANCHOR = '[data-slot="main"]'` plus `boxAncestor()`, which skips
72
+ the `display: contents` anchor itself for the ancestor that actually paints a
73
+ box.
74
+ - **主题切换不再读 OS 偏好。** `surface-theme.ts` watched
75
+ `prefers-color-scheme`, but DSH resolves `system` itself and writes the answer
76
+ onto `body[data-ds-dark-theme]` — the media query was a second source of truth
77
+ that could disagree with the palette actually painted, leaving nav text
78
+ unreadable after a switch. It now observes only the attributes the host
79
+ writes.
80
+ - **拖拽监听不再泄漏。** The chat divider's drag bound three window listeners
81
+ and `cursor`/`user-select` on `<html>` that nothing released after the element
82
+ was destroyed. `stopResizerDragWatch` is now held and released by the mount
83
+ lifetime.
84
+ - **「看起来像原生」变成可检查的规则。** New `docs/native-ui-contract.md`
85
+ (319 lines) plus `scripts/verify-native-ui.mjs` (347 lines) enforcing eight
86
+ rules — literal colors, literal shadows, hardcoded radii, off-scale font
87
+ sizes, `prefers-color-scheme`, tokens DSH does not define, `[class*=]`
88
+ guessing, and theme read from the DOM. Wired into `pnpm test` after
89
+ `verify-reproducible`. 18 `*.module.css` files under `src/client/` were
90
+ migrated onto the tokens.
91
+ - **`pnpm studio:preview`** builds the whole panel into a single-file preview
92
+ bundle and shoots light and dark states in a real Chrome with five in-page
93
+ audits. The 6MB artifact is gitignored.
94
+ - **Dependency:** `@deepseek-ai/dsh-client-ui-primitives`
95
+ `0.1.2-alpha.2` → `0.2.1-rc.2` (the version the host actually ships; the old
96
+ one hardcoded 14px/18px radii where the new one uses
97
+ `var(--dsw-radius-md)`/`var(--dsw-radius-sm)`), plus the `0.2.1-rc.2` dev
98
+ dependencies it needs at pack time — `primitives@0.2.1` ships an empty
99
+ `dependencies` and degrades to unresolved globals if they are not declared.
100
+ - **Cost, stated plainly:** the video row's thumbnail box goes from 54×54 to
101
+ 52×52. `.historyThumbPlaceholder[data-video-thumb]` has had a 1px border since
102
+ HEAD, but `.panel *`'s `box-sizing: border-box` cannot reach it (the history
103
+ list is portalled into the sidebar host, outside the `.panel` subtree, and the
104
+ host ships no universal reset) — so 54×54 was the measured size all along.
105
+ Adding the rule makes clip rows match image rows; the net effect is that
106
+ video rows are 2px smaller. `.pptBadge` contrast goes 2.79:1 → 5.53:1.
107
+ - Full detail, including the end-to-end measurement that the first listing is
108
+ always 0/10 covered and only the client's follow-up read makes the posters
109
+ appear, is in `docs/releases/v1.16.0.md`.
110
+
8
111
  ### 1.15.3 — 视频工作室不再是死路
9
112
 
10
113
  - **生视频标签页此前无法返回生图。** The shell hides the image config sidebar
@@ -0,0 +1,80 @@
1
+ # v1.16.0 — 视频历史有封面了,侧栏不再猜宿主的类名
2
+
3
+ 一句话概括:视频历史的每一行现在有自己的缩略图;侧栏与中间栏的接管从「猜宿主 class 名」改成「读宿主声明的锚点」,不会再因为宿主改一次样式哈希就静默失效。附带一份把「看起来像原生」写成可检查规则的契约,和它的执行器。
4
+
5
+ ## 为什么
6
+
7
+ 这一版处理三类问题。它们都不是新写出来的功能坏了,而是**这一层本来就没写**,或者**写的方法依赖了一个会变的东西**。
8
+
9
+ **第一类:视频历史从来没有封面,这是设计遗漏。** `ImageGenPanel.tsx:583` 在 HEAD 上的注释写着「A clip has no poster frame of its own」——也就是说,前端早就知道这一行只能显示胶片图标,并且把这件事当成了既定事实。宿主侧保存 clip 时从不生成封面帧,`poster` 字段只在「上游偶尔返回 `last_frame_url`」时才有值,其余时候永远是空的。用户看到的就是一列长得一样的胶片图标,分不出哪条是哪条。
10
+
11
+ **第二类:靠猜类名接管宿主界面。** 侧栏插件条目原先用 `[class*="logoRow"]` 这类选择器找位置。宿主每次发版,CSS Module 的 class 名都会重新哈希,猜中的名字下一次构建就可能不存在——而选择器匹配不到时不会有任何报错,只会静默失效:用户看到的是插件条目消失,而不是一条错误。中间栏的接管同理,旧逻辑匹配 `[class*="centerCol"]`。这两个地方都把宿主的**构建期产物**当成了**接口**。
12
+
13
+ **第三类:视频封面的回填永远做不完。** 这是三个缺陷叠在一起,单独看都不致命:
14
+
15
+ - 回填每批只补 `BACKFILL_BATCH = 3` 条,剩下的指望「下一次请求」接手;
16
+ - 但前端 `initialDataRequestedRef` 让 `loadInitialData()` 在 HEAD 上一个面板生命周期只跑一次——开关面板不卸载组件、ref 不重置,第二次请求在正常路径下永远不会发生;
17
+ - 一条读不出来的 clip 会卡在队首,每批都被选中、每批都失败,把后面所有 clip 堵死。
18
+
19
+ 叠起来的结果是:30 条历史里最多 27 条永久没有封面,且没有自愈路径。
20
+
21
+ ## 做了什么
22
+
23
+ - **宿主侧抽帧存盘。** 新增 `src/video-poster.ts`(103 行)与 `src/video-tools.ts`(149 行):用本机 `ffmpeg` 从已落盘的 mp4 里抽一帧,缩到 320 宽存成 JPEG,命名 `<clip名>-poster.jpg`。抽帧位置在**时长的 10%** 而不是首帧——首帧常是黑场或转场,10 个真实 clip 的实测支持了这个选择。320 宽是因为这些图只出现在约 64px 的行缩略图里,再大是浪费。`ffmpeg` 的发现路径来自 `clip-compose.ts` 原有的 `localVideoToolDirs()`(宿主 PATH 不含 `~/.local/bin`,只能用绝对候选路径),这次提取为 `src/video-tools.ts` 供两处共用,`clip-compose.ts` 改为从它导入。
24
+ - **封面进存储与接口。** `src/video-store.ts`(+229 行)新增 `StoredVideoFile.posterFile`;`toWire()` 里 `poster ?? (posterFile ? fileUrl(posterFile) : undefined)`,所以 `VideoHistoryFile.poster` 的语义不变——可能是上游 URL,也可能是宿主抽帧后的同源 URL,前端只当 `<img src>` 用。`readVideoFile()` 的正则多认一个 `-poster.(jpg|jpeg)` 分支,原有的 mp4/webm/mov/mkv 分支一字未改(路径穿越仍然被拒)。
25
+ - **老记录惰性回填。** `backfillVideoPosters()` 每次 `historyList` 时补一批;`drainVideoPosters()` 在这一次请求内把积压排空,不再依赖第二次请求。
26
+ - **失败不再永久堵队。** 模块级 `posterFailures: Set<string>`(`src/video-store.ts:348`)记住抽帧失败的文件名:失败的跳过,同一文件名成功的清除记忆。这样一条坏 clip 只占一次名额。
27
+ - **drain 的收敛判据是「有没有尝试」,不是「有没有成功」。** 这个判据错过一次:按 `filled > 0` 循环时,如果第一批 3 个名额恰好全被不可修复的 clip 占满,`filled === 0` 会让 drain 误判为到达终点而退出,后面健康的 clip 一条都碰不到。现在私有 `backfillVideoPostersDetailed()` 返回 `{ filled, attempted }`,`attempted === 0`(没有任何条目被选中)才是唯一真正的不动点。导出的 `backfillVideoPosters()` 仍是 `Promise<number>`,签名未动。
28
+ - **回填的失败不再能拖垮宿主。** `src/routes.ts:2501` 的 `drainVideoPosters()` 不 await,但必须带 `.catch`:unawaited rejection 会落到进程级 `unhandledRejection`,而宿主的 fail-loud handler 会把它变成 `proc.exit(1)`——一个写不进的索引文件就能让整个宿主退出,只为了一个装饰性的缩略图。
29
+ - **侧栏条目改从锚点解析。** `src/client/sidebar-entry.ts`(+289)不再猜 `[class*="logoRow"]`,改为读宿主写进 DOM 的 slot 锚点:`[data-slot="sidebar.workspaces"]`、`[data-slot="sidebar.brand.mark"|"sidebar.brand.name"]`、`[data-slot="sidebar.footer.action"]`、`[data-slot="sidebar.settings"]`。这些锚点是 `@deepseek-ai/dsh-client-ui-renderer` 的输出契约(`<div data-slot="<key>" style="display: contents">`);class 名是构建期哈希,不是契约。
30
+ - **中间栏接管同样改锚点。** `src/client/mount.tsx`(+152)新增 `MAIN_SLOT_ANCHOR = '[data-slot="main"]'` 与 `boxAncestor()`——后者跳过 `display: contents` 的锚点本身,取真正画盒子的祖先。旧逻辑匹配 `[class*="centerCol"]`。另加 `data-dsh-imagegen-center-col` 自有标记,让样式表只依赖自己的属性而不是宿主的。
31
+ - **主题切换不再读 OS 偏好。** `src/client/surface-theme.ts` 原先监听 `prefers-color-scheme`,但 DSH 自己解析 `system` 并把结果写到 `body[data-ds-dark-theme]` 上,媒体查询是**第二个真相来源**,可能和实际画出来的调色板打架。改为只监听宿主真正写的属性(`data-ds-dark-theme`、`data-ds-theme-source`、`style.color-scheme`、`class`、`data-theme`)。
32
+ - **拖拽监听不再泄漏。** 聊天分隔条拖拽中绑的三个 window 监听和 `<html>` 上的 `cursor`/`user-select`,在元素销毁后无人解绑。新增 `stopResizerDragWatch`,由 mount 生命周期持有释放权。
33
+ - **契约与执行器。** 新增 `docs/native-ui-contract.md`(319 行)把「什么叫看起来像原生」写成可检查的规则:圆角按角色选 token、字号必须落在宿主刻度上、颜色只能取 `--dsw-alias-*`、不许猜宿主 class 名。`scripts/verify-native-ui.mjs`(347 行)是它的执行器,8 条规则:`no-literal-color`、`no-literal-shadow`、`radius-from-token`、`font-size-on-scale`、`no-os-theme-query`、`token-must-exist`、`no-dom-class-guessing`、`theme-from-service`。已接进 `pnpm test`,位置在 `verify-reproducible` 之后、`smoke` 之前。
34
+ - **单命令预览。** 新增 `scripts/studio-preview.{tsx,ts,mjs}` 与 `studio-preview-shot.mjs`:`pnpm studio:preview` 把整个面板构建成单文件预览包,再用真 Chrome 出明暗两态截图并做五类页内审计。产物 `/.studio-preview/` 已进 `.gitignore`(6MB 预览包不进仓库)。
35
+ - **18 个 CSS Module 文件**按契约迁到 token:圆角取 `--dsw-radius-*`、阴影取 `--dsw-shadow-lv*` / `--dsw-elevation-*`、颜色取 `--dsw-alias-*`、字号落到宿主刻度。
36
+
37
+ ## 依赖升级
38
+
39
+ `@deepseek-ai/dsh-client-ui-primitives` 从 `0.1.2-alpha.2` 升到 `0.2.1-rc.2`——插件原先声明的是旧版,宿主实际提供的是新版。差别是真实的:旧版 `Button.module.css` 硬编码 `14px/18px` 圆角,新版是 `var(--dsw-radius-md)` / `var(--dsw-radius-sm)`(12px / 8px),与契约一致。
40
+
41
+ 同批新增 `dsh-util-code-language`、`dsh-util-workspace-path` 两个 `0.2.1-rc.2` 的 devDependencies,并把 0.2.1 运行时需要的打包依赖显式补进 devDependencies。**这条是真陷阱**:`primitives@0.2.1` 的 `dependencies` 是空的,全部放在 `devDependencies` 里,单独打包会退化成未解析的全局变量。同批还显式声明了一批 0.2.1 系列的打包依赖,此处不逐个归因。
42
+
43
+ ## 验证
44
+
45
+ ```
46
+ pnpm typecheck EXIT=0
47
+ pnpm build EXIT=0
48
+ DSH_ASAR_DIR=… node scripts/verify-native-ui.mjs PASS native-UI contract: no violations. EXIT=0
49
+ pnpm test EXIT=0 UI CONTRACTS VERIFIED
50
+ ```
51
+
52
+ drain 的收敛判据做过负向验证:把判据换回 `filled > 0`,30 条好 clip + 6 条坏 clip 在队首的场景下覆盖数从 30/36 掉到 0/36,改回来恢复 30/36。断言承重。
53
+
54
+ 端到端链路实测(这条链跨宿主与前端两侧,单看一侧验不到):
55
+
56
+ ```
57
+ first response: 0/10 covered
58
+ refetch @2000ms: 10/10 covered
59
+ refetch @5000ms: 10/10 covered
60
+
61
+ 30 条上限:
62
+ first response: 0/30 covered
63
+ refetch @2000ms: 30/30 covered
64
+ ```
65
+
66
+ 封面文件本身:`readVideoFile(poster)` → `{"mime":"image/jpeg","size":10366}`,JPEG magic 为 `ff d8`,路径穿越 `../index.json` 被拒。
67
+
68
+ ## 影响面
69
+
70
+ **升级后第一次打开面板,视频历史会先显示一列胶片图标,然后变成封面。** 这是设计如此,不是卡住:宿主只在把列表响应写回之后才开始抽帧,所以第一次响应永远是 0 封面;前端在回填完成后补取一次列表,缩略图才会浮现。10 个 clip 实测抽帧约 1.3s。如果前端不补取,用户看到的就是 10 个胶片图标——这一版的两侧一起才构成完整链路。
71
+
72
+ **视频行的缩略图盒子从 54×54 变成 52×52。** `.historyThumbPlaceholder[data-video-thumb]` 从 HEAD 起就带 `border: 1px solid var(--dsw-alias-border-l1)`,但 `.panel *` 的 `box-sizing: border-box` 够不到它——历史列表被 `createPortal` 到宿主侧栏,在 `.panel` 子树之外,而宿主自己的 CSS 里 universal box-sizing 规则数是 0。所以 HEAD 上它本来就是 54×54(内容盒 52 + 左右各 1px),只是没人量过。这一版补了 `box-sizing: border-box`,让视频行与图片行的缩略图盒真正相等。净效果:**视频行比之前小 2px。**
73
+
74
+ **`.pptBadge` 的对比度从 3.92:1 修到 5.53:1**(amber-600 底 + amber-900 字)。原先是 `#d95732` 底 + 白字,2.79:1,低于 3:1。
75
+
76
+ **老数据**:`~/.dsh/dsh-imagegen/videos/` 现有的 clip 在升级后首次列历史时被惰性回填,索引格式不变,只多一个可选字段。
77
+
78
+ **不改变的**:`VideoHistoryFile.poster` 的接口语义;`readVideoFile()` 原有的四种视频扩展名分支与路径穿越防护;其余挂载点不受 slot 锚点改动影响。
79
+
80
+ **已知代价**:抽帧失败的文件名只在进程内记忆,重启后会被重试一次——这是有意的,因为失败可能是暂时的(磁盘满、ffmpeg 正被占用)。
@@ -0,0 +1,40 @@
1
+ # v1.16.1 — 历史详情补全、两块结果板互斥、发布产物真正可重现
2
+
3
+ 一句话概括:修掉 1.16.0 的三个缺陷——历史记录不显示生成参数、点不同历史会同时出现两块结果板、发布产物换个目录构建就变字节;另外把「结果板换成别的样子」收口成编译期就能拦住的形式。
4
+
5
+ ## 为什么
6
+
7
+ **第一类:数据一直在,只是没人渲染。** 宿主从生成那一刻起就把 `prompt`、`size`、`quality`、`detail` 一并写进历史索引,`historyList` 也一直原样返回。前端从 1.16.0 起只渲染「本次生成 N 张」和时间,于是用户点开一条历史,看不到这条是怎么生成的。补渲染时还有个容易踩的坑:参数必须取自**这条历史记录**,不能取表单里「下次要生成」的值——否则界面上永远是「当前设置」,而不是「这条记录的设置」。
8
+
9
+ **第二类:两块结果板的条件互不排斥。** 视频板判 `resultSurface.kind === 'video'`,图片格判 `images.length > 0`。一次生成完成会 `setImages(...)`,但如果此刻结果板正开着一条视频历史,图片格就会重新长出来贴在视频下面。1.16.0 的第一次修法是「两个板面各加一个条件」——那正是缺陷的成因:互斥靠两处条件恰好互补,任何一处被改、任何新的写入路径都会让它复活。
10
+
11
+ **第三类:检查本身抓不到它该抓的东西。** `verify-reproducible.mjs` 原先只在**同一目录**构建两次再比字节,所以「绝对路径进了 CSS Module 类名哈希」这种路径依赖永远不会被它看见。另外 `tsconfig.json` 不在构建输入清单里——它是 tsdown 之外的另一条静默输入通道(rolldown 自己读它),改一条 `target` 就能让产物变字节,而检查当时不会抱怨。
12
+
13
+ ## 做了什么
14
+
15
+ - **历史详情渲染。** 图片板与素材库的 `canvasMeta` 统一取自 `viewingImageEntry`(这条历史自己的 `prompt` / `size` / `quality` / `detail`),数量用 `images.length` 而不是历史条目里的 `n`——两者在「一张图生成失败」这类情况下会分叉。视频板补 `prompt` 与 `resolution`。i18n 全部复用现成 key,没有新造。
16
+ - **结果板单一派生。** 新增 `resultSurfaceOf(boardView, viewingVideoEntry)`(`src/client/ImageGenPanel.tsx:2689`)产出四个状态:图片历史、视频历史、素材库、什么都没选。两个板面都只读这一个值,`switch` 穷尽分支加 `assertNever` 兜底:以后加第五种状态,编译期就报错,不会出现「新状态只被一个板面认识」。
17
+ - **发布产物可重现。** `tsdown.config.ts` 交给 lightningcss 的 CSS Module 标识从绝对路径改为仓库相对路径(`cssRepoPath()`,`tsdown.config.ts:60-66`)。`scripts/verify-reproducible.mjs` 改为在**另一个目录**再构建一次,逐字节比对 `lib/` 下**全部 5 个产物**(此前漏了 `client.js.map`,而它确实随包发布),`BUILD_INPUTS` 补上 `tsconfig.json`,失败文案改成两条并列成因(迭代顺序 / 路径依赖)。
18
+ - **参数行换行。** `panel.module.css` 的 `.canvasMeta` 加 `flex-wrap: wrap` 与 `row-gap: 4px`。`row-gap` 必须写在 `gap` 之后——`gap` 是简写,会把它覆盖掉。1440px 下短提示词与改前逐像素一致;长提示词(真实数据里最长 2257 字符)改前会被压成「本次生成 3 张」每行一个字,这一版顺带修好。
19
+
20
+ ## 验证
21
+
22
+ 四条独立检查,破坏性验证逐条确认它们真的会红:
23
+
24
+ | 检查 | 结果 |
25
+ |---|---|
26
+ | `tsc --noEmit` | EXIT=0 |
27
+ | `pnpm build` | EXIT=0 |
28
+ | `verify-native-ui.mjs` | PASS,无违规 |
29
+ | `pnpm test` | EXIT=0,`UI CONTRACTS VERIFIED` |
30
+
31
+ - **可重现检查的破坏性验证**:改回绝对路径 → FAIL;只让 `.map` 带路径依赖 → FAIL;把 `tsconfig.json` 从输入清单删掉 → FAIL;恢复后 5 个产物在三个不同目录下 digest 全同。
32
+ - **历史详情的渲染断言**:真 Chrome 里 42 条,改前 14 FAIL,改后全 PASS;负向验证里把图片侧 `size` 改读表单 state、视频侧 `resolution` 渲染空串,各自都会红。
33
+ - **结果板互斥**:视频板开着时图片格不出现;把那条 clip 删掉后,之前生成的那张图还在(证明是被排除,不是被丢弃)。
34
+
35
+ ## 已知未做
36
+
37
+ - `pnpm test` 里的 `smoke-canvas-video.mjs` E1 是一条**既有** flake:未改动的树上同样偶发失败,文本逐字相同。绿的需要重跑一次才可靠,本轮未修。
38
+ - CI 的 apt 步骤超时未修(用户明确说「第二点不要动」),因此 main 的 CI 仍可能因此转红。
39
+ - 契约守卫两处盲区未补:选择器语法校验(插入 `/.shell[data-fullscreen]{…}` 会报 PASS,但 `pnpm build` 会 SyntaxError)、`token-must-exist` 对带 fallback 的 `var(--x, y)` 报的「浏览器会静默丢弃」是假话。
40
+ - 三处 `HEAD` 写死 `5px` 的按钮未统一到 `radius-sm`。