Skip to content

Commit 1f9ae2f

Browse files
committed
fix(ui): 补守卫大小写与前缀盲点并订正文档计数
1 parent 02131d7 commit 1f9ae2f

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎app/src/ui/primitives/motion-coverage.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ function animationSelectors(): string[] {
8282
const out: string[] = [];
8383
for (const file of CSS_FILES) {
8484
for (const m of stripComments(read(file)).matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
85-
if (!/(?:^|[;\s])animation(?:-name)?\s*:/.test(m[2])) continue;
85+
// `/i` + 可选厂商前缀:`ANIMATION:`(大写属性名)与 `-webkit-animation:`(前缀)同样让元素在
86+
// reduced-motion 下照旧动,必须一并抽出来 —— 否则这两写法下"真洞 + 守卫全绿"可共存(T14 评审 M-2 实测)。
87+
if (!/(?:^|[;\s])(?:-(?:webkit|moz|ms|o)-)?animation(?:-name)?\s*:/i.test(m[2])) continue;
8688
for (const raw of m[1].split(",")) {
8789
const sel = raw.trim().replace(/\s+/g, " ");
8890
if (sel !== "" && !sel.startsWith("@")) out.push(sel);

‎docs/adr/ADR-033-l1-primitives-and-view-layer-contract.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ADR-032 交付了 token 层(色阶 / 字阶 / z-index 标尺 / 图标),但
3838
| 8 | `Loading` / `Skeleton` / `Probe` | `Loading.tsx` 105 · `Loading.css` 79 · `Loading.test.tsx` 238 | 85 处/30 文件的手写灰字,全站 0 骨架屏 |
3939
| 9 | `StatusLine` | `StatusLine.tsx` 94 · `StatusLine.css` 42 · `StatusLine.test.tsx` 267 | 196 处/76 文件,三种红并存,错误常在列表最底部 |
4040
| — | 共享内核 | `usePresence.ts` 200 · `usePresence.test.tsx` 282 · `usePresence.node.test.ts` 71 · `useFocusTrap.ts` 122 · `useFocusTrap.test.tsx` 236 · `ime.ts` 18 · `ime.test.ts` 32 | 卸载时机 / 焦点陷阱 / IME 组合态 |
41-
| — | 接缝与守卫 | `motion.css` 74 · `index.ts` 45 · `style-seams.test.ts` 271 · `style-contract.test.ts` 214 · `motion-coverage.test.ts` 145 | 动效变量与 reduced-motion 块 · 导出面 · 五条机器判据 |
41+
| — | 接缝与守卫 | `motion.css` 74 · `index.ts` 45 · `style-seams.test.ts` 271 · `style-contract.test.ts` 214 · `motion-coverage.test.ts` 145 | 动效变量与 reduced-motion 块 · 导出面 · 机器判据见 `style-seams` / `style-contract` / `motion-coverage` 三个测试文件 |
4242

4343
> **行数口径(唯一有效)**:`countLines()`,即 `[System.IO.File]::ReadAllLines(path, UTF8).Count` —— **含空行**的全部行数(禁用 `Get-Content` / `Measure-Object -Line` / 数 `0x0A` 字节)。
4444
> **权威来源**:逐文件数值以机器生成的 [行数豁免登记](../standards/line-limit-exemptions.md) 为准(`node scripts/line-limits.mjs --write` 生成、`--full` 校验,**不要手改其数字**);本表只是**人读摘要**。
@@ -209,7 +209,9 @@ z-index 的迁移纪律(0-A 交接第 3 条):**必须按叠放段整段推
209209

210210
- **正面**:批 4 有了迁移靶子,批 6 有了动效接缝(`[data-phase]` 三态 + 一套时长变量 + 一处 reduced-motion 块);
211211
三条全仓新契约(`createPortal` / `role="dialog"` + `aria-modal` / 焦点陷阱与归还)从 0 变成 1;
212-
交互态从零基础建立;样式首次可被**四处机器判据**守住(见下"合规性验证")。
212+
交互态从零基础建立;样式首次被机器判据守住:`style-seams` / `style-contract` / `motion-coverage`
213+
三个测试文件(见下"合规性验证")。**此处不写判据条数** —— 条数在历次修订中漂移过(同一份 ADR 内曾同时
214+
出现三个数字),写死会让后续批次误以为还有判据没落地;**以三个守卫文件的断言为准**。
213215
- **负面 / 代价**:
214216
① 迁移期会出现「内联 `style` + 新原语类」两种写法并存的窗口(与 token 迁移期同性质);
215217
② 原语层是**第三层**,组件树多了一层间接(换来的是"一处改对所有地方");

‎docs/superpowers/plans/2026-09-11-frontend-redesign-batch0d-primitives.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,7 @@ git commit -m "docs(adr): ADR-033 原语层契约 + 规范回写(批 0-D 收
13201320
- **三条全仓新契约从 0 变成 1**:`createPortal` · `role="dialog"` + `aria-modal` + `aria-labelledby` · 焦点陷阱与焦点归还(规格 §5.2 的四个必补能力中除 IME 接线外的三条)。
13211321
- **交互态从零基础建立**:`:hover` / `:active` / `:focus-visible` / `:disabled` 在活代码里**首次出现**(今天分别 0 / 0 / 0 / 0);`aria-disabled` 首次使用;禁用态首次有视觉降级(今天全站 1 处)。
13221322
- **动效接缝就位**:`usePresence`(`transitionend` + 超时兜底 + `matchMedia` 守卫)· `[data-phase]` 三态协议 · **全仓第一批 `@keyframes`**(骨架微光 / 探针)· **全仓第一条 `prefers-reduced-motion`**(今天 0 处)· 时长变量名与 §8.4 数值一致(批 6 换真源时整块删除)。
1323+
- ⚠️ **口径订正(2026-09-11,本批实测证伪)**:本批**第一个 `@keyframes` 是 `EmptyState` 的 `ed-empty-in`**(`0e5e78ab`,早于 `Loading` 的 `174b1893`)⇒「全仓第一批 `@keyframes`」不成立;这里的 reduced-motion 块只是 **`app/src` 内第一条**(仓库根 `website/components/dive/ChronosDemo.tsx:59` 早有 JS 侧 `matchMedia("(prefers-reduced-motion: reduce)")`)⇒「全仓第一条」也不成立。**权威表述见 `app/src/ui/primitives/motion.css:10-12` 与 ADR-033**;上面那行是计划写作时刻的快照,保留原样、不改写历史。
13231324
- **token 缺口补齐**:`--ed-shadow-1/2`(亮投影 / 暗反相描边)· 18 个字阶 CSS 变量(含 `1.9 → 29.5px` 的换算记录)· **`ui/tokens.css` 已接线到 `app/src/main.tsx`**(原语的 `var(--ed-*)` 从此在运行时有值)· **`--due` 亮档第二次对比度修正**(求解所得新值,三个底都 ≥4.5 且剪报底留 ≥0.05 余量)· **`--ed-ink-4` 禁止用于剪报底纹**(不新增 token,写成规范条款 + 反例守门断言)。
13241325
- **三条棘轮/守卫上线**:裸数字 z-index(58 行冻结,只许减少)· `ui/primitives/**/*.css` 的 300 行 / 零颜色字面量 / reduced-motion 覆盖率三合一守卫 · `--ed-stamp` 不得作底色的反例守卫。
13251326
- **死代码清理**:`app/src/App.css`(123 行、非 UTF-8)删除;`ChatMessageList.tsx:147` 的死 `animation` 声明删除;两处失指注释改指真实来源。

0 commit comments

Comments
 (0)