Repository navigation
style(v2): align accents and pod-list geometry - #928
lilyshen0722 wants to merge 1 commit into
Conversation
lilyshen0722
left a comment
There was a problem hiding this comment.
Ran the real-browser check that wasn't available on your side (CLAUDE.md requires one for v2 layout, since jsdom has no layout engine). Most of it verifies. One regression: the new fixed time slot clips the two most common timestamp formats.
Harness: real v2.css + tokens.css from this PR head, served over http, markup replicated from V2PodsSidebar.tsx:658-693, 300px rail. Instrument control first — v2.css applied (897 rules) and .v2-pods__item computed to exactly 64px.
Verified working
| claim | measured |
|---|---|
| fixed 64px pod rows | all 5 rows exactly 64px |
| reserved one-line snippet | snippet 16px even when empty |
| stable title slot | title 20px |
| no clipping of row content | scrollHeight > clientHeight false on every row |
| capped Community grid | fit-content(92px) resolves to 66.05px — under the cap, label renders in full |
The reserved-slot behaviour is genuinely right: an empty snippet still holds its 16px, so rows don't jump.
The regression — .v2-pods__item-time { width: 44px }
New in this PR; base #927 had no width constraint on that rule at all, so the time sized to content.
Measured on the real elements at the real inherited font (SF Pro Text 11px), constraint temporarily relaxed:
"Yesterday" needs 51.7px slot 44px CLIPS (−7.7px)
"11:59 PM" needs 51.2px slot 44px CLIPS (−7.2px)
"2:04 PM" needs 44.2px slot 44px grazes — renders "2:04 P…"
"Aug 12" needs 37.6px fits
"Wed" needs 23.3px fits
Visually the first row renders 11:59 … — the AM/PM marker is the part elided, so a user cannot tell 11:59 in the morning from 11:59 at night.
formatRelativeTime (v2/utils/grouping.ts:73) has four branches. Two of them clip, and they are the two most recent: today (h:mm AM/PM) and "Yesterday". The weekday and month-day branches — older pods, further down the list — are the ones that fit.
Suggested fix: ~52px clears both at this font. But the better shape may be to drop the fixed width and let the title absorb the shrink — it already carries min-width: 0 + ellipsis and degrades gracefully, and a truncated pod name costs far less than a truncated timestamp.
Why 28/28 passed, and a trap in the fix
The guard asserts presence, not geometry:
expect(time).toContain('width: 44px');Green is fully consistent with the clip — the test confirms the constraint exists and cannot know 44px is too small. This is exactly the gap CLAUDE.md describes.
More importantly: that assertion now pins the bug. Widening or removing the cap turns the test red, so the fix has to update v2-layout-invariants.test.ts:183 in the same change. Worth knowing before someone tries the one-line fix and reads the red as their own mistake.
Instrument notes — two of my three methods were wrong
Recording these because the numbers above would be wrong if I'd stopped at either:
scrollWidth > clientWidthunder-reports. Withtext-overflow: ellipsisthe rendered content fits by construction, so the two are equal. It reported"2:04 PM"as fine; the screenshot showed it elided.- A cloned-span probe over-reported (63px vs 51px) —
getComputedStyle().fontreturned empty, so it fell back to a default font. - The reported numbers use the real elements with
width/overflowtemporarily relaxed and restored, so the true inherited font applies.
Not verified
- Mobile width, quote edges, mention-rail removal, pulse/focus tokens — I only measured pod-row geometry and the filter rail.
- Font is macOS SF Pro Text; Linux CI and other platforms will differ. The margin is ~7px so the direction should hold, but the exact pixels won't, and a longer localized
"Yesterday"would be worse. - My per-tab clip probe on the filter rail did not discriminate —
width: autois inert on grid items, so thoseCLIPS: falseresults carry no information. The Community conclusion rests on the resolved track (66.05px < 92px cap) and the screenshot, not on that probe.
Summary
Shadow audit
Classified all 42 v2 declarations: floating menus/popovers/modals and focus rings remain; resting surfaces inherit the existing no-shadow V2 tokens.
Verification
npm test -- --watchAll=false --runInBand src/v2/__tests__/v2-layout-invariants.test.ts(28 passed)npm run typechecknpm run buildnpm run lintremains blocked by the pre-existingPersonalityBuilder.tsx:440unescaped-entity errorNo browser MCP is available in this runtime, so the specified visual pass remains for review.