Repository navigation
feat(desktop-shot): render the two sub-text-xs labels on demand - #1320
Merged
Merged
Conversation
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.
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.
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=attachmentsseedsdraftStorage's record for the new-conversation slot, which the composer restores throughloadSessionDraftexactly as after a visit. Its two attachment byte sizes are drawn at the 10 design size.?approval=1feeds a realapproval_requestevent 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, andleanRender.tsis untouched: both hooks follow the query-param pattern the mock already uses for?recent,?heldand?compactionDelay.Commits
text-xslabels on demand — adds thesmallestTypefixtures, wires them intoRemoteContext, and adds thepending-attachment/pending-approvalscenarios at the smallest text sizeVerification
npx tsc --noEmitinmobile/(its tsconfig includesshot/**/*.ts) → cleannpx eslint shot/mock/smallestType.ts shot/mock/RemoteContext.tsx→ no findingspython3 scripts/screenshots/capture.py capture-mobile pending-attachment pending-approval→ 2/2 captured; the scenario assertions reportattachment sizes at 10/10pxandapproval label at 10px, and neither label overflows its box. With the floor removed the same assertions fail ([9,9]and9).Notes
textTransform: uppercaseonly affects the Latin half of the localised approval label, so in Chinese locales that label is not uniformly uppercase.chatmobile 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).