Files
DarkRoom/tools/manual/README.md
T
dtourolle c41f99ea52 Record the manual's scenes by name, and each against what it depends on
scenes.py aimed every press at window pixels, and the develop column had
already moved under it: Compose now sits above Adjust, so the old
exposure coordinate lands on a straighten slider. Every scene now names
what it presses by its accessible label through the automation hook,
places points on the photograph relative to the canvas, and opens its
photographs by file name. Each starts from a known place and undoes what
it did, so one can be recorded alone; the few that continue another's
state name it, and running one runs that first into a scratch folder.

Each scene also declares the pictures it makes and the sources they
depend on. `record.sh --check` fails when the manual shows a picture no
scene makes, or a scene makes one it does not show; it reads two files.
`record.sh --changed` re-records the scenes whose sources, or own code,
changed since the commit that last touched their pictures. record.sh
builds with the automation feature, restores the library from
DR_LIBRARY_SNAPSHOT, starts from a fresh profile and pins inference to
the CPU; the launch screen is recorded from an empty profile of its own.

Re-recorded with the ported scenes, and looked at frame by frame. What
differs from the pictures they replace:
- develop, presets, settings, local, compose, film, wb, light: the
  current develop column (Compose with Vertical and Horizontal above
  Adjust, the Label button), otherwise the same moments.
- library pictures: the filter bar's colour-label chips; no collection
  left over from an earlier run in the sidebar; library-selection is the
  twelve alpine frames rather than eight of them and four New York ones.
- library-rating rates two frames nobody had rated, so the stars are set
  and not cleared.
- develop-zoom goes on past 1:1 with the wheel and ends on the file's
  pixels as hard-edged blocks.
- repair covers a real mark on the road, with a size that fits it; film
  is shown on the Chinatown frame instead of the road.
- panorama tries Perspective, Spherical and Cylindrical before filling.
- launch, launch-folder and panorama-aligned came out byte-identical.
2026-09-25 07:26:36 -04:00

54 lines
2.5 KiB
Markdown

# tools/manual — the pictures in docs/manual
`record.sh` drives the desktop build on a private X server and records the
scenes in `scenes.py` into `docs/manual/media/`:
```bash
tools/manual/record.sh /var/tmp/dr-demo/library # every scene
tools/manual/record.sh /var/tmp/dr-demo/library develop_zoom # one, and what it needs
tools/manual/record.sh --changed /var/tmp/dr-demo/library # those whose sources moved
tools/manual/record.sh --check # the manual and the scenes agree
tools/manual/record.sh --list
```
Set `DR_LIBRARY_SNAPSHOT` to a pristine copy of the library: a recording
rates, files and merges, and the snapshot is copied over the library first.
Each run starts from a fresh profile under `DR_HOME`.
## Controls by name
The binary is built with `--features automation`, which lets the app answer
"where is the control labelled *Exposure*?" over the Unix socket named by
`DR_AUTOMATION` (`ui/dr-ui/src/automation.rs`). No other build has the
feature, and a build that has it listens only when the variable is set. The
names are the accessible labels a screen reader reads, so a scene says
`click_on('Select@Button')` or `slide('Exposure', 24)` rather than a pixel,
and survives a panel that moves. The pointer itself is still xdotool.
```bash
DR_HOME=/var/tmp/x tools/manual/drive.py launch /some/folder # a feature build in DR_BIN
tools/manual/drive.py labels # every name on screen
tools/manual/drive.py click-on 'Settings@Button'
tools/manual/drive.py ids canvas # things with no name: id:canvas-image
tools/manual/drive.py stop
```
Grid cells are named by file (`_MG_8393@ListItem`), rating stars `1 star`
to `5 stars`. What a scene cannot name — a point on the photograph, the crop
rectangle's corner — it places relative to something it can
(`drive.photo(fx, fy)`, `id:move-area`).
## Scenes and the manual
Each scene in `scenes.py` declares the pictures it makes, as the manual names
them, and the globs of the sources that could change them. `--check` fails
when the manual shows a picture no scene makes, or a scene makes one the
manual does not show; it reads two files and runs in CI. `--changed`
re-records a scene when one of its sources, or its own code, has changed
since the commit that last touched its pictures.
Two things the scripts know that are not obvious: a Slint `TouchArea` wants
a held press, not xdotool's `click`; and the app is driven on Xvfb rather
than the desktop because under XWayland at scale 2 a pointer warp lands at
twice the coordinate asked for.