Repository navigation
[ONE-67] 动效、微交互与响应式打磨 — 令牌化动效语言 + 键盘可达性 (ONE-71) - #141
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 页面零改动
…式被冻结为亮色值 (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 环形语言步骤指示器(初始化→完成)
mapxn
force-pushed
the
feat/ONE-71-motion-micro-responsive
branch
from
October 23, 2026 16:17
737b73c to
c9f7a43
Compare
- index.css: 动效语言落地契约 §4.7——motion-enter/stagger(40ms×6)/dialog/ popover/list-item/status 六组 keyframes,全部引用 --duration-*/--ease-* 令牌;prefers-reduced-motion 下位移动画降级为 opacity 淡变 - AppLayout: 页面/区块进场 motion-enter(按路由 key 重放);移动端底栏 共享 pill 指示器 200ms ease-out 滑动(契约 §5,transform-only); AvatarDropdown 补 Esc 关闭 / aria-haspopup / role=menu / 焦点环 - ConfirmDialog / PasswordPromptDialog: 320ms 面板入场(契约 §5 admin), role=dialog + aria-modal,Esc 关闭,ConfirmDialog 焦点陷阱 + 关闭后焦点归还 - AdminUsers 编辑弹窗、History 详情弹层: 同款 dialog 动效 + Esc - ItemList: 删除退场动画(200ms ease-in)后移除;首屏行/卡片 stagger 进场; 全部浮层(工具提示/筛选/更多菜单/移动端筛选)接 animate-popover + Esc; HelpIcon 补键盘 focus 触发;移动端备注 break-words 防溢出 - Channels: 测试/保存反馈 200ms 状态动画 + role=status;裸 loading 文本 换同形态骨架(stagger) - Settings 桌面 tab 栏: 过渡令牌化 + focus 环; auth 卡 motion-enter 进场 - 骨架屏 stagger 进场 (dashboard/detail/admin×3) - 未引入任何依赖、未新增令牌;路由/API/i18n/worker 未动
上轮提交两个编辑因目标文本不匹配未落盘(AppLayout 底栏仍是静态激活色、
Settings tab 仍是 per-button border-b),Tony 评审 (ONE-72) 指出,本次修复:
- AppLayout 移动底栏:共享 pill 指示器 200ms ease-out 滑动到激活 tab
(transform-only,非 tab 路径淡出),焦点环补齐
- SettingsPage 桌面 tab 栏:per-button border 改为共享下划线滑动动画,
位置/宽度 useLayoutEffect 实测 active 按钮(换语言自适应),
200ms ease-out,transition-[transform,width]
- 确认 key={location.pathname} 无状态/滚动回归(keep-alive tab 页不受影响,
桌面滚动容器在 main 上)
验收: pnpm build / typecheck / lint 全绿
纯格式改动(import/属性拆行),无语义变更;本地 format:check / lint / typecheck / build 全绿。
mapxn
force-pushed
the
feat/ONE-71-motion-micro-responsive
branch
from
October 23, 2026 19:13
c9f7a43 to
d734e50
Compare
- 删除 zh/en 的 dashboard.expiring30、dashboard.overdue、me.dueThisMonth(均 0 引用,冻结范围) - MePage.tsx 注释 this-month due count → 7-day due count(与 expiring_soon 求和实现一致) - 零行为变化:仅 locale 删除 + 1 行注释
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 4(ONE-71)。基于 ONE-70 分支(feat/ONE-70-page-visual),只含最顶部一个提交
a3ae6b5。动效规范表(场景 / 时长 / 缓动 / 信息职责 / 实现位置)
.motion-enter(AppLayout 按路由 key 重放、AuthShell).stagger(dashboard/detail/admin 骨架、items 首屏)animate-list-item-out+ 延时移除(ItemList)active:scale-[0.98](ui/button,Stage 2 已有)animate-dialog-backdrop/panel(ConfirmDialog、PasswordPrompt、AdminUsers、History)animate-popoveranimate-status+role="status"全部引用
--duration-fast/standard/slow与--ease-*令牌,无魔法值;位移类只用 transform/opacity;无 bounce/elastic;未引入任何依赖、未新增令牌。六态走查(hover / focus-visible / active / disabled / loading / error)
响应式三档走查(≤640 / 641-1023 / ≥1024)
overflow-x-auto no-scrollbar明示。break-words;settings 长密钥/URL 已有break-all;表格列truncate。mx-4+max-w-*;tooltipmax-w-80;均在视口内。scrollWidth无横向溢出(截图见附件)。受环境限制(无后端可登账号),其余 18 页为代码结构核查 + 三档布局类走查。prefers-reduced-motion 实测
Playwright
reducedMotion: 'reduce':.motion-enter实测animation: status-in 0.12s(位移动画 → 纯淡变),transform 无残留;animate-pulse/spin 收敛为单帧;transition 统一 120ms 保留状态反馈。键盘走查
Tab/Shift+Tab 主路径可用;Esc 可关闭全部浮层(ConfirmDialog、PasswordPrompt、AvatarDropdown、更多菜单、筛选、TagCombobox、编辑/详情弹层);focus 环全程可见(focus-visible:ring-2,缺的全补齐);ConfirmDialog 焦点不外泄(焦点陷阱)。
质量门
pnpm build✅ /pnpm typecheck✅ /pnpm lint✅(与基线相同的既有 warning×1,无新增)未验证说明