skills(headless-screenshot): document two false-positive traps
Hit both today doing a live QA pass on the gateway: plain nixpkgs#chromium has no color-emoji font (tofu boxes read exactly like a missing-icon bug), and a page whose content loads async after the initial paint (SSE, fetch-on-mount) screenshots as a bare "loading..." placeholder without --virtual-time-budget. Neither is a real product bug, but both need a documented fix for when an accurate render actually matters, not just "know to discount it."
This commit is contained in:
parent
6a95aceedb
commit
3b9e54d028
1 changed files with 33 additions and 0 deletions
|
|
@ -69,3 +69,36 @@ question is genuinely about *behavior*, not appearance. A missing
|
|||
emoji/glyph rendering as a box in the screenshot is usually a font
|
||||
availability artifact of the headless environment, not a real bug -
|
||||
don't mistake one for the other when reporting results.
|
||||
|
||||
## Two false-positive traps (and their fixes)
|
||||
|
||||
Both of these look exactly like a real product bug in a naive
|
||||
screenshot and aren't - check for them before filing anything, and
|
||||
use the fix below if you actually need an accurate render (e.g. to
|
||||
judge icon/glyph layout, not just to note "there'd be an icon here").
|
||||
|
||||
- **Tofu boxes instead of emoji.** Plain `nixpkgs#chromium` has no
|
||||
color-emoji font, so any 🖥/📡/🔨-style glyph renders as an empty
|
||||
box. Add `nixpkgs#noto-fonts-color-emoji` to the `nix shell` - but a
|
||||
`FONTCONFIG_FILE` that lists *only* the emoji dir throws away the
|
||||
base fonts and blanks all normal text instead, which is its own
|
||||
false alarm. Merge, don't override:
|
||||
```
|
||||
cat > fonts.conf <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<include ignore_missing="yes">/etc/fonts/fonts.conf</include>
|
||||
<dir>$(nix eval --raw nixpkgs#noto-fonts-color-emoji)/share/fonts</dir>
|
||||
</fontconfig>
|
||||
EOF
|
||||
FONTCONFIG_FILE=$PWD/fonts.conf nix shell nixpkgs#chromium nixpkgs#noto-fonts-color-emoji \
|
||||
--command chromium --headless=new --disable-gpu --no-sandbox \
|
||||
--screenshot=out.png --window-size=1440,900 "https://example/"
|
||||
```
|
||||
- **A bare "loading..." placeholder instead of real content.** A page
|
||||
whose content arrives after the initial paint (SSE, a `fetch` on
|
||||
mount) can get captured before that data lands - the default
|
||||
`--screenshot` doesn't wait for it. Add
|
||||
`--virtual-time-budget=8000` (milliseconds; tune to the page) to let
|
||||
it actually settle first.
|
||||
|
|
|
|||
Loading…
Reference in a new issue