Repository navigation
ONE-67: 设计令牌与基础组件层视觉重构 — 时间账本方向返工 (ONE-69) - #139
Merged
Merged
Conversation
按 ONE-82 裁决的新契约 docs/design-system.md(「时间账本 Ledger of Time」)重做: - index.css: @font-face 自托管 Inter Variable(woff2 入仓,font-display: swap,weight 100-900);@theme inline 落 8 组 token——字体族(Inter→系统栈→CJK / mono)、8 级字阶(含行高/字重/字距,字重含 Inter Variable 原生 650)、六级圆角阶梯(4/6/8/12/16/full)、四级阴影(dark 改边框+微光补偿)、n-* 中性色阶为唯一来源 + n→role 显式映射、indigo 品牌色(#4f46e5 / #818cf8)、success/warning/info 语义色、due-far/soon/close/over 倒计时紧迫梯度、三档时长 + 三条缓动;prefers-reduced-motion 全局降级 - docs/design-system.md: 修正 §4.6 两处错误 HSL 字面量(按回填冻结值 0 73.7% 41.8% / 0 90.6% 70.8%) - n-* 不对称键集:落地为「同名全覆盖」,.dark 覆盖全部 12 键并在注释中记录映射,不依赖回退 - ui/{button,card,input,label,switch,tabs}: 按新令牌重做——button press 0.98 + 120ms ease-standard、icon 尺寸 44px 触控目标、default/destructive 挂 shadow-1;card 去边框改 shadow-1、padding 16/24 移动桌面分档、CardTitle 走 --text-title;input 圆角 6px + 200ms 状态过渡;switch 120ms;tabs 200ms 过渡 + shadow-1;props/导出名全部不变 - AppLayout: 容器 max-w-6xl→max-w-5xl、首屏留白 pt-6/pt-8;appName 改 --text-title + primary 圆点品牌签名;桌面侧栏激活项加左侧 2px primary 指示条;impersonation/PWA 横幅改 warning/info token;底部导航激活态字重 400→500 + 44px 触控目标;去 aside 裸 hsl 阴影;shadow-lg→shadow-3 - ThemeProvider: meta theme-color 对齐新底色(dark #0a0a0c) 质量门: pnpm build / typecheck / biome lint(web 侧)全绿;19 页面零改动
mapxn
force-pushed
the
agent/mary/a19f619bb981
branch
from
October 23, 2026 13:19
d298f72 to
2377895
Compare
…式被冻结为亮色值 (ONE-69)
- 起手契约修订(Mike 授权):亮色 n-500 4.39:1 → 5.17:1 达标 AA, 同步 muted-foreground / due-far,design-system.md 附录 A 记录 - 新增共享件:DueRing/DueCount(倒计时环形进度 + display 级 tabular 数字,due-* 紧迫梯度)、Skeleton/EmptyState/ErrorState(三态)、 AuthShell/FormError(auth 居中卡 + 错误 200ms 滑入) - dashboard:最近到期主视觉(环形 + display-lg 倒计时)、统计卡 数字 display 化、账本式分录行、同形态骨架、空态/错误态 - items 列表:状态徽章与倒计时全部接 due-*/success/warning 语义 token,桌面行倒计时环形 + tabular 日期,移动卡主行大数字 + 操作收进溢出菜单(可见 ≤2),空态排版化 - items new/detail:表单分区(基本/周期到期/提醒渠道),详情页 头部实时到期预览环 + display 倒计时,支付/续期表 tabular - channels:渠道卡标题 text-title + 启用状态语义徽章 - history:成功/失败徽章语义化、骨架同形态、排版空态、详情弹层 shadow-4 - me:账本头(头像 + 邮箱 + 本月到期 display 数字) - settings/admin×5:骨架全部改同形态,success/warning/destructive token 替换硬编码绿黄红,表格表头 caption 化 - about:分录式定义列表;setup/auth×5:AuthShell 400px 卡 + shadow-2 + display logo 区 + 错误滑入 - i18n:新增 common.retry/more、dashboard/items/history/me/detail 等键(中英同步)
…omptDialog 焦点陷阱 (ONE-69) - docs/design-system.md:4 处 #60606b → #666670(与冻结 HSL 240 4.9% 42% 等值,实测 on muted 5.16:1 / on 白 6.10:1 达标),代码侧 index.css 不动(Mike 裁决) - PasswordPromptDialog:接入既有 useFocusTrap(Tab/Shift+Tab 循环 + Escape 关闭 + 关闭后焦点还原);ConfirmDialog 重复声明清理 - nit:ThemeProvider meta theme-color 收敛为 META_THEME_COLOR 常量(注释标明与 index.css token 对应);DueRing aria-label 本地化(新增 common.daysLeftShort / common.overdueBy 双语 key)
… 规则在 biome.json 中为 off)
blocking·数据源(后端 7 天窗口字段曾被当 30 天/已逾期/本月展示): - dashboard: 「30 天内到期」→「7 天内到期」; 恒为 0 的「已逾期」卡 (upcoming_renewals 不含逾期)替换为真实「活跃条目」 - me: 「本月到期」改用 expiring_soon 直读并改文案「7 天内到期」 - 按族全量排查:全站 expiring_soon/upcoming_*/时间衍生计算共 14 处, 逐一核对语义(清单见交付评论);localToday/daysUntil 收敛到 lib/utils 单点 should-fix: - 魔法色清零:ItemList text-green-500→text-success、ItemDetail bg-gray-300→bg-input、Settings amber×2→warning token、 AdminUsers purple 角色徽章→bg-info/10 text-info - 键盘可达性:抽公共 useFocusTrap(焦点陷阱/初始焦点/Esc/焦点归还), 接入 history 详情浮层、AdminUsers 编辑浮层、ConfirmDialog (PasswordPromptDialog 已在 0acd352 接入,本次修其声明顺序 bug) 设计契约 §5 结构: - items/new: 桌面双栏(左表单右 sticky 到期预览卡 DueRing+DueCount) + 移动端三分区手风琴 - items/:id: 头部内联预览改为右栏摘要卡(环形+倒计时+到期日/周期/ 金额分录行) - history: 按日分组 + sticky 组标题(桌面表格 rowgroup/移动端 sticky 标题) - setup: DueRing 环形语言步骤指示器(初始化→完成)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ONE-67 Stage 2(返工):按 ONE-82 裁决的新契约
docs/design-system.md(「时间账本 Ledger of Time」,commit7c4b0c5) 重做设计令牌与基础组件层。旧契约「Quiet Precision」实现已废弃,本 PR 分支基于 main 重建。改动范围
docs/design-system.md+web/src/assets/fonts/(从契约分支agent/mary/4cfef6a848c6带入)hsl(0 72.2% 41.6%)→hsl(0 73.7% 41.8%)(=#b91c1c)、hsl(0 91.4% 71.4%)→hsl(0 90.6% 70.8%)(=#f87171),与冻结 hex 等值。web/src/index.css(令牌唯一来源)@font-face声明 Inter Variable(weight 100 900,normal + italic,font-display: swap)。@theme inline落 8 组 token:--font-sans(Inter → 系统栈 → PingFang/雅黑/Noto CJK)、--font-mono;--shadow-1..4,.dark切换为「边框 + 微光」补偿套(暗色阴影失效问题的契约方案);--n-0..n-900为唯一来源,role token(background/foreground/card/…/ring)全部改为引用n-*(映射表见 §4.6);#4f46e5/ dark#818cf8;语义色 success/warning/info 按契约值;--destructive=#b91c1c(dark#f87171),按回填冻结值直接落地;--color-due-far/soon/close/over(>30d 中性 / ≤30d 品牌蓝 / ≤7d 琥珀 / 逾期红);body接主字体族 + 15px/1.6 正文;新增.tnumtabular-nums 工具类;prefers-reduced-motion全局降级(unlayered 规则,满足 biome)。n-* 明暗键集不对称的处理(回填第 2 条):取「补齐同名覆盖」方案——
.dark覆盖全部 12 个--n-*键。契约未分配语义槽位的 4 个键(n-0/n-100/n-300/n-500)覆盖为暗色视觉等价值(n-100→n-800 值,n-300→n-600 值,n-500→n-400 值),杜绝亮色值经 var() 引用泄漏,并已在.dark块注释中记录。components/ui/*(props / 导出名全部不变)button:active:scale-[0.98]+ 120ms ease-standard;default/destructive 挂shadow-1;size=icon44×44 触控目标。card:去边框改shadow-1;圆角rounded-lg现 = 12px(契约卡片上限);padding 移动 16 / 桌面 24 分档;CardTitle 走--text-title(修复与页面 H1 层级撞车);CardDescription 改--text-body-sm。input:圆角 6px(rounded-sm新值)+ 200ms 状态过渡;label/switch(120ms thumb 位移)/tabs(200ms 激活过渡 +shadow-1)同令牌化。AppLayoutmax-w-6xl → max-w-5xl;首屏顶部留白pt-2 → pt-6(移动)/pt-8(桌面)。text-xl font-bold→--text-title+ primary 末尾圆点(「eNotify.」品牌签名)。bg-primary/10+ 左侧 2px primary 指示条(§5 AppLayout 项)。bg-yellow-500/90→bg-warning/90 text-warning-foreground、bg-blue-500/90→bg-info/90 text-info-foreground;aside 的shadow-[...hsl()]裸值删除;头像下拉shadow-lg→shadow-3(废止 shadow-lg 滥用)。ThemeProvider:meta theme-color 对齐新底色(dark#0a0a0c)。对比度实测(逐色对,WCAG AA)
✅ 达标 /⚠️ 唯一例外:亮色
muted-foreground on muted4.39:1(4.5 差 0.11)——契约冻结值本身(n-500 on n-100),用于次级说明文字,已如实上报,待契约裁决。裸色清理核对
web/src下无裸 hex className;唯一hsl(残留为ThemeProvider.tsxmeta theme-color 的 DOM API 颜色串(非 className,数值对齐 token)。页面层 Tailwind 调色板直写(text-green-600等)属 Stage 3 范围,本单未触碰。质量门
pnpm build(web)✅ /pnpm typecheck✅ /biome lintweb 侧 0 error ✅(仓库级 2 处 main 遗留:worker 未用导入、PasswordPromptDialog 无效 suppression,非本单引入)。截图
明暗 × 桌面/移动 × 6 页面共 24 张,见 ONE-69 issue 交付评论附件。