# Atlas v08 — iteration 5

## Outcome

The focused training row now stays above the fixed navigation when a 390 × 640 viewport shrinks to 390 × 360. The same input, set, value, caret, and progress remain selected. Custom overview cards use their actual heights, so moving Sleep first at half width no longer leaves a full workout-height empty region below it.

Preview: http://127.0.0.1:3015  
Main: http://127.0.0.1:3001

## Working brief and decision

Daily trainee → edit the next pending set → record it and continue at the next set → desktop and short phone → preserve exact data, original active workout, completed-group disclosure, and every saved overview choice.

The existing pale active row, clear recording control, folded completed work, semantic health colors, and default overview composition were retained. The change targets focused editing and the observed custom arrangement.

- SetLogger listens for focus and viewport changes, measures the active row against the actual header/navigation, and scrolls only the needed distance. It never replaces the focused element or selection.
- OverviewBlocks measures custom card heights with the native ResizeObserver and assigns small grid row spans. Ordinary row-major placement retains the selected DOM/reading order and configured column widths. The existing default composition and editing controls remain intact.
- CSS scroll margins alone were rejected because the failing transition happens after focus, when the viewport changes.
- Forcing the default hero arrangement was rejected because it would defeat the user's order/width choices.

No new dependency, explanation row, preference reset, database/schema change, or HRV-source change was introduced.

## Matched result

Chromium, zoom 100%, locale zh-TW, timezone Asia/Taipei, fixed time 2026-12-04T12:00:00Z. The owned acceptance-probe account/session was loaded privately. The supplied active workout and original sample data were used for all matched captures.

| Observed state | Before | After |
|---|---:|---:|
| Focused weight bounds after 390 × 640 → 390 × 360 | y 312.66–360.66 | y 230.66–278.66 |
| Same-row completion bounds | y 312.66–360.66 | y 230.66–278.66 |
| Fixed navigation top | y 294.81 | y 294.81 |
| Focused field / completion centre hit-test | false / false | true / true |
| Selected value and caret | 65; [1, 1] | 65; [1, 1] |
| Original workout progress | 2 / 12 | 2 / 12 |
| Sleep-bottom → next Recovery top, custom 1440 × 960 | 299.84 px | 16.45 px |

All 19 matched capture pairs retain the same block order, widths, metric values, and workout progress. Captures cover 1440 × 960, 390 × 640, 390 × 360, and 320 × 568, plus the same focused shrink/expand sequence. Every after capture has no relevant audit finding and no horizontal document overflow.

Raw measurements include clipping geometry, sampled pointer reachability, actual focused-control bounds and centre hit-tests. Screenshots were inspected at desktop, phone, short-height focus, 320-pixel width, custom layout, and the next-exercise transition. The focused row is visibly above the navigation. The custom desktop first frame now shows Recovery and HRV directly under Sleep. Custom cards can start on different lower baselines while retaining the chosen row-major reading sequence.

### Focused shrink

| Before | After |
|---|---|
| ![Before focused shrink](before-focus-after-shrink-390x360.png) | ![After focused shrink](after-focus-after-shrink-390x360.png) |

### Custom overview

| Before | After |
|---|---|
| ![Before custom overview](before-custom-sleep-first-1440x960.png) | ![After custom overview](after-custom-sleep-first-1440x960.png) |

## Interaction replay

20 checks passed in journeys.py:

- Actual normal-workout focus, shrink and expand preserve the same row, value, next set, caret, and progress.
- Weight, reps and RPE can be changed at 390 × 360; the corresponding completion control remains reachable.
- Keyboard recording continues in the next pending set and then the next exercise.
- A completed exercise folds; its group reopens for editing and folds again.
- Save completes the owned synthetic workout; reload shows exact values.
- Custom Sleep-first half width, a hidden RHR block, saved reload and Cancel preserve the selected choices.
- Original overview order and widths are restored through its controls, without Reset.
- Original normal active session, blocks and sets compare exactly before/after.
- No runtime page error or journey failure.

The four synthetic sets were stored and reopened with:

| Set | Weight | Reps | RPE |
|---|---:|---:|---:|
| 1, edited after reopening completed group | 61.25 | 4 | 7.5 |
| 2 | 62.5 | 6 | 8 |
| 3 | 63.75 | 7 | 8.5 |
| 4 | 44.5 | 9 | 6.5 |

The 8 newly created entities—4 sets, 2 blocks, 1 session, 1 exercise—were deleted after the replay. The original active workout was preserved. Owned browser contexts/processes closed normally; supplied services were kept running.

Manual scrolling was also exercised while the input remained focused: scrollY changed from 157 to 377 and stayed there. The resize handling does not prevent deliberate page scrolling.

## Build and service result

- npm run typecheck: exit 0.
- Preview npm run build with ATLAS_WEB_OUT_DIR=.state/instances/preview/web: exit 0.
- Main npm run build to apps/web/dist: exit 0.
- Scoped git diff --check: exit 0.
- Existing 3015 and 3001 services: HTTP 200, HTML returned.
- Both builds retain Vite's existing warning about chunks larger than 500 kB.

## Observed failures retained

1. The original product failure is captured in before-focus-after-shrink-390x360.png and before-observations.json: both focused input and completion control fall under navigation.
2. Initial capture harness used a strict .routine-block locator that matched three exercise regions. That attempt's script, screenshot, observations and raw output are preserved in failed-capture-1/. The locator now selects the first region.
3. A read-only metrics command had a Python bracket SyntaxError; its raw output is preserved in runner-failures.json. It changed no files or data.
4. The first full baseline capture restored the layout through its controls, then attempted a hidden mobile sync indicator. That timeout remains in before-observations.json. Subsequent capture/journey sync uses the actual overview device dialog on mobile. Both after capture and final journey confirmed the exact original layout restored.

## Source boundary

Exact changes relative to the captured dirty working tree:

- apps/web/src/components/SetLogger.tsx
- apps/web/src/components/OverviewBlocks.tsx
- apps/web/src/components/OverviewBlocks.css

baseline/ contains exact pre-edit scoped files. final/ contains the changed final sources. source.diff.patch is the exact patch between those copies, independent of pre-existing Git changes. The unrelated starting worktree context is preserved privately; the published patch contains only this scoped refinement. No reset, stage or commit was performed.

## Replay

From /home/nvidia/ping/training-atlas, with the existing preview service running:

~~~sh
/home/nvidia/miniforge3/bin/python /home/nvidia/ping/productive-ui/docs/cases/products/atlas/v08/iteration-5/capture.py after
/home/nvidia/miniforge3/bin/python /home/nvidia/ping/productive-ui/docs/cases/products/atlas/v08/iteration-5/journeys.py
~~~

The scripts read the authorized setup/session files directly and never print credentials. capture.py restores the original layout. journeys.py creates only its own synthetic records and deletes exactly those records in its final cleanup.

## Evidence index

- before-observations.json / after-observations.json: raw matched DOM geometry, active field/caret, audits and workspace measures.
- comparison.json: all 19 pairs, value/order/width/progress comparisons and custom gap.
- before-*.png / after-*.png: original matched native screenshots.
- journey-results.json / journey-*.png: actual controls, saved exact values, original active records and cleanup.
- manual-scroll-check.json: deliberate scrolling with focus retained.
- source.diff.patch / baseline/ / final/: scoped source evidence.
- typecheck.txt / build-preview.txt / build-main.txt / service-check.json / diff-check.txt: final command results.
- failed-capture-1/ / runner-failures.json: retained failed harness work.
