# Checking an app the way a person uses it

`POST https://nerdout.com/api/apps/v1/check` (with your token) runs the app in a real browser and tells you what a person would trip over. The first screen is checked for you at 360, 768 and 1280 px, light and dark, with your sample data and empty. Everything behind a tap is yours to walk with `steps`. A check with no steps has looked at one screen.

## The body

| Key | Value |
| --- | --- |
| `package`, `sampleData` | What you would push as a preview. |
| `steps` | Up to 30 steps, run in order (below). |
| `at` | Where the steps run: any of `"width"` (360, 768 or 1280), `"scheme"` (`"light"`, `"dark"`) and `"data"` (`"sample"`, `"empty"`). Default 360, light, sample. |
| `viewer` | `{ "readOnly": true }` checks what a viewer who may not change anything sees. `{ "participant": true }` checks what a Participant sees: they write only to collections with `"contribute": true`, and change only records whose `meta.createdBy` is theirs (the sample viewer's id, `00000000-0000-4000-8000-000000000001`). |
| `route` | Initial deep link the app opens with (`ctx.route`, `nerd.route`): a string like `"?tab=notes#item-1"` or `{ "query": { "tab": "notes" }, "hash": "item-1" }`. |
| `now`, `timezone` | The clock the app sees: `"now": "2026-12-24T21:30:00-08:00"`, `"timezone": "America/Los_Angeles"`. For "today", a greeting, an overdue badge, a night layout. Anchor your sample dates to the same day. |
| `screenshots` | `false` keeps only the pictures your steps name. |

## Steps

A target is `text=` plus the visible text, aria-label or placeholder of a button, link, tab, label or field (exact match first, then contains), or a CSS selector.

| Step | What it does |
| --- | --- |
| `{ "click": target }` | Taps it with the pointer. |
| `{ "type": [target, text] }` | Focuses the field (or the field of that label) and types. |
| `{ "select": [target, option] }` | Picks an option of a menu by its text or value. |
| `{ "press": "Enter" }` | A key: `Enter`, `Escape`, `Tab`, `ArrowDown`. |
| `{ "scroll": "bottom" }` | `"top"`, `"bottom"`, or a target to bring into view. |
| `{ "drag": [from, to] }` | Drags one thing onto another: a board card onto a column (`section[aria-label="Done"]`), a `reorder` grip (`text=Move Buy milk`) onto another row's grip. |
| `{ "upload": [target, "photo"] }` | Gives the file field at or around the target a sample photo (or `"document"`, a text file): `text=Add a photo`, or a form's file field by its label. |
| `{ "wait": 500 }` | Milliseconds, up to 3000. |
| `{ "screenshot": "new-note" }` | A picture with that name, and the probes run again on what is showing. |
| `{ "offline": true }` | Drops the connection: the status turns `offline` and saves fail with `offline`. `false` restores it. |
| `{ "fail": "unavailable" }` | The next save fails with that code: `unavailable`, `timeout`, `busy`, `storage_full`, `too_large`, `record_missing`. |
| `{ "integration": [name, operation, "empty"] }` | What another service answers next: an operation's `"ok"`, `"empty"` or `"failure"` sample, or `[name, "disconnect"]` for the not-connected state (https://nerdout.com/workshop/sdk/integrations.md). |
| `{ "link": ["people", "unbound"] }` | Shows a linked collection (`"scope": "link"`) before the owner has linked an app: no records, and that state in `ctx.data.links`. Also `"paused"`, `"hidden"`, and `"on"` to bring the sample records back (https://nerdout.com/workshop/sdk/links.md). |
| `{ "opened": "note:8f2c" }` | The person taps a notification the app scheduled with that `open` value: `nerd.notify.opened` listeners hear it. Screenshot after it to see the app land on the right record. |
| `{ "route": "?tab=notes#item-1" }` | Browser Back/Forward or an address bar hash change while the app is open: `nerd.route.observe` listeners hear it (also accepts `{ "query": {...}, "hash": "..." }`). |
| `{ "remote": change }` | Another member (Sam) changes the data while the app is open: `{ "op": "create", "collection": "cards", "values": {...} }`, `{ "op": "update", "collection": "cards", "match": { "title": "Ship it" }, "values": { "status": "Done" } }`, `{ "op": "remove", "collection": "cards", "match": {...} }` (`"id"` works in place of `"match"`; `"by"` names another member). |

A step that finds nothing is an `error` finding and stops the rest.

## The reply

`{ ok, browser, findings, screenshots, console, steps }`. `findings` are `{ code, severity, message, fix, where }`: fix every `error` and every warning you can. An accessibility finding (`axe.*`) names up to three of the elements it is about, each by its selector and its words, and a contrast one adds the ratio it measured (4.5:1 is the line for ordinary text). Colors are measured once motion has finished, so a message that is fading out is never the cause. `screenshots` are `{ width, scheme, data, step?, jpeg }` (base64 JPEG): look at each one. `steps` says what each step did, `{ step, action, target, matched, ok, note }`: `matched` is the element your target found, so a step that hit the wrong thing shows; `note` says when the pointer could not reach it.

## Walks every app should pass

1. **Every screen.** Open each tab, sheet and form, with a `screenshot` in each.
2. **The main form, start to finish.** Fill it in, save, and screenshot the result in the list.
3. **A save that fails.** `{ "fail": "unavailable" }`, then submit the main form and screenshot: what was typed is still there and a plain sentence says what happened.
4. **A change from someone else.** Open a record's sheet, then `{ "remote": { "op": "update", ... } }` on that record and on the list behind it, and screenshot: the screen is right, and nothing the viewer was typing is lost.
5. **The laptop.** Run the main walk again with `"at": { "width": 1280 }`: `split` shows a pane instead of a sheet, bottom tabs move to the top, and a docked bar becomes a corner control.
6. **Empty and dark.** `"at": { "data": "empty" }` and tap the empty state's action; `"at": { "scheme": "dark" }` for any screen with colors of your own.
7. **Read-only**, for shared apps: `"viewer": { "readOnly": true }` and open a record; there are no dead edit buttons. With a `"contribute"` collection, also `"viewer": { "participant": true }`: add an entry, change it, and open someone else's, which offers no edit.

An example that walks a notes app, fails a save and has Sam add a note:

```json
{ "steps": [
  { "click": "text=New note" }, { "type": ["text=Place", "Mt. Tabor"] }, { "screenshot": "new-note" },
  { "fail": "unavailable" }, { "click": "text=Add" }, { "screenshot": "save-failed" },
  { "click": "text=Add" }, { "screenshot": "saved" },
  { "remote": { "op": "create", "collection": "notes", "values": { "place": "Forest Park", "day": "2026-11-07" } } },
  { "screenshot": "sam-added-one" }
] }
```

Run the check after a round of fixes, not after every edit (30 checks per 10 minutes). If you have a headless browser of your own, `POST https://nerdout.com/api/apps/v1/render` returns the same app as a standalone HTML file (pass `route` to open at a deep link); `window.__nerdTest` there has the same `offline(on)`, `failNext(code)`, `remote(change)` and `route(next)`.

The check loads none of the app's own files (`assets`): `nerd.assets.load` rejects with `unavailable` there, so what it photographs is the app without them. Make that screen look meant, not broken. To load them in your own browser, put the render page in a frame and answer its messages as the owner's page does: the frame posts `{ type: "nerd.asset", id, sha256, name }` to its parent (again every half second until it hears back), and the parent replies to that frame `{ type: "nerd.asset", id, ok: true, bytes }` (an ArrayBuffer, transferred) or `{ type: "nerd.asset", id, ok: false, error: { code, message } }`; a parent that needs more than a few seconds first sends `{ type: "nerd.asset", id, pending: true }`.

## Main-view scrolling and mobile tabs

The live host relays iPhone status-bar taps to the active top-level SDK tab's main scroll view, or the main page when there are no tabs. It never chooses a nested list, editor, sidebar or other widget because someone touched it. A sheet, photo viewer or menu blocks this command: neither that overlay nor the page behind it scrolls.

Use document scrolling, a scrolling tab panel or its scrolling ancestor, or the kit's panes. The kit identifies its flexible main pane automatically. For a custom primary scroll container, mark exactly one element per tab (or one at the app root without tabs) with `data-nerd-scroll="main"`; give that element a bounded height and real `overflow-y: auto` or `scroll`. Do not mark secondary widgets. Hide inactive views with `hidden` or `inert`. No tap handler or private SDK hook is needed.

`ui.tabs` renders each panel once and keeps its state. Top-level tabs remember their main scroll positions independently; nested filter tabs do not move the page. On mobile, tapping the active tab again scrolls only its main view to the top. Calling `select(id)` for the active tab does nothing, and unknown IDs are ignored. `remove()` removes the tab UI and its navigation listeners; retain and call the cleanup functions returned by live content you rendered inside it.

Verify on an iPhone in Safari and installed mode: scroll two tabs to different positions, switch back, re-tap the active tab, then tap the status bar. Secondary scrollers and inactive tabs must retain their positions. Repeat with a sheet open: nothing should scroll. Repeat without tabs: only the main page moves. A preview or headless check cannot prove the native status-bar gesture.

