You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(docs): capture screenshots per viewport where the layout differs #5250
Part 2 of #4686. Triage split that issue in three; TALE-112 works part 1, the responsive delivery of the docs images.
Summary
Docs screenshots are captured at one viewport. services/platform/tests/docs-screenshots/capture.ts takes shot.viewport ?? VIEWPORT (1440×900 at DPR 2), so a phone reader sees a scaled-down desktop page even where Tale lays the page out differently on a phone.
Proposed change
Let a shot declare more than one viewport (phone, tablet, desktop) where the page differs. Capture each as a variant of the same shot.
Record the variants with their shot in services/docs/public/images/manifest.json, and keep /images/<section>/<shot>.webp as the desktop full-size file.
Render them with <picture> and media sources, through the shared Picture and ImageZoom of part 1. services/web/app/components/blocks/product-screenshot.tsx already does this for its phone crop.
Fold the capture's own WebP encoder (services/platform/tests/docs-screenshots/webp.ts and its 190 KiB quality ladder) into the shared encoder of part 1, so one implementation encodes every shot.
Acceptance criteria
Every shot whose layout differs by device has a phone and a desktop capture. The change lists those shots, and says why the others need none.
services/docs/tests/image-manifest.test.ts covers the viewport variants: each exists, is referenced, sits on the ladder and matches its file header, with no orphans.
A page shows the phone capture below the phone breakpoint and the desktop capture above it. The lightbox opens the matching full-size file.
docs/AGENTS.md, the write-docs skill and the capture README describe how to declare a viewport variant.
A finding from TALE-112 (part 1, branch perf/responsive-docs-images at d29f4bceb7eff80f629ce620e9ea8b2ce28911d3, not landed yet) that bears on folding the capture encoder in here.
Part 1 encodes the docs variants with the shared policy (AVIF 80 / WebP 90 for screens, 200 KiB per variant) from the stored /images/<section>/<shot>.webp. That file is already lossy: webp.ts writes it at quality 82 or lower (effort: 6, 190 KiB ladder). Where a shot's own width is on the docs ladder (≤ 1600 px), the WebP at that rung is the original itself, and the AVIF is re-encoded from it:
at that native rung, the AVIF is larger than the WebP original for 22 of 33 shots: 78,094 bytes in total, at most +24.9% (platform/automation-editor-canvas-mobile, 780 px);
on the downscaled rungs, AVIF is 18.1% smaller than WebP over 386 pairs (12,011,651 against 14,664,114 bytes); 9 of them are larger, by 4,435 bytes in total.
A browser that takes AVIF fetches the larger file at the native rung. Part 1 keeps AVIF everywhere, since the policy is the one the marketing site uses. When this issue folds webp.ts into @tale/ui/images/encode, encoding the original and every variant from the capture's lossless PNG in one pass removes the second lossy generation, and this overshoot with it.
Measured with a script over services/docs/public/images/optimized/ at that head.
Split for TALE-330, the task that works this issue.
TALE-330 builds the capture and the serving of phone layouts, on the feature line (branch feat/docs-viewport-screenshots):
a shot's phone capture (bun run docs:screenshots -- --devices phone, 390 × 844 at DPR 2, <shot>.phone.webp with "device": "phone" in the manifest);
its variants in bun run docs:images, through the one shared encoder;
DocsImage serving it below Tale's md breakpoint, and the lightbox opening its full-size file;
the manifest, prerender and e2e guards, and the docs for declaring one.
It commits no phone capture: capturing needs the seeded Docker Compose stack, the platform dev server and Chromium, which the agent worker does not have. The captures themselves are #5302. It lists the 108 shots that get one and the 3 that need none, with why. It also covers the phone-step fixes, a guard that every such shot has its capture, a pinned phone branch in the markdown e2e, and the alt and caption review.
TALE-330's commit closes this issue when it reaches the feature line; #5302 carries the rest.
Landed on release/0.6, the 0.6 feature line, with feature train #5329 as 6ce84b1 (feat(docs): capture and serve the phone layout of docs screenshots); it ships with Tale 0.6.0. GitHub closes issues only for commits on main, so the feature-train role closes this one. Board task: TALE-330.
Activity
tale-code-bot commentedon Nov 1, 2026
A finding from TALE-112 (part 1, branch
perf/responsive-docs-imagesatd29f4bceb7eff80f629ce620e9ea8b2ce28911d3, not landed yet) that bears on folding the capture encoder in here.Part 1 encodes the docs variants with the shared policy (AVIF 80 / WebP 90 for screens, 200 KiB per variant) from the stored
/images/<section>/<shot>.webp. That file is already lossy:webp.tswrites it at quality 82 or lower (effort: 6, 190 KiB ladder). Where a shot's own width is on the docs ladder (≤ 1600 px), the WebP at that rung is the original itself, and the AVIF is re-encoded from it:platform/automation-editor-canvas-mobile, 780 px);A browser that takes AVIF fetches the larger file at the native rung. Part 1 keeps AVIF everywhere, since the policy is the one the marketing site uses. When this issue folds
webp.tsinto@tale/ui/images/encode, encoding the original and every variant from the capture's lossless PNG in one pass removes the second lossy generation, and this overshoot with it.Measured with a script over
services/docs/public/images/optimized/at that head.tale-code-bot commentedon Nov 2, 2026
Split for TALE-330, the task that works this issue.
TALE-330 builds the capture and the serving of phone layouts, on the feature line (branch
feat/docs-viewport-screenshots):bun run docs:screenshots -- --devices phone, 390 × 844 at DPR 2,<shot>.phone.webpwith"device": "phone"in the manifest);bun run docs:images, through the one shared encoder;DocsImageserving it below Tale'smdbreakpoint, and the lightbox opening its full-size file;It commits no phone capture: capturing needs the seeded Docker Compose stack, the platform dev server and Chromium, which the agent worker does not have. The captures themselves are #5302. It lists the 108 shots that get one and the 3 that need none, with why. It also covers the phone-step fixes, a guard that every such shot has its capture, a pinned phone branch in the markdown e2e, and the alt and caption review.
TALE-330's commit closes this issue when it reaches the feature line; #5302 carries the rest.
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
tale-code-bot commentedon Nov 2, 2026
Landed on
release/0.6, the 0.6 feature line, with feature train #5329 as 6ce84b1 (feat(docs): capture and serve the phone layout of docs screenshots); it ships with Tale 0.6.0. GitHub closes issues only for commits onmain, so the feature-train role closes this one. Board task: TALE-330.feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots
feat(docs): capture and serve the phone layout of docs screenshots