Skip to content

Commit 37f14ed

Browse files
committed
docs(FR-2650): require 2x CSS zoom for sharper screenshot captures
1 parent 4cbb4c7 commit 37f14ed

1 file changed

Lines changed: 26 additions & 4 deletions

File tree

packages/backend.ai-webui-docs/SCREENSHOT-GUIDELINES.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,41 @@ Available locale codes: `'en'`, `'ko'`, `'ja'`, `'th'`.
6767
Per-image workflow:
6868
1. Navigate to the screen, set up necessary state (open modal, fill form, populate data).
6969
2. Hide developer overlays (e.g., React Grab toolbar) once.
70-
3. Loop through the 4 languages: `switchLanguage(lang)` → take screenshot → save to `src/{lang}/images/<file>.png`.
71-
4. Move to the next screen.
70+
3. Apply 2× zoom: `document.body.style.zoom = '2'` (see [2× zoom capture procedure](#2-zoom-capture-procedure)).
71+
4. Resize viewport to fit the zoomed element.
72+
5. Loop through the 4 languages: `switchLanguage(lang)` → re-apply zoom (it can reset on language switch) → take screenshot → save to `src/{lang}/images/<file>.png`.
73+
6. Reset zoom (`document.body.style.zoom = ''`) before moving to the next screen.
7274

7375
This pattern is ~4× faster than re-navigating to `/usersettings` for each language and avoids repeating the page setup four times.
7476

7577
## Capture Standards
7678

7779
### Resolution and Size
7880

79-
- Capture at standard display resolution (not Retina/HiDPI unless necessary)
81+
- **Always capture at 2× CSS zoom for sharper text rendering** when capturing via Playwright MCP. Apply `document.body.style.zoom = '2'` and resize the viewport to fit the zoomed layout (e.g., `2000×1500` for full-page captures, or sized to the target element) before taking the screenshot. This effectively doubles the pixel density of the captured PNG without requiring a Retina display or `deviceScaleFactor` change to the browser context.
8082
- Crop to show only the relevant UI area, not the entire browser window
8183
- Include enough surrounding context for users to identify where they are in the app
82-
- Target file size: under 500KB per image where possible
84+
- Target file size: under 500KB per image where possible (2× zoom captures may exceed this for large pages — that is acceptable when text legibility benefits)
85+
86+
#### 2× zoom capture procedure
87+
88+
```javascript
89+
// 1. Apply 2× zoom to body before capture
90+
document.body.style.zoom = '2';
91+
92+
// 2. Resize viewport so the zoomed element fits
93+
// (use browser_resize with width/height roughly 2× the natural CSS dimensions)
94+
95+
// 3. Switch language and remove dev overlays as usual, then capture via element ref:
96+
// await browser_take_screenshot({ ref: '<dialog ref>' })
97+
98+
// 4. After all four language captures for a screen, reset zoom before moving on:
99+
document.body.style.zoom = '';
100+
```
101+
102+
The resulting PNG will be ~2× the natural CSS dimensions in pixels (e.g., a 450×700 modal becomes a 900×1400 PNG), giving noticeably sharper text and icons in the docs.
103+
104+
> **Note on `Match the Existing Screenshot's Framing`** (below): the framing *scope* contract is unchanged — only the pixel density doubles. A modal that was 450×700 at 1× zoom becomes 900×1400 at 2× zoom; both show the same modal-only scope.
83105
84106
### Content
85107

0 commit comments

Comments
 (0)