# Training Atlas iteration 10: next exercise, compact editing and saved-layout composition

Training Atlas now shows the next pending exercise after completing a block, keeps a narrow metric card's editing controls on one row, and composes the user's widened Sleep layout with a larger Recovery reading. In a reduced-height workout view, the active set remains fully visible with its exercise heading and more room below it.

The final build is deployed to the existing preview and main services. Both serve `/assets/index-MyIBjgAR.js`. Their process IDs are unchanged.

## Actual before and after

The comparison uses the same new synthetic account, 2/12 training fixture, Chrome browser, fixed date, viewport sizes and user operations. The browser records the third and fourth bench sets, returns and reloads, then moves Sleep before Recovery, changes Sleep to half width, hides VO₂max, saves and immediately reloads.

| Observation | Actual original build | Deployed build |
|---|---|---|
| Today after all four bench sets are recorded | The mobile card still shows completed bench press, “4 sets” | The card shows seated row, 45 kg × 10; Continue opens the same active session |
| Narrow metric editing toolbar at 390 × 640 | 103.19px, with controls wrapping above the reading | 52.00px; drag, title and an options entry share one row |
| Space between the edited set row and bottom navigation at 390 × 360 | 8.16px | 53.16px, with the exercise heading visible |
| Gap below the Recovery region in the saved desktop layout | 136.83px before the next region | 16.00px; Recovery spans the two compact vital rows |
| Saved order, widths and hidden module | Retained after immediate reload | Retained after immediate reload, with the exact backend preference matching |
| Third and fourth set values | 67.5 kg × 8, RPE 8.5; 65 kg × 7, RPE 9 retained | The same exact completed records retained |

The original full replay recorded three failed product observations: the stale Today exercise, wrapped narrow controls and unassigned space below Recovery. The final replay passes all 11 matched observations plus one new check that the opened options menu stays inside the 320px viewport and above bottom navigation. Both full replays recorded zero browser page errors.

[Original results](before/results.json) · [Deployed results](after/results.json) · [Measurements](measurements.json) · [Original execution](before/execution.txt) · [Deployed execution](after/execution.txt)

### Today follows remaining work

| Before: completed bench still leads | After: next pending exercise leads |
|---|---|
| ![Completed bench still occupies the one visible preview row](before/overview-after-bench-390x640.png) | ![Seated row leads after completing bench](after/overview-after-bench-390x640.png) |

The preview now chooses blocks with planned sets before taking the first three. When every block is recorded, it retains the completed session preview. The action continues to use the existing active-session route.

### Editing keeps the reading visible

| Before: two toolbar rows | After: one toolbar row |
|---|---|
| ![Original wrapped controls](before/layout-controls-390x640.png) | ![Compact toolbar and visible metric values](after/layout-controls-390x640.png) |

Each card retains its drag handle and title. Move earlier, move later, width and hide are in the card's options menu. Opening another menu closes the previous one. Opening a menu brings it above the fixed navigation without adding a persistent toolbar.

[Opened options at 320 × 568](after/layout-options-320x568.png)

### Short-height recording

| Original matched replay | Deployed matched replay |
|---|---|
| ![Original edited row close to bottom navigation](before/constrained-edit-390x360.png) | ![Edited row with its exercise heading and usable room below](after/constrained-edit-390x360.png) |

The [independent review screenshot](../../../../../reviews/v08/daily-products-cold-6/atlas-constrained-edit-390x360.png) recorded a partly clipped row. In both controlled baseline runs here, the whole row was visible with only 8.16px below it. The deployed replay provides 53.16px while preserving the exercise heading. Those distinct observations are retained in the evidence.

At a visual viewport shorter than 480px, the existing focus reveal positions the whole row with its nearby exercise heading when it fits. It also runs after a field change, including RPE selection. Completing the fourth bench set reveals the next row in seated row. The 390 × 360 scenario is a reduced browser viewport; the evidence records its actual visual viewport dimensions.

[After completion](after/constrained-completed-390x360.png) · [Original completed state](before/constrained-completed-390x360.png) · [Preparatory observation](baseline-stabilized/results.json)

### The saved layout becomes a coherent summary

| Before: unassigned quarter column | After: Recovery and compact vitals share a group |
|---|---|
| ![Original custom desktop arrangement](before/layout-saved-1440x900.png) | ![Same order and widths with composed health readings](after/layout-saved-1440x900.png) |

The existing summary compositor now recognizes this leading arrangement: workout ½, Sleep ½, Recovery ¼, HRV ¼ and resting heart rate ¼. Recovery spans the two vital rows and its reading is centered in that region. The layout keeps the saved DOM order and chosen column widths. Other custom arrangements retain their existing flow. Mobile uses the existing responsive column rules.

The first candidate used sequential column-height packing. It still left the observed gap and moved a lower chart into an awkward middle-column position. That candidate was rejected. Its source patch, screenshots, nonzero execution and result values remain in [the rejected candidate](rejected-candidate/results.json), [source patch](rejected-candidate/source.patch) and [desktop screenshot](rejected-candidate/layout-saved-1440x900.png).

## Source and preservation

Four production files changed:

- `OverviewBlocks.tsx`: the recognized composition and compact per-card options.
- `OverviewBlocks.css`: the one-row toolbar, contained menu and Recovery grouping.
- `TodayOverview.tsx`: pending exercises lead the active-workout preview.
- `SetLogger.tsx`: the existing reveal behavior accounts for reduced height, nearby heading and field changes.

The exact patch is against the actual pre-edit working files. Existing uncommitted application work was preserved; no application files were staged or committed.

[Source patch](source.patch) · [Overview component before](OverviewBlocks.before.tsx) / [after](OverviewBlocks.after.tsx) · [Overview styles before](OverviewBlocks.before.css) / [after](OverviewBlocks.after.css) · [Today before](TodayOverview.before.tsx) / [after](TodayOverview.after.tsx) · [SetLogger before](SetLogger.before.tsx) / [after](SetLogger.after.tsx)

The iteration 9 layout-intent save path remains in place. Its browser regression opens the new options entry before performing the same order, width and hide edits. The iteration 8 set-recording path remains in place.

## Verification

| Actual check | Result |
|---|---|
| Daily recording, return/reload, next exercise and layout journey | 12 observations passed |
| Overview immediate reload | 3 operation paths; all UI and backend preferences matched |
| Set recording immediate reload | 3 operation paths; completed status and exact values matched |
| Recording unit suite | 10 passed |
| TypeScript | Passed |
| Production build | Passed |
| Main ready sign-in at 390 × 640 and 1440 × 900 | HTTP 200; Google sign-in; no horizontal overflow or page errors |

The immediate-reload paths cover same-task reload, an actual pointer click followed by reload, and confirmed completion followed by reload. The recording regression preserves 67.5 kg × 7 at RPE 8, 70 kg × 6 at RPE 8.5 and 72.5 kg × 5 at RPE 9.

[Layout regression](layout-regression/results.json) · [Recording regression](recording-regression/results.json) · [Recording unit output](recording-unit.txt) · [TypeScript output](typecheck.txt) · [Build output](build.txt) · [Execution checks](regression-checks.json)

The daily replay restored all 12 fixture sets and removed its layout preference. The layout regression ended with no active test layout and no pending layout-intent keys. The recording regression removed its six temporary records. The new account and paired browser state are private replay setup; the independent review account was untouched.

The final desktop screenshot also records the existing sidebar status “紀錄已同步／檢查附件” wrapping into several narrow lines beside Settings. Its status markup and shell styles are outside these four production files. The actual attachment-check state remains visible.

## Deployment

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

Assets were copied before entry files, existing assets were retained, and both running services returned the final entry asset. Main remains on Google sign-in with developer authentication disabled. Authenticated journeys ran on the isolated preview account.

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

## Replay

From the Training Atlas repository, use a new synthetic account prepared with the existing fixture and its paired browser state:

```bash
ATLAS_TEST_SETUP=/path/to/private/atlas-login.json \
ATLAS_TEST_OUTPUT=/path/to/new-output \
ATLAS_EXPECT_FIXED=1 \
python tests/overview-training-compact.browser.py
```

[Daily replay](overview-training-compact.browser.py) · [Layout reload replay](overview-layout-immediate-reload.browser.py) · [Setup observations](setup-observations.json)
