Repository navigation
fix(v2): zh-CN never takes negative letter-spacing (TASK-055 class 1) - #1253
Conversation
…on the 12 tracked titles (TASK-055 class 1) Measured in a real browser via .dev/task-055-zh-harness.html (real v2.css, zh-CN strings, 1200 and 390): .v2-chat__title rendered Chinese at -0.5px, .v2-pods__title at -0.32px, .v2-inspector__now-title at -0.15px. CJK glyphs have no side bearings, so negative tracking only crushes strokes. One :lang(zh) block resets all 12 selectors; English rendering is unchanged. Invariant test asserts every negative-tracking selector in v2.css is in the reset block, so a new tracked title cannot ship without its zh reset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Gated at The fix is incomplete, and its guard cannot see the gap
.v2-feature__legacy .MuiTypography-h1,
.v2-feature__legacy .MuiTypography-h2,
.v2-feature__legacy .MuiTypography-h3,
.v2-feature__legacy .MuiTypography-h4,
.v2-feature__legacy .MuiTypography-h5,
.v2-feature__legacy .MuiTypography-h6 {
color: var(--v2-text-primary);
letter-spacing: -0.02em;
}The reset block lists only The cause is the guard itself. The enumeration is [...v2.matchAll(/\n([^\n{}]+) \{[^}]*letter-spacing:\s*-[^;]+;/g)]
I checked whether this is the only instance: scanning Merge-order constraint (also on #1254)This PR and #1254 both append to CLEAN is pairwise-blind; whichever lands second needs a rebase. Worth knowing before the press rather than during it. Verified
Not verifiedI did not render the harness. Every claim above is from the CSS text, the test source, and merge simulation — the measured px values in the comments are yours and I took them as given. |
…ne selector lists sprint-review's gate: the legacy feature-page heading rule is a six-line selector list and the guard regex could not cross a newline, so it checked h6 only and passed with h1–h5 still tracked negative under zh-CN. Guard now captures the whole list and splits on commas; mutation-checked (dropping h3 from the reset fails exactly this test). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Re-gate at
The guard is genuinely discriminating now, which the previous one was not. It derives the negative-tracking selector set from
It enumerates the protected items rather than their containers, so a new negative-tracking title added later fails closed instead of slipping past. That's the right inversion. One residual, cosmetic. A negative-tracking rule written inside a How I ran it, and what that costs. I also re-ran the first mutation with an explicit anchor assertion ( Still true and now the operative risk: |
TASK-055 — rule class 1 of 3: no negative tracking on CJK
Sam cleared these as repair under the UI freeze (TASK-055 row, 2026-08-26 07:07Z). Scoped to
:lang(zh); English renders byte-for-byte the same.Measured (real browser,
.dev/task-055-zh-harness.htmlloading the realv2.csswith zh-CN strings at 1200 / 390):.v2-chat__title20px at-0.5px,.v2-pods__title16px at-0.32px,.v2-inspector__now-title15px at-0.15px, all rendering Chinese. 12 selectors inv2.cssdeclare negative tracking; CJK glyphs have no side bearings so the value only crushes strokes.Fix: one
.v2-root:lang(zh) …block resets all 12 toletter-spacing: 0.html[lang]is set byfrontend/src/i18n/index.ts.Guard:
v2-layout-invariants.test.tsscansv2.cssfor every negativeletter-spacingselector and asserts each appears in the zh reset block — a new tracked title cannot ship without its reset.Evidence screenshots (before): Sprint HQ uploads
1787696421491-793395730.png(1200) and1787696423128-219977531.png(390). Sibling PRs: class 2 (CJK line-height 1.6 + 12px floor), class 3 (i18n literals).🤖 Generated with Claude Code