Files
jiu/tools/screens.mjs
T
wangjia ffc71c8894 feat(tools): Phase 0.3 ds-compare 注册表驱动(每屏+外壳都跟原型比)
- 抽出 tools/screens.mjs 屏注册表单一真源,fidelity 与 ds-compare 共用
- ds-compare 改为遍历注册表(含 shell 外壳项),默认全屏×三主题产并排目检图;
  保留 --html/--prefix 临时单屏;统一注入 NotoSansSC 与 golden 同字体
- 满足规则2:每一屏 + 外壳都需跟原型对比

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
2026-06-25 17:47:07 +08:00

32 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// tools/screens.mjs — 还原验收「屏注册表」单一真源
//
// fidelity.mjs(自动 diff 闸)与 ds-compare.mjs(人工 montage 目检)共用此表,
// 保证「每一屏 + 外壳都跟原型比」(规则 2)。屏随 Phase 1/2 照原型重建后逐个入册。
//
// 字段:
// html 原型 html(仓库根相对路径)
// prefix Flutter golden 文件前缀 → client/test/golden/goldens/<prefix>_<theme>.png
// width/height golden「逻辑」尺寸(golden 物理像素 = 逻辑 × dpr);两边须一致
// dpr devicePixelRatio(默认 2
// waitFor 原型截图前等待的选择器
// threshold fidelity 该屏校准阈值(差异像素比例上限);人工目检「像」后定
// shell true=外壳(顶栏/侧栏/状态栏整框),与普通屏一同对比
export const SCREENS = {
// 外壳:顶栏(两级品牌+主题器+通知) + 侧栏(分组) + 状态栏。Phase 1 重建后校准阈值。
shell: {
html: '.superpowers/prototype/screens/inventory.html', // 外壳含在每个全框屏里,借库存页取整框
prefix: 'app_shell',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
threshold: 0.20,
shell: true,
},
inventory: {
html: '.superpowers/prototype/screens/inventory.html',
prefix: 'inventory_list',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
threshold: 0.20, // 旧屏未重建,暂宽松;Phase 2 重建后收紧
},
};