# Training Atlas iteration 9: overview layout survives immediate reload

The overview editor now preserves a completed layout change when the tab reloads before the local write finishes. The actual pointer-click failure was reproduced on iteration 8, then fixed in `OverviewBlocks.tsx` and replayed against the rebuilt preview service.

## Observed result

The browser changed three settings together: workout width from 6 to 12 columns, Sleep before Recovery, and Quick actions hidden. Every row below uses the same 390 × 640 viewport, synthetic account, fixture state and browser script.

| Actual operation | Iteration 8 observation | Iteration 9 observation |
|---|---|---|
| Click Done and reload within the same browser task | Intended layout survived; server matched | Intended layout survived; server matched |
| Actual pointer click on Done, then immediate reload | Width reverted to 6; Recovery preceded Sleep; Quick actions returned. Server also retained the old configuration. | Width 12, Sleep before Recovery and Quick actions hidden survived. Server matched every block. |
| Wait for the edit controls to close, then reload | Intended layout survived; server matched | Intended layout survived; server matched |

The original run records **two successful observations and one failure**. The failing pointer path is retained with its nonzero assertion exit. The candidate passes all three UI checks and all three backend preference comparisons. Both runs recorded zero browser page errors.

[Original results](before/results.json) · [Candidate results](after/results.json) · [Original execution](before/execution.txt) · [Candidate execution](after/execution.txt)

| Before: actual pointer, after reload | After: actual pointer, after reload |
|---|---|
| ![Original configuration returned after immediate reload](before/after-1.png) | ![Chosen order retained after immediate reload](after/after-1.png) |

The full intended configuration, visible block order and width, persisted preference record, revision, hidden flags and cleanup result are in the JSON evidence. The intended edit-stage screenshots are retained in both run directories.

## Source change

Done synchronously retains the exact account-scoped layout intent in this tab's session storage before invoking the existing repository write. On remount, the editor reads the preference record. A matching committed layout clears the intent; an interrupted write resumes through the existing revision-aware write. The intent clears after acknowledgement. A failed write leaves the chosen layout in the existing editor, and Cancel clears the retained action.

The existing controls, edit-mode exit, repository validation and synchronization remain in the save path. The change is confined to the overview component; the existing SetLogger implementation was not edited.

- [Exact source patch, including the browser regression](source.patch)
- [Component before this change](OverviewBlocks.before.tsx)
- [Component after this change](OverviewBlocks.after.tsx)
- [Repeatable browser test](overview-layout-immediate-reload.browser.py)

The baseline component was already present as untracked work. This patch is against its actual pre-edit contents. Other dirty work in the application repository was retained; no application files were staged or committed.

## Verification and test state

| Check | Result |
|---|---|
| Overview save/reload browser journey | 3/3 operation paths; all UI and backend values matched |
| Existing SetLogger immediate-reload browser journey | 3/3 operation paths; completed status and exact weight, reps and RPE retained |
| Existing recording unit suite | 10/10 passed |
| TypeScript | Passed |
| Production build | Passed |
| New Python regression syntax | Passed |

The SetLogger replay checked 67.5 kg × 7 at RPE 8, 70 kg × 6 at RPE 8.5, and 72.5 kg × 5 at RPE 9. All three records were subsequently read from the backend as completed. Its six synthetic records were removed.

The overview test restored the fixture's original absence of a custom layout. After each run, the backend had zero active test layout preferences and the tab had zero pending layout-intent keys. The new account was separate from the independent reviewer's account. Review verdicts and baselines were left intact.

[SetLogger results](setlogger-regression/results.json) · [Recording unit output](setlogger-unit.txt) · [TypeScript output](typecheck.txt) · [Build output](build.txt) · [Regression commands](regression-checks.json)

## Deployment

The production build was staged separately, then its assets and entry files were copied to the existing preview and main static roots. Existing assets were retained. Both actual services returned HTTP 200 and served the new entry asset; their process IDs remained unchanged.

| Entry | Static root | Process |
|---|---|---|
| Preview, port 3015 | `.state/instances/preview/web` | 229504, unchanged |
| Main, port 3001 | `apps/web/dist` | 1548898, unchanged |

Main uses Google sign-in with developer authentication disabled. Its actual entry loaded the new build and the ready sign-in screen at 390 × 640 and 1440 × 900, with zero page errors and no horizontal overflow. The authenticated layout and training journeys ran on the new preview account.

[Deployment before/after](deployment.json) · [Main ready-state observations](main-ready.json) · [Main mobile](main-ready-390.png) · [Main desktop](main-ready-1440.png)

The first main-fixture setup read found no development secret; no fixture was created on main. Reading the existing configuration established its Google-only mode. An initial main screenshot caught the loading state; the later ready-state capture waits for the sign-in screen. Both observations are preserved in [setup observations](setup-observations.json) and [initial main capture](main-entry.json).

## Replay

Use a new synthetic developer account prepared with the existing fixture. Its private setup file supplies its paired browser state. Run from the Training Atlas repository with Python, Playwright and the installed Chrome channel:

```bash
ATLAS_TEST_SETUP=/path/to/private/atlas-login.json \
ATLAS_TEST_OUTPUT=/path/to/new-output \
python tests/overview-layout-immediate-reload.browser.py
```

The test edits through the real browser controls, reads persisted backend values and restores the account's original layout.
