AUTH-D3 长期是视觉层唯一未判定项(94/31),本轮经用户裁定「缺参照与已过时 两者都授权」后一次性收口: - 写入 38 张(25 新 + 13 覆盖)= 台账 31 例的文件级读数,一例多 shot 已逐组对账 - 裸 --update-snapshots 实读为 changed 模式(program.js:202 preset),只写缺失/不符, 故 13 张覆盖全是真判红,不存在通过项被顺手改写 - 桌面/平板/webkit 全页高度收缩 1005–4034px,归 Q-5/S-2 网格修复;chromium-mobile 按钮参照从 186x96 桌面下拉触发器改为 132x132 真实可见汉堡按钮(N-15(c)) - 逐张读图核看关键新参照:input-default 拍到真实姓名框而非蜜罐,product-card 中部 留白与已批准的 products-fullpage 同形(flex-1 段落撑高),非渲染缺失 - 复跑 --update-snapshots=none:125 passed / 0 failed / EXIT=0,期间零写入 - 取证入 docs/acceptance/2026-10-08-baselines/(生成树 1396666、两次运行日志、 归因表与未归因的移动端 +30/+21px 观察项)
53 lines
5.9 KiB
Markdown
53 lines
5.9 KiB
Markdown
# 2026-10-08 视觉基线写入(AUTH-D3 / 台账 §8.5 D)归因与取证
|
||
|
||
- 授权:用户裁定「两者都授权」= 写入 20 例缺参照 **并** 覆盖 11 例已过时参照;§8.5 E(healer 清死选择器)裁定本轮不动。
|
||
- 生成树:`1396666`(见 `head.txt`),采集前后工作树对 `e2e/visual-snapshots` 干净(`pre-run-worktree.txt` 空、`pre-run-count.txt` = 107)。
|
||
- 命令:`npm run test:visual:all -- --update-snapshots`(dev 目标,5 project × 25 例 = 125)。日志 `update-run.txt`,**125 passed / 4.3m / EXIT=0**。
|
||
- 复核:`npm run test:visual:all -- --update-snapshots=none`。日志 `readonly-rerun.txt`,**125 passed / 0 failed / 4.1m / EXIT=0**,复跑期间 `git status --porcelain e2e/visual-snapshots` 仍为 25 `??` + 13 ` M` ⇒ **只读性成立,零写入**。
|
||
|
||
## 1. `-u` 的真实语义(决定「13 张覆盖是否都是真判红」)
|
||
|
||
`node_modules/playwright/lib/program.js:202` 实读:`["-u, --update-snapshots [mode]", { choices: ["all","changed","missing","none"], preset: "changed" }]`,`node_modules/playwright/lib/common/index.js:584` 缺省为 `missing`。
|
||
|
||
⇒ 裸 `--update-snapshots` = **`changed`**,只在「缺参照」或「比对不符」时写盘,**不会**重写通过的参照。因此 13 张覆盖全部是真判红,不存在「通过但被顺手改写」的污染。
|
||
|
||
## 2. 38 张文件 vs 台账 31 例的对账
|
||
|
||
台账 §8.3 的 `20 缺参照 + 11 已过时 = 31` 是**用例级**读数,本轮写盘是**文件级**(一例可含多张 shot),两者不矛盾:
|
||
|
||
| 组 | 用例 | shot 文件 | 说明 |
|
||
|---|---|---|---|
|
||
| 缺参照 | 20(4 subject × 5 project) | **25** | 「L2 输入框」一例两 shot(`input-default` + `input-focused`,`e2e/visual-regression.spec.ts:200,204`)⇒ 每 project 5 张 |
|
||
| 已过时 | 11 | **13** | `product-erp-fullpage` ×5 + `solution-manufacturing-fullpage` ×5 = 10 例 10 张;chromium-mobile「按钮组件」一例三 shot(`button-default/hover/focus`,`:112,116,120`)= 1 例 3 张 |
|
||
| 合计 | **31** | **38** | `update-run.txt` 内 `writing actual` 行数现取 = **38**,与 `git status` 的 25 `??` + 13 ` M` 逐项吻合 |
|
||
|
||
新参照 subject(每 project 5 张,共 25):`about-brand-fullpage`、`product-erp-upgrade-fullpage`、`product-card`、`input-default`、`input-focused`。磁盘参照总数 105(`visual-regression.spec.ts` 目录内)+ 25 = **130**,另 `manual-acceptance/` 2 张 = 132。
|
||
|
||
## 3. 13 张覆盖的像素级归因(`sips` 现取,宽×高)
|
||
|
||
| 参照 | 旧 | 新 | 定性 |
|
||
|---|---|---|---|
|
||
| `product-erp-fullpage` chromium-desktop | 1280x9211 | 1280x**7194** | −2017px,Q-5/S-2 网格修复的预期版面收缩 |
|
||
| `product-erp-fullpage` firefox-desktop | 1280x9211 | 1280x7194 | 同上,跨引擎同数 |
|
||
| `product-erp-fullpage` webkit-desktop | 2548x18422 | 2548x**14388** | 同上(DPR 2 档) |
|
||
| `product-erp-fullpage` chromium-tablet | 1668x16326 | 1668x**14426** | 同上 |
|
||
| `product-erp-fullpage` chromium-mobile | 1170x24453 | 1170x**24483** | **+30px**,非收缩形态,见 §5 观察项 |
|
||
| `solution-manufacturing-fullpage` desktop / firefox | 1280x9287 | 1280x**8282** | −1005px,同族网格收缩 |
|
||
| `solution-manufacturing-fullpage` webkit | 2548x18572 | 2548x**16562** | 同上 |
|
||
| `solution-manufacturing-fullpage` tablet | 1668x18904 | 1668x**16710** | 同上 |
|
||
| `solution-manufacturing-fullpage` mobile | 1170x27759 | 1170x**27780** | **+21px**,同 §5 |
|
||
| `button-default/focus/hover` chromium-mobile | **186x96** | **132x132** | N-15(c) `:visible` 修正后目标元素变更:旧参照拍桌面导航下拉触发器(186x96),新参照拍 390px 下真实可见的 `mobile-menu-button`(44x44 CSS 逻辑像素 × DPR3 = 132) |
|
||
|
||
## 4. 人工核看(本轮以「逐张读图」代替批量放行)
|
||
|
||
- `input-default-visual-chromium-desktop.png`:真实姓名框,placeholder「请输入您的姓名」⇒ 未拍成反垃圾蜜罐。规格侧有双护栏:`visual-regression.spec.ts:197-199` 断言 `name ∈ /^(name|email|phone|subject)$/` 且 `not aria-hidden`。
|
||
- `product-card-visual-chromium-desktop.png`:`bento-product-card-erp` 卡(标题 + 研发中/企业套装徽标 + 指标三格 + 目标口径注 + 能力标签)。中部留白**不是**渲染缺失:`products-content-v3.tsx:137` 的 `<p className="... flex-1">` 在 large 卡里撑高,文本仅占顶部一行——同一形态在**已批准**的 `products-fullpage-visual-chromium-desktop.png` 里逐字一致,故新参照与既有批准基线同形。选择器锚点为 `[data-testid^="bento-product-card-"]` + `role="listitem"` + `data-bento-size` 三重钉住(`:154-157`)。
|
||
- `button-default-visual-chromium-mobile.png`:44x44 汉堡按钮(三横线),与 N-15(c) 实测结论一致。
|
||
|
||
## 5. 观察项(不阻断,登记备查)
|
||
|
||
1. **chromium-mobile 两页 +30 / +21px 未归因**:与桌面族「大幅收缩」形态不同,移动档本来就是单列,网格修复不改高度。本轮 `1396666` 相对封版点 `a0328a6` **零生产源码改动**(29 文件全在 `docs/ specs/ e2e/ README .claude .mcp`),故该位移来自**运行期**(CMS 数据行或日期派生内容)而非代码。影响:新基线吸收了一次未归因的小位移;若后续出现移动档全页判红,先查此处。
|
||
2. **仓库体积**:新增 25 张 PNG 共 **17,192 KB**(最大单张 `product-erp-upgrade-fullpage-visual-chromium-mobile.png` 2,472 KB),13 张覆盖净变化为负(如 webkit erp 2,303,020 → 2,066,938 字节)。
|
||
3. **采集口径**:dev 目标。`docs/testing.md` §确定性约束 1 已实证「快照与 `E2E_TARGET` 无关」(`e2e/fixtures.ts` 剥 `nextjs-portal`),故 production 复核不会因此全红;`e2e/visual-snapshots` 现共 132 张(含 `manual-acceptance/` 2 张)。
|
||
4. **只读比对的前置**:跑前 `lsof :3000` 空闲、无 `next-server` 残留 ⇒ 未落入 `reuseExistingServer` 静默复用旧构建的坑(`docs/development/quality-gates.md:163`)。
|