feat(client): 登录/注册页照原型重建,ds 真相源组件族统一全部屏

- 登录/注册(login.html/register.html 1:1):两栏卡片+品牌渐变面板+主题小衣服
  pill(onSurface 变体)+记住我(记录并预填最近账号)+原型式 toast 校验;
  登录 fidelity 1.4–2.1% 三主题全绿;注册暂不入闸(少 门店编号/兑换券 字段,
  已记 CONTRACT,screens.mjs 留存根)
- ds 原子补齐:DsToast(.toast 单例)/DsCheck(.check/.agree)/DsButton lg 档/
  DsSelect 替换全部旧 DropdownButton/DsField label 在上/DsInput 后缀与密码形态
- 全屏统一:对话框按钮全 DsButton、盒式输入主题钉死(visualDensity.standard、
  h38、InputDecorationTheme 渗漏修复)、图标全 lucide、JetBrains Mono 三端同源、
  BrandMark 真相源 logo、只读模式写操作全量守卫(WriteGuard+DsToast)
- 出入库列表:版式对齐原型(卡片对齐+搜索框居中)、KPI 近30天滚动、结清后
  失效财务应收应付表;商品编辑抽屉介绍库改搜索下拉、图片双击全屏预览
- 删除旧 UI 死代码:DataTableCard/FormDialog/PageScaffold/SearchChip/
  SelectProductDialog/tabStateProvider
- golden/fidelity:stock-in/out 补注册(9%)、login 入册(8%)、goldens 全量重打;
  修复 pubspec flutter_web_plugins 非法声明(CI pub get 阻断)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
wangjia
2026-07-03 09:58:14 +08:00
parent ca7595b113
commit 6238b86dcb
286 changed files with 16831 additions and 11136 deletions
+9 -3
View File
@@ -61,13 +61,19 @@ const diffDir = 'design/_fidelity';
mkdirSync(protoDir, { recursive: true });
mkdirSync(diffDir, { recursive: true });
// 统一字体注入:把原型的 --font/--font-mono 覆盖为 NotoSansSC(与 Flutter golden 同字体)。
// 统一字体注入:sans 覆盖为 NotoSansSC(与 Flutter golden 加载的测试字体一致);
// mono 覆盖为 Menlo(与 AppFonts.mono 一致——golden/真机的等宽都是 Menlo
// 对比环必须同源,否则等宽列多的屏会虚高 diff)。原型全部字体走
// var(--font)/var(--font-mono)(无硬编码,已核查),故只改 :root 变量 +
// html 继承兜底即可,不能用 `*{!important}` blanket(会把 mono 也砸成 Noto)。
// 字体经 shoot 临时 http serverroot=cwd)按 /client/... 路径供给。
const injectCss = join(tmpdir(), 'jiu-fidelity-font.css');
writeFileSync(injectCss, [
`@font-face{font-family:'NotoSansSC';src:url('/client/assets/fonts/NotoSansSC.ttf');font-weight:100 900;font-display:block;}`,
`:root{--font:'NotoSansSC',sans-serif!important;--font-mono:'NotoSansSC',monospace!important;}`,
`*{font-family:'NotoSansSC',sans-serif!important;}`,
`@font-face{font-family:'JetBrainsMono';src:url('/client/assets/fonts/JetBrainsMono-Regular.ttf');font-weight:400;font-display:block;}`,
`@font-face{font-family:'JetBrainsMono';src:url('/client/assets/fonts/JetBrainsMono-Bold.ttf');font-weight:700;font-display:block;}`,
`:root{--font:'NotoSansSC',sans-serif!important;--font-mono:'JetBrainsMono',monospace!important;}`,
`html,body{font-family:'NotoSansSC',sans-serif!important;}`,
].join('\n'));
const wantThemes = values.themes.split(',').map((s) => s.trim()).filter(Boolean);
+100 -1
View File
@@ -34,6 +34,105 @@ export const SCREENS = {
prefix: 'inventory_list',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
threshold: 0.20, // 旧屏未重建,暂宽松;Phase 2 重建后收紧
// Phase 2 重建后校准:实测 a 3.8% / b 2.9% / c 4.2%(残差=跨渲染器行高漂移
// + 状态徽章已知语义差),收紧到 8% 抓结构性回归。
threshold: 0.08,
},
partners: {
html: '.superpowers/prototype/screens/partners.html',
prefix: 'partners',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
// 重建后校准:实测 a 3.2 / b 2.5 / c 3.5%(残差=列宽分布+文字度量+保留的导出按钮)
threshold: 0.08,
},
products: {
html: '.superpowers/prototype/screens/products.html',
prefix: 'products_archive',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
// 重建后校准:实测 a 3.2 / b 2.4 / c 3.5%。残差含已知数据驱动差
// (见 design/CONTRACT.md):档案无 分类/状态 列、无香型 chips、
// seg 第 5 tab 香型→仓库、无「新增商品」、pager 带翻页控件。
threshold: 0.08,
},
devices: {
html: '.superpowers/prototype/screens/devices.html',
prefix: 'device_management',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
// 重建后校准:实测 2.4–3.0%(残差=会话表列宽分布+外设卡按钮文字省略)
threshold: 0.08,
},
settings: {
html: '.superpowers/prototype/screens/settings.html',
prefix: 'settings',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
// 已知差异:子导航多「编号规则」项、门店卡多 Logo 行。实测 1.72.3%
threshold: 0.08,
},
users: {
html: '.superpowers/prototype/screens/users.html',
prefix: 'users',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
// 已知差异:角色口径拉平为后端四级(原型 KPI 初值/角色混用三级)。实测 1.3–2.1%
threshold: 0.08,
},
about: {
html: '.superpowers/prototype/screens/about.html',
prefix: 'about',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
threshold: 0.08, // 实测 2.22.7%
},
'stock-in': {
html: '.superpowers/prototype/screens/stock-in-list.html',
prefix: 'stock_in_list',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
// 2026-07-03 补注册(此前漏注册导致单元格样式偏差长期未被闸住)。
// 页面留白/单元格对齐后校准:实测 a 3.6 / b 2.6 / c 3.9%
//(残差=真实数据 vs 原型演示数据 + 状态列口径/placeholder 文案已知差异)。
threshold: 0.08,
},
'stock-out': {
html: '.superpowers/prototype/screens/stock-out-list.html',
prefix: 'stock_out_list',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
// 页面留白/单元格对齐后校准:实测 a 3.6 / b 2.6 / c 3.9%
threshold: 0.08,
},
login: {
html: '.superpowers/prototype/screens/login.html',
prefix: 'login',
width: 1280, height: 900, dpr: 2,
waitFor: '.auth',
// 2026-07-03 重建后校准:实测 a 1.9 / b 1.4 / c 2.1%。已知差异
// design/CONTRACT.md):密码框空值 hint vs 原型 8 dots、
// 历史下拉/密码可见后缀箭头(功能位)、ds-fab 仅原型有。
threshold: 0.08,
},
// register:暂不入闸(2026-07-03 用户拍板)。原型多「门店编号/授权兑换券」
// 两字段,后端 RegisterInput 暂不支持 → 表单少两行,整卡结构性错位
// (实测 a 15.5 / b 6.2 / c 26%),像素闸无意义。golden 测试仍锁三主题回归;
// 后端补 shop_code/voucher 支持后恢复此注册并收紧到 ~8%:
// register: {
// html: '.superpowers/prototype/screens/register.html',
// prefix: 'register',
// width: 1280, height: 900, dpr: 2,
// waitFor: '.auth',
// threshold: 0.08,
// },
finance: {
html: '.superpowers/prototype/screens/finance.html',
prefix: 'finance',
width: 1280, height: 900, dpr: 2,
waitFor: '.app',
// 重建后校准:实测 a 3.9 / b 3.0 / c 4.2%(残差=柱高比例+文字度量+
// KPI 应收为实算汇总 vs 原型硬编码,见 CONTRACT 已知差异)
threshold: 0.08,
},
};