Skip to content

feat(desktop-shot): render the two sub-text-xs labels on demand - #1320

Merged
huichen merged 3 commits into
mainfrom
pr/huichen
Oct 23, 2026
Merged

huichen merged 3 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

The text-size floor added in #1317/#1318 (10px) is only visible in two labels, and neither state was reachable from the demo catalogue: the composer's draft is empty in every capture, and the demo conversation never carries an approval. So the only evidence those labels clear 10px was a rendering of the numbers, not of the screens. This PR adds two opt-in fixtures that reproduce state the shipping code reads, plus two captures that assert the sizes.

How the two states are reproduced

  • ?draft=attachments seeds draftStorage's record for the new-conversation slot, which the composer restores through loadSessionDraft exactly as after a visit. Its two attachment byte sizes are drawn at the 10 design size.
  • ?approval=1 feeds a real approval_request event through the shipping projection, so the card and its "Shell command" label (the 11 design size) are the ones the app draws.

Nothing under src/ is replaced or bypassed, and leanRender.ts is untouched: both hooks follow the query-param pattern the mock already uses for ?recent, ?held and ?compactionDelay.

Commits

  • feat(desktop-shot): render the two sub-text-xs labels on demand — adds the smallestType fixtures, wires them into RemoteContext, and adds the pending-attachment / pending-approval scenarios at the smallest text size

Verification

  • npx tsc --noEmit in mobile/ (its tsconfig includes shot/**/*.ts) → clean
  • npx eslint shot/mock/smallestType.ts shot/mock/RemoteContext.tsx → no findings
  • python3 scripts/screenshots/capture.py capture-mobile pending-attachment pending-approval → 2/2 captured; the scenario assertions report attachment sizes at 10/10px and approval label at 10px, and neither label overflows its box. With the floor removed the same assertions fail ([9,9] and 9).

Notes

  • Both hooks are opt-in via the URL; every existing capture keeps the demo timeline and empty draft untouched, so no other scenario output changes.
  • Cosmetic, not changed here: textTransform: uppercase only affects the Latin half of the localised approval label, so in Chinese locales that label is not uniformly uppercase.
  • Pre-existing and unrelated: the chat mobile scenario fails on the base commit too (its badge-glyph assertion, since feat(desktop,mobile,host): shared machine icons; release stuck deletion intents; scoped workspace #1314 moved machine icons from emoji to components).

The size scale's floor (10px, #1317/#1318) is only visible in two places: a
pending attachment's byte size in the composer (the 10 design size) and an
approval card's own label (the 11 design size). Neither state was reachable from
the demo catalogue — the composer's draft is empty in every capture, and the
demo conversation never carries an approval — so the only evidence those two
labels clear 10px was a rendering of the numbers, not of the screens.

Two opt-in fixtures, both reproducing state the shipping code reads:

  ?draft=attachments  seeds `draftStorage`'s record for the new-conversation
                      slot, which the composer restores through
                      `loadSessionDraft` exactly as after a visit.
  ?approval=1         feeds a real `approval_request` event through the
                      shipping projection, so the card and its label are the
                      ones the app draws.

Nothing under `src/` is replaced or bypassed, and `leanRender.ts` is untouched:
both hooks are the query-param pattern the mock already uses for `?recent`,
`?held` and `?compactionDelay`.

Two scenarios capture them at the smallest text size and assert what the
capture is for: both sizes are ≥ 10px and neither label overflows its box.
Without the floor they fail (`[9,9]` and `9`) — checked by removing it.

One thing the captures show that is not changed here: the approval label reads
"SHELL 命令" — `textTransform: uppercase` only affects the Latin half of the
localised string, so the zh label is not uniformly uppercase. Cosmetic, and
out of scope for a fixture.

Pre-existing, unrelated: `capture-mobile chat` fails on the base commit too
("the badge carries no glyph: 实验室的 MacBook Pro"), since #1314 moved machine
icons from emoji to components. Not touched here.
@huichen
huichen enabled auto-merge (squash) October 23, 2026 12:19
@huichen
huichen merged commit 19bd8dc into main Oct 23, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch October 23, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant