# Rollout — the Go Around reload animation

*Designer, 12 Nov 2026. Replaces the propeller loader and the old refresh arrow.*

A small runway seen from above. Threshold bars ("piano keys") sit on the left and a short bar marks the runway end on the right. There is no logo and no spinner.

- **Loading:** the centreline dashes roll past one stripe at a time (32px every 640ms on the site ease `cubic-bezier(.32,.72,0,1)`). Each step speeds up and then settles, so it reads as a cadence rather than a spinner.
- **Done:** the dashes finish the stripe they are on and stop dead on the pattern, with no jump. The threshold bars then cross-fade to the result colour:
  - GO `#22C55E`
  - CAUTION `#FF8A00` (cached data)
  - NO-GO `#F80F3B` (failure — the live region still says "No update · tap to retry")
- **Optional status label:** JetBrains Mono, uppercase, `.08em`, tabular numbers. Default copy is "Refreshing", then "Updated 12:32Z", "Cached · 12:32Z", or "No update · tap to retry". Pass `labels: false` to hide the line (the videos below were recorded this way). The live region still updates for assistive tech.
- **Icon size (refresh button, 24×14):** the same runway as an outline glyph. At rest it is the refresh icon, so there is no separate arrow. On a tap the dashes roll, and on success the bars go green and fade back to ink after 1.2s.
- **Reduced motion:** nothing moves. The label (if shown) and the bar colour still change.
- **Motion budget:** only `transform` (the strip) and `opacity` (the colour layer and labels) animate. No backdrop-filter, `contain:paint` on the runway, `will-change` only while it loads.

## Four live site themes

Tokens are copied from [`DESIGN.md`](../../DESIGN.md) §6.1 (Theme 1–4). These are the live Wingmam palettes, not the landing-brand Pearl `#FAF9F5` / Midnight `#08090A`.

| Theme | `theme` / class | `html` attributes | `--bg` | `--bg2` | `--tx` | `--pill` | `--ln` | `--hl` |
|---|---|---|---|---|---|---|---|---|
| 1 Midnight | `midnight` / `.gar--midnight` | `data-theme=night data-pal=black` | `#000` | `#000` | `#F5F5F7` | `rgba(30,32,40,.52)` | `rgba(255,255,255,.10)` | `rgba(255,255,255,.16)` |
| 2 Amethyst | `amethyst` / `.gar--amethyst` | `data-theme=night data-pal=purple` | `#0B0716` | `#1A0F33` | `#F7F4FF` | `rgba(46,26,84,.5)` | `rgba(210,190,255,.13)` | `rgba(230,215,255,.20)` |
| 3 Pearl | `pearl` / `.gar--pearl` (default) | `data-theme=day data-pal=white` | `#F2F2F5` | `#E9E6F0` | `#111114` | `rgba(250,251,255,.62)` | `rgba(0,0,0,.07)` | `rgba(255,255,255,.95)` |
| 4 Champagne | `champagne` / `.gar--champagne` | `data-theme=day data-pal=beige` | `#F4EEE3` | `#E9DFCC` | `#1C1814` | `rgba(252,245,233,.68)` | `rgba(60,40,10,.08)` | `rgba(255,253,248,.95)` |

Status colours are the same in every theme: GO `#22C55E` · CAUTION `#FF8A00` · NO-GO `#F80F3B`. Accents (`#6B78FF` night, `#0019C9` day) are not used in this component.

The runway markings use `--tx` for ink, `--ln` for the hairline, `--hl` for the inset highlight, and a faint surface wash (`--gl2` on the night themes, a light ink wash on the day themes). Page backgrounds in the demos use the official body paint `radial-gradient(120% 60% at 50% -10%, var(--bg2), var(--bg) 70%)` (solid `#000` on Midnight). Refresh-button chrome uses `--pill`, `--hair`, `--hl`, `--sh1`, `--sh2` from the same table.

## API

```html
<link rel="stylesheet" href="ga-reload.css">
<script src="ga-reload.js"></script>
<div id="ld"></div>
<script>
const ld = GAReload.mount(document.getElementById('ld'), {
  theme: 'auto',              // 'auto' (follow html[data-theme][data-pal]) | 'midnight' | 'amethyst' | 'pearl' | 'champagne'
  size: 'page',               // 'page' (default) or 'icon'
  label: 'Refreshing data',   // starting live-region text
  labels: true                // false hides the status line
});
ld.start();
fetch('/api/metar')
  .then(() => ld.done({status: 'go'}))       // or 'cau' for cached
  .catch(() => ld.done({status: 'nogo'}));
</script>
```

`GAReload.mount(el, options)` returns:

| Method | What it does |
|---|---|
| `start(label?)` | Starts the centreline roll. Optional label overrides the mount default. |
| `done({status, label})` | Finishes the current stripe, then cross-fades the threshold bars to `status` (`'go'` \| `'cau'` \| `'nogo'`). Optional `label` replaces the default copy. |
| `reset()` | Clears motion and colour back to rest. |
| `unmount()` | Cancels all animations, empties the element and removes everything `mount()` added. |
| `setTheme(name)` | Switches between the four themes without remounting. |

The element carries `role="status"`, `aria-live="polite"` and `aria-busy`. With no `label` given, `done()` writes the default copy with the current UTC time (`HH:MMZ`).

## Files

| File | What |
|---|---|
| `ga-reload.css` | Component styles: page size, `.gar--icon`, `.gar--nolabel`, and the four theme classes |
| `ga-reload.js` | The API above |
| `demo.html` | Interactive 2×2 of all four themes, with GO / Cached / NO-GO and a labels toggle |
| `demo-clean.html?theme=` | No writing at all — used to record the clips. `theme` is one of the four names |
| `demo-midnight.html`, `demo-amethyst.html`, `demo-pearl.html`, `demo-champagne.html` | Shortcuts to the clean page for each theme |
| `demo-4clean.html` | No-writing 2×2, used to record the grid |
| `out/clean-midnight.mp4`, `clean-amethyst.mp4`, `clean-pearl.mp4`, `clean-champagne.mp4` | 6s, 1080×1920, 30fps, two cycles (load → settle on a stripe → bars go green → hold → repeat) |
| `out/clean-4themes.mp4` | The same four, in sync, as a 2160×3840 2×2 (Midnight, Amethyst / Pearl, Champagne) |
| `out/clean-4themes.png` | Still of the grid at 2.40s (bars fully green) |
| `out/clean-4themes.gif` | 720×1280, 15fps, 6s, well under 8MB |
| `render-clean.py` | Re-renders the clips frame by frame (`?render=1` + `window.seek(t)`), same encoder as the earlier 4s demos (libx264, yuv420p, crf 14, preset slow) |

The earlier 4s Pearl / Midnight clips in the working folder used the landing-brand backgrounds (`#FAF9F5` / `#08090A`) and still had titles and status copy. These clean four-theme renders replace them for reviewing the animation itself.

## Use in the app

Map the live `html` attributes to the component theme:

```js
function rolloutTheme(root) {
  const t = root.getAttribute('data-theme');
  const pal = root.getAttribute('data-pal');
  if (t === 'night' && pal === 'purple') return 'amethyst';
  if (t === 'night') return 'midnight';
  if (t === 'day' && pal === 'beige') return 'champagne';
  return 'pearl';
}
```

## Update 12 Nov — big runway only (MT)

MT asked to keep the big runway and remove the small runway outline (the refresh-button icon) that sat above it in the review clips. The new clips show only the big runway animation, centred, with no text and no icon:

| File | What |
|---|---|
| `out/rollout-noicon-midnight.mp4`, `-amethyst.mp4`, `-pearl.mp4`, `-champagne.mp4` | One clean clip per theme, 1080×1920, 30fps, 6s (two 3s cycles) |
| `out/rollout-noicon-4themes.mp4` | The four in sync as a 2×2 (Midnight, Amethyst / Pearl, Champagne), 2160×3840, no labels, no icon |
| `out/rollout-noicon-4themes.png`, `.gif` | Still at 2.40s (bars green) and a 720px GIF |
| `demo-4clean-noicon.html`, `render-noicon.py` | The render stage and script for these clips (same encoder: libx264, yuv420p, crf 14, preset slow) |

The component, motion and quality are unchanged. The icon size (`size:'icon'`) still exists in the code for the refresh button; it is just no longer shown in the review clips. The older `clean-*` clips are kept for comparison.

— Designer

## Audit fixes — 12 Nov (same look, big runway only, no text)

1. **Restart from any state.** `start()` now clears the old run, cancels the roll, removes `is-loading`/`is-done`, forces a reflow and starts the roll from stripe 0, so `start()` straight after `done()` (no `reset()`) rolls again. A run token stops a late "stripe finished" callback from touching a newer run. The verdicts clip loops start → done → start with no reset, which proves it.
2. **Contrast and colour-blind safety.**
   - On the day themes (Pearl, Champagne) the status tints are deeper so the threshold marking clears 3:1 on the runway surface: GO `#15803D`, CAUTION `#B45309`, NO-GO `#D10D33` (about 3.5–4.6:1). The night themes keep `#22C55E` / `#FF8A00` / `#F80F3B` (about 4.4–8.7:1).
   - The verdict is carried by shape as well as colour, with no text:
     - **GO:** all six threshold bars lit.
     - **CAUTION:** only every second bar lit (the others stay faint).
     - **NO-GO:** the threshold gives way to a crossed **X**, the real closed-runway marking. It settles in from 0.86 scale.
3. **Code fixes.**
   - The icon's fade-in and fade-back used to be two `fill:both` animations on the same node, so the second overrode the first and the colour jumped in. Each node now gets one keyframe animation (in 320ms, hold, back to ink over 600ms).
   - New `unmount()` cancels every animation, empties the DOM and removes the classes and ARIA attributes it added. The component uses no listeners or timers.
   - Themes now follow the live site's attributes from `site/index.html`:

| Theme | `html` attributes |
|---|---|
| Midnight | `data-theme="night" data-pal="black"` (or plain `night`) |
| Amethyst | `data-theme="night" data-pal="purple"` |
| Pearl | `data-theme="day"` (`data-pal="white"` or none) |
| Champagne | `data-theme="day" data-pal="beige"` |

   `theme:'auto'` (the new default) follows these. An explicit `theme:'midnight'` etc. or `setTheme()` still wins, and `[data-theme=midnight|amethyst|pearl|champagne]` still works as a fallback for demos.

New review clips (6s, two 3s cycles, libx264 crf 14):

| File | What |
|---|---|
| `out/rollout-noicon-4themes.mp4` / `.png` / `.gif` | 2×2 of the four themes, big runway only, GO |
| `out/rollout-noicon-<theme>.mp4` | One clip per theme |
| `out/rollout-noicon-verdicts.mp4` / `.png` | GO / CAUTION / NO-GO side by side, Pearl (top) and Midnight (bottom), 3244×2162, hairline between cells |
| `out/rollout-noicon-verdicts-pearl.mp4`, `-midnight.mp4` | The same, one row each (3244×1080) |
| `demo-verdicts.html`, `render-verdicts.py` | Stage and script for the verdicts clip |

### Wiring scope (for Go Around)

Wiring this in needs only **`site/index.html`** plus the two component files, **`ga-reload.css`** and **`ga-reload.js`**. Include them, mount on the refresh button (`size:'icon'`) and any loading panel, and call `start()` / `done({status})` around the existing fetch. Leave `theme` unset so it follows `html[data-theme][data-pal]`. No protected or engine files are involved: **never touch `gate.ts`, `appdata/`, auth, `wm-pin.js` or `site/wm-core.js`.** Wiring still needs MT's yes.

— Designer

## Lift on content, verdict later — 12 Nov (MT)

MT: the loading cover must lift **as soon as the page content has loaded**, never held for the colour verdict. The verdict then arrives on its own, with zero added wait.

### API (backward compatible)

```js
const ld = GAReload.mount(el, {
  labels: false,
  cover: document.getElementById('wm-cover'),   // optional: the element that hides the page while loading
  dock:  document.querySelector('.wm-reload-dock') // optional: where the runway flies to when the cover lifts
});
ld.start();                                   // cover up, runway rolling
ld.ready();                                   // content is in: runway fades out in place (120ms), then the cover fades (280ms); the runway re-appears in the dock and keeps rolling
ld.verdict({status: 'go' | 'cau' | 'nogo'});  // any time later (or earlier): verdict settles in place / in the dock
```

| Method | Returns | What |
|---|---|---|
| `ready()` | `Promise<true>` once the lift has settled (`{interrupted:true}` if a `start()`/`reset()`/`unmount()` cancelled it) | Lifts `cover` at once: the runway fades out in place in 120ms while the cover is still opaque, then the cover fades (280ms), so the big runway never sits over the content. With `dock` the runway re-appears already in the dock's box (it moves only while invisible, so it never crosses the page) and keeps rolling. Without `dock` it is simply gone before the cover fades. Calling it again is a no-op. |
| `verdict({status,label})` | `Promise<{status}>` once the verdict has settled | Finishes the current stripe, then shows the colour and shape. It is independent of `ready()`. |
| `done({status,label})` | `Promise<{status}>` once everything has settled | Old behaviour, kept for compatibility: the verdict first, then (only if a `cover` was given and `ready()` wasn't called) the cover lifts. |

- Promises never reject. If a newer `start()` or `reset()` interrupts them, `verdict()`/`done()` resolve with `{status, interrupted:true}` and `ready()` with `{interrupted:true}`.
- Audit v3 fixes (12 Nov 2026): interrupted `ready()` now resolves `{interrupted:true}`; `done()` with a cover and no dock fades the runway out before the cover (no GO runway over the cards); the dock move no longer flies across the search field (fade out in place, re-appear in the dock).
- `start()` and `reset()` put the cover and the runway back.
- `unmount()` also restores the cover.
- Reduced motion: no flight or fades; everything jumps to its end state and the promises resolve at once.

### GO now has its own shape

GO adds the **aiming-point (touchdown) markings**, two solid blocks either side of the centreline that grow in from the threshold side. Loading never shows them, so GO no longer looks like the loading state, even with reduced motion and colour blindness:

- **GO:** all threshold bars plus the aiming-point markings.
- **CAUTION:** every second bar lit.
- **NO-GO:** the crossed X closed-runway marking.

### Before / after (iPhone 390×844 @3×, same timeline in both halves)

The simulated timeline: the content loads at 1.20s and the verdict arrives at 2.60s.

- **Before** (`done()`, cover held for the verdict): the page shows at about **3.7s**. The runway now fades out before the cover, so it never sits over the cards.
- **After** (`ready()` at content load, `verdict()` later): the page shows at about **1.37s** (120ms later than v3, the price of never putting the runway over the content). The runway fades out in place, re-appears in the header dock without crossing the search field, and the GO verdict settles there when it arrives.

The elapsed time and the "Before" / "After" labels are in the margins only; the component carries no text. The page underneath is a sample mock.

| File | What |
|---|---|
| `out/rollout-before-after-pearl.mp4`, `-midnight.mp4` | 2700×2874, 5s, 30fps |
| `out/rollout-before-after-pearl.png`, `-midnight.png` | Stills at 2.0s |
| `demo-before-after.html?theme=pearl\|midnight`, `render-before-after.py` | Stage and renderer |

`out/rollout-noicon-verdicts*.mp4`/`.png` and `out/rollout-noicon-4themes*` were re-rendered with the new GO shape.

### Wiring note for `site/index.html` (Go Around, after MT's yes)

Only `site/index.html` plus `ga-reload.css` and `ga-reload.js` are needed:

1. Mount once with `cover` set to the page's loading cover. Set `dock` to a small header slot about 96×21px, or leave it out so the runway just fades.
2. Call `start()` when navigation or a refresh begins.
3. Call **`ready()` the moment the page content is rendered** (the first data paint), not when the verdict is known.
4. Call **`verdict({status})` when the verdict arrives**: `'go'` for fresh data, `'cau'` for cached or stale data, `'nogo'` when the fetch failed.
5. Leave `theme` unset so it follows `html[data-theme][data-pal]`.

Never touch `gate.ts`, `appdata/`, auth, `wm-pin.js` or `site/wm-core.js`.

— Designer

## NEXT SESSION — from Designer

This is a design component in the design library only. It is **not** on the site, and this pull request must not be merged or deployed until MT says yes.

When MT says yes, **Go Around** needs to swap Rollout in for the current refresh treatment in Wingmam:

1. Replace the current refresh icon and `wm-refresh-fx.js` (the propeller / existing refresh effect) with `ga-reload.css` + `ga-reload.js`.
2. On a refresh tap or a data fetch, call `start()`. When the data lands, call `done({status:'go'|'cau'|'nogo'})`. Use `'cau'` for cached data and `'nogo'` when the update fails.
3. Drive the theme from the live `html[data-theme][data-pal]` pair, using the map above, and call `setTheme()` when the user changes theme.
4. Honour `prefers-reduced-motion` (already built in: no movement, colour and label still change).
5. Decide with MT whether the in-app loader shows the status line ("Updated 12:32Z") or runs with `labels: false` like the review clips. The icon-size glyph never shows a label.
6. Check the 24×14 icon on a real phone. At button size only about one and a half dashes show, which is expected.
7. Do not touch `gate.ts`, `appdata/`, auth, `wm-pin.js`, or `site/wm-core.js`. Do not push, merge, or deploy this yourself.

Until that swap, the clips and demos in this folder are the review copies.

Designer
