# Staff dashboard screenshot gallery

Browse 52 screenshots captured from the working CareTrack dashboard in Microsoft Edge with a local synthetic D1 dataset. The collection includes 43 desktop and 9 mobile captures, covering monitoring, patients, alerts, staff, account settings, access boundaries, and empty, validation, and error states.

The gallery interface supports English and French. Captures retain their original language: 48 are English and 4 are French. Search reads both languages. Category, layout, capture-language, search, and viewer selections persist in the URL.

The gallery follows the dashboard's existing Inter typography, logo, and blue and neutral colors. Both screenshot collections use `../assets/shared/gallery.css` for the shell, controls, and viewer styles. They use `../assets/shared/gallery.js` for rendering, bilingual search, filters, URL state, and the viewer. The page's `gallery.css` imports the shared stylesheet, and `gallery.js` supplies staff metadata and collection links. Native-select chevron spacing lives in `../assets/shared/select.css`. The project design system remains defined in [DESIGN.md](../../../DESIGN.md).

## Open the gallery

From the repository root, run:

```sh
pnpm screenshots:serve
```

Open [the staff gallery](http://localhost:8083/admin/) or [the patient app gallery](http://localhost:8083/). With VS Code Live Server serving the repository, open [the staff gallery on port 5500](http://127.0.0.1:5500/docs/iphone-gallery/admin/).

You can also open `index.html` directly. Copy the entire `docs/iphone-gallery` directory to deploy both galleries to a static host. Viewing requires no build step.

Open a screenshot to scroll the full page, switch to actual-size zoom, or download its WebP image. Use the arrow keys to move between filtered screenshots when zoom is off. Escape closes the viewer and restores focus. The ZIP download includes every full-size image and `catalog.json`.

## Reproduce browser captures

Use the installed repository dependencies and run:

```sh
pnpm screenshots:admin:seed
```

This command resets only `/tmp/caretrack-admin-gallery-d1`. It applies the real migrations, uses Better Auth password hashing, and seeds 100 fictional patients and 4 staff accounts with 28 days of synthetic history. Monitoring states use the project's configurable demo rules. The script does not connect to remote D1 or change Cloudflare resources.

Start the API and web app in separate terminals:

```sh
pnpm screenshots:admin:api
```

```sh
pnpm screenshots:admin:web
```

Open [the local dashboard](http://localhost:3005/). The API runs on `localhost:3004` against the same temporary store. Account emails are defined in `packages/api/src/demo/seed.ts`; the local fixture password is defined in `scripts/admin-gallery-local.ts`.

Use a real browser to capture the routes and states listed in `catalog.json`. Desktop captures are 1462 pixels wide; mobile captures are 390 pixels wide. Preserve the source filenames and bilingual metadata in a capture directory containing JPEG images and `catalog.json`. Capture full pages where relevant, and exclude credential-bearing results. The original capture directory for this collection is `/tmp/caretrack-admin-captures`, outside the repository.

## Regenerate images and downloads

With Python and Pillow installed, run:

```sh
python3 docs/iphone-gallery/admin/optimize.py /path/to/captures
pnpm exec oxfmt --write docs/iphone-gallery/admin/data.js docs/iphone-gallery/admin/catalog.json
```

The optimizer writes lossless full-size WebP images, smaller previews, image metadata, and `caretrack-admin-screenshots.zip`. Full-size WebP images preserve the decoded source JPEG pixels. Desktop previews show the top of the page at 960 × 600 without cropping horizontally. Mobile previews are 390 × 844.

The current files have these measured sizes:

| Files                 |     Bytes |
| --------------------- | --------: |
| Full-size WebP images | 8,827,236 |
| WebP previews         | 1,163,848 |
| All gallery images    | 9,991,084 |
| Download ZIP          | 8,834,525 |

The optimizer prints the screenshot count and combined image bytes. To refresh the individual totals after regeneration, run:

```sh
python3 - <<'PY'
from pathlib import Path
root = Path("docs/iphone-gallery/admin")
for folder in ("screens", "previews"):
	files = list((root / "assets" / folder).glob("*.webp"))
	print(folder, len(files), sum(path.stat().st_size for path in files))
print("zip", (root / "caretrack-admin-screenshots.zip").stat().st_size)
PY
```

## Verify the gallery

From the repository root, run:

```sh
pnpm screenshots:check
pnpm exec oxlint docs/iphone-gallery/admin/gallery.js docs/iphone-gallery/admin/data.js docs/iphone-gallery/assets/shared/gallery.js
pnpm exec oxfmt --check docs/iphone-gallery
```

`screenshots:check` runs strict JavaScript type checks for both gallery adapters and the shared engine, then runs both asset verifiers. It checks patient and admin metadata, image dimensions, measured sizes, ZIP contents, shared shell wiring, and admin coverage. To compare every full-size image with its original decoded pixels, run:

```sh
python3 docs/iphone-gallery/admin/verify.py --source /path/to/captures
```
