# RTF preview comparison

Run the real web app separately at base 3763606d20cd834ebfb419ef1525695b397af793 and head 4df50fd3f7c1f1c8794285649360547cd52bc1ae. Use a fresh isolated data directory for each, T3CODE_DEV_SEED=0, and the same synthetic files. No real user database is used.

The sample.fodt document has superscript and subscript at 80% relative size, plus a 58% default-size control. Export it with LibreOffice 24.2.7.2:

```sh
soffice --headless --convert-to 'rtf:Rich Text Format' --outdir OUTPUT sample.fodt
```

The resulting sample.rtf contains updnprop8001 with up4 and dn1, and super/sub for the control.

Place seed-rtf-proof.ts under scripts/ in the runner checkout. With the server ready, run:

```sh
node scripts/seed-rtf-proof.ts DATA_DIRECTORY WEB_ORIGIN metadata.json sample.rtf
```

It uses the repository's real project/thread API and Replay multi-turn provider. If the app checkout differs from the runner checkout, set T3_SCENARIO_APP_DIR to that checkout.

Browser driver, repeated on each side through T3 Code's preview tools:

1. Use a 1280 x 800 Chromium viewport, light theme, device scale factor 2, document reading size 100%.
2. Sign in to the isolated server using its browser-dev-token and POST /api/auth/browser-session, then navigate to the thread URL from metadata.json.
3. Wait for 'fixture turn complete'.
4. Press Control+p and fill input[placeholder="Search files…"] with writer-position.rtf.
5. Wait for [role="option"] strong (the search has resolved), then click [role="option"].
6. Wait for '1 page'. Click button[aria-label="Maximize panel"] and button[aria-label="Hide file explorer"].
7. Take two screenshots 500 ms apart. Compare decoded pixels and retain only an identical pair. Inspect the capture.

Observed base: both 80% digits are on the baseline; default-size control is correctly raised/lowered.
Observed head: both 80% digits are correctly raised/lowered; surrounding text remains on the normal baseline, and the control remains correct.
