Skip to content
  1. Docs
  2. Apps
  3. Developers

Visual capture and review

How app screenshots are captured at four window sizes in both themes, in an isolated session, and how to review them properly.

Automated tests cannot tell you whether an app looks right. enzim apps are therefore checked visually as well: captured at several window sizes in both themes, in an isolated session, and then looked at by a person. This page describes the shared capture harness, the per-app QA launchers and the review rules.

The capture matrix

The shared capture harness photographs the same app at four viewport sizes in both light and dark themes, eight shots per run:

RungSizeWhat it tests
desktop1400 × 900the design target
laptop1024 × 768whether the sidebar still fits
tablet768 × 1024portrait; where two-pane layouts must collapse
mobile375 × 812the narrow phone width where layouts break first

Apps get four rungs, not two, because an app has layout structure (sidebars, split panes, toolbars, tables) that has to reorganise at certain widths, and the interesting failures live at those widths.

Each run writes, for every rung and theme, a PNG plus a JSON provenance sidecar, and a diagnostics log. The sidecar records a fingerprint of the framework's shipping source and palette at capture time, so a stale committed screenshot is detected rather than silently differing from a fresh capture.

Gates the harness enforces

Every gate is fatal:

  • the window must reach the exact expected size before capture (a real check, not a sleep);
  • no shot may be missing, blank or the wrong size;
  • the dark and light shots of the same rung must not be byte-identical.

The harness also refuses a binary that is older than any of its build inputs: app sources, framework sources, the pinned iced fork, the manifest and lockfile. A quick launch gate answers the cheaper question first: does the app map a window of the right size, paint, stay alive and log no panic?

Isolated state

Every capture runs against a pristine, per-run HOME and XDG tree, never the real home directory. That makes every capture a deterministic first run and keeps personal data and local paths out of published images.

An empty app can make a poor screenshot, so an app may commit an optional seed: a shots-fixture/ directory laid out as it would appear under $HOME, copied into the sandbox before the first shot.

Per-app settings come from a tracked capture.env at the app root. It names the binary and window size and can pass app-specific variables, for example a fixture library:

sh
CAPTURE_APP=enz-calculator
CAPTURE_SIZE=1100x850
sh
# Music: an exclusive fixture library that disables persistence
MUSIC_APP_LIBRARY_DIR=fixture-library
CAPTURE_REQUIRE=settled
MUSIC_APP_SCAN_SETTLED=1

Per-app QA launchers

Most apps also ship tools/visual.sh and tools/qa-launch.sh for interactive checks in a nested Wayland session. The QA launcher creates a private HOME, XDG directories, runtime directory and session bus, so it never touches the ordinary account configuration. Variables select the variant under test, for example:

AppVariables
MailMAIL_QA_DEMO=inbox or none, MAIL_QA_THEME=light or system, MAIL_QA_LOCALE
TextTEXT_QA_LOCALE, TEXT_QA_LANGUAGE, TEXT_QA_THEME, TEXT_QA_TEXT_SCALE
Task ManagerTASK_MANAGER_QA_THEME=light or dark, TASK_MANAGER_QA_LOCALE

Capture windows by their application identity (for example app_id=io.github.enzui.Text) and record the identity metadata with the image. Raw captures, logs and sandbox homes are disposable and stay out of Git; only concise identities, hashes and results are kept as a record.

How to review a screenshot

The automated tree audits (enabled with ENZUI_DIAGNOSTICS=1) walk registered widgets for accessibility, bounds and overlap problems. They are useful gates against crashed apps and registered tree defects, but they are not screenshot analysis. A known capture with a button clipped by the window edge passes all three audits. bounds: clean is not evidence that nothing is clipped.

Go edge by edge, not middle-out:

  1. Clipping. Any glyph, icon, border or focus ring meeting a container or window edge, especially at 375 px.
  2. Truncation versus clipping. An ellipsis is correct behaviour; a glyph sliced mid-stroke is a bug.
  3. Alignment of baselines, shared left edges and centring.
  4. Spacing rhythm between visually parallel rows.
  5. Overflow and reflow at narrow widths: wrapping, overlap, vanishing content.
  6. Contrast in both themes, including disabled and tertiary controls in light theme.
  7. State coherence: hover, pressed, focused and disabled states are visibly distinct.

Report each finding with the file and location, and never invent measurements.

Hover is not selection

The harness leaves the pointer somewhere, so exactly one widget in each shot is in its hover state, and hover looks a lot like selection. A highlight that stays at the same screen position while the window width changes is pointer-driven; a real selection follows its row. Moving the pointer and re-reading the pixel settles it. Parking the pointer in an empty corner before capturing avoids the problem.

Window size is a request

An app's declared initial window size is a request, not a command. A tiling compositor ignores it. Every app must stay correct at whatever size the compositor grants, which is exactly what the mobile rung tests. An app that declares a size must track resize events and base its layout on the tracked size, never on the declared one.