Repository navigation
fix(ui): lift muted text and small tap targets to AA and 44pt - #1332
Merged
Merged
Conversation
Desktop: `ink-muted` was only checked against `surface`, so the same ink on `surface-subtle` measured 2.77:1 in 9 of 28 palette renditions. Two controls painted a label in it (the rail's view switch, the reply's process fold), a third used the focus ring as body ink (the skill card title, 1.80:1), and a disabled primary drew white on `#bfdbfe` at 1.42:1. The contrast floors now cover `surface-subtle` and `canvas` so the token cannot drift back, and the regenerated `[data-palette]` rules carry the nine new values. Mobile: `lightColors.inkMuted` sat at 3.69-4.22:1 on every surface it is painted on - timestamps, counts, hints and section captions. The attachment chip reached only 26px and the step rows 36px, both short of the 44pt `layout.touchTarget` their neighbours already keep. Verified: desktop tsc + eslint clean, 152 vitest files / 2273 tests pass; mobile tsc + eslint clean, 53 jest suites / 736 tests plus the two new hitSlop assertions pass.
Two sessions adding scenarios for different platforms edited the same `scenarios.json` and overwrote each other's work. A fragment under `scripts/screenshots/scenarios.d/` now adds to its own platform's table (and may override an entry of the same name); a wrong platform name or a fragment that is not a mapping is an error rather than a silently empty capture. The merge rules are pinned offline by `scripts/tests/test-screenshot-scenario- fragments.py`, which `make test-screenshot-harness` runs with the two existing harness tests. Audit fragments stay untracked: one that asserts a measurement would make a plain `capture-*` fail on whatever it asserts.
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.
用截图 harness 逐屏审查桌面端与移动端的样式,按可度量的证据修复对比度与触控面积问题。全部改动都是在加严测试,没有为通过门禁而放宽任何断言。
桌面端
D1
ink-muted在抬高面上的对比度不足。palettes.json里 9 个值重算,globals.css的@theme镜像同步(说明生成器真跑过,不是只改源数据)。palettes.test.ts的FLOORS新增两条底线——ink-muted对surface-subtle与对canvas都要求 3:1;原来只测surface,而 rail 的视图切换、chip、计数恰恰画在抬高面上,实测在每种浅色主题里都只有 2.77:1。D2
RailViewSwitch未选中段由text-ink-muted改为text-ink-soft hover:text-ink(muted 在那个底色上只够 3:1)。D3
ReplyProcess折叠行容器用text-ink-soft,计数不再覆写回 muted。D4 禁用态主按钮改
disabled:bg-accent-fill-disabled disabled:text-accent-fill-hover。D5
SkillRecommendCard标题用text-accent,注释记下旧值 1.80:1。移动端
M1 次要文字颜色抬高到 AA;M2/M3 触控面积从 26px / 36px 统一到 44px(
layout.touchTarget),单测改为由该常量推导hitSlop,不再是硬编码 8。这两项没有视觉差异图,也没有造一张:
react-native-web不实现hitSlop(用elementFromPoint实测:28×44 的按钮有效命中区仍是 28×44),所以before-chat/after-chat除 M1 的颜色变化外像素一致。证据是渲染盒 + slop 算术 + 单测断言,真实效果只能在 iOS/Android 上看。截图 harness
scripts/screenshots/scenarios.d/*.json按平台并入scenarios.json,两个 worker 同时给不同平台加场景不再互相覆盖。附离线测试scripts/tests/test-screenshot-scenario-fragments.py(95 行,已接进make test-screenshot-harness),中英文指南都补了说明。验证
npx tsc --noEmit干净;vitest152 文件 / 2273 测试通过;改动文件 eslint 干净。npx tsc --noEmit干净;jest 84 测试通过(含 M2/M3 的 hitSlop 断言)。.screenshots/(gitignore 内)——桌面 15 组before-* / after-* / diff-*、移动 6 组;两份report.md各有一节对比图清单。已知未修(非本次范围,需产品决策)
accent/danger在各自的-soft面上共 31 对低于 4.5(最大差 0.36),因此remote、settings-themes两个 audit 场景仍以EXIT=1收尾。这是设计决策项:要让它们达标就得改-soft面的饱和度或文字色阶,属于视觉方向调整,不是缺陷修复。断言保持原样,没有为了让 CI 变绿而放宽。一处诚实说明
差异图上少量区域是截图噪声而非样式改动:
rail-tree那张含「3分钟前 → 2分钟前」这类相对时间戳,两次截图之间自然变化;视觉模型读图时还会把红/蓝标注框误认成界面配色变化。看差异面板时以成片区域为准。