# Atlas iteration 12 — HRV reading and range continuity

**Status:** deployed to [Training Atlas](https://app.training-atlas.workers.dev). This is a feedback-led, scoped refinement of the three frozen observations from daily-products-cold-8. Iteration 11 and the review evidence remain unchanged.

## The task and the chosen direction

A person opens night HRV, understands the plotted summaries, chooses a date range, follows a selected night into sleep or its measurement record, and returns to the same comparison. The first phone frame should contain the HRV reading and useful trend content.

The existing visual direction earns preservation: a dark canvas, a quiet green reading surface, a large white HRV value, restrained plot lines and explicit dates. This change groups the selected value with its timestamp on phones, explains the existing period marks in the existing legend, and keeps date editing at the existing Custom button.

The actual review images were inspected before implementation:

- The 1440 × 900 chart showed horizontal period segments, white 66/67 labels and green +1% labels, with only the dashed baseline explained.
- At 390 × 640, the applied custom range retained two date inputs and Apply above the chart, including after returning from sleep and reloading.
- At 320 × 568, “夜間 HRV” wrapped beside the coach, device and menu actions.

The source establishes the meaning of the marks: observed-day means in 7-day blocks for a 28-day view and 30-day blocks for longer views; percentages compare adjacent observed blocks. The data preparation and calculation code are unchanged.

## What changed

### Explain the summaries where the chart already explains itself

The HRV chart’s existing baseline legend now also identifies the solid segments as “7日平均 · %較前段”. It changes to “30日平均 · %較前段” when the actual block size changes. A 7-day range has no period-summary legend because it has no such summary marks. Dates, raw observations, baseline values, source links and rounding are preserved.

### Show the applied comparison after editing a range

Custom opens the existing date form and focuses From. The draft changes the range when Apply or Enter submits it. Apply collapses the form and returns focus to Custom. Escape restores the applied dates and the trigger’s focus. Returning or reloading an applied custom range starts with the comparison visible; Custom reopens its dates.

On phones, the large HRV value sits beside its date and measurement time. The plot uses a 180 px height in a narrow chart instead of 220 px, with the same 12 px axis labels and the same semantic observations.

### Keep the narrow title together

At widths of 350 px or less, the night page’s device action is available in its existing health menu. Coach, Back and the health menu remain in the header. The 320 px HRV title now fits on one line.

## Matched rendered results

All pairs use the same new synthetic account, fixed date/time, range, selected observation, browser zoom, settled data and viewport. The source before the change and the complete previous built output were retained before implementation.

Visible plot height below is the geometric intersection between the plot and the viewport above the fixed mobile navigation. It is not a painted-pixel measurement. The 390 px applied custom chart was also checked with the skill’s 5 × 5 elementFromPoint sampling: all 25 points were reachable.

| State | Before | After | Observed change |
|---|---:|---:|---|
| Default HRV, 1440 × 900 | 220 / 220 px of plot visible | 220 / 220 px | Existing legend now identifies means and percentage comparison; desktop trace geometry unchanged |
| Default HRV, 390 × 640 | 139.63 / 220 px | 180 / 180 px | Complete plot in the first frame |
| Default HRV, 320 × 568 | 54.03 / 220 px; title 2 lines | 138.81 / 180 px; title 1 line | 84.78 px more plot visible; intact title |
| Custom range → sleep → Back → reload, 390 × 640 | Plot starts at 598.84 px; 0 / 220 px visible | Plot starts at 364 px; 180 / 180 px visible | Plot begins 234.84 px earlier and is fully visible |

The selected readings remain 67.6 ms on December 4 and 71.3 ms on December 3. Comparison checks also preserve the exact route, detail-link targets and displayed period values in all four pairs. The selected November 21 chart reading remains 64.1 ms; its actual measurement dialog retains the source precision of **64.086 ms**.

### Four pairs for the case viewer

| Pair | Before | After |
|---|---|---|
| Desktop summary encodings | [1440 × 900](before/night-1440.png) | [1440 × 900](after/night-1440.png) |
| Standard phone comparison | [390 × 640](before/night-390.png) | [390 × 640](after/night-390.png) |
| Narrow title and chart | [320 × 568](before/night-320.png) | [320 × 568](after/night-320.png) |
| Applied custom range after return and reload | [390 × 640](before/custom-return-390.png) | [390 × 640](after/custom-return-390.png) |

Supporting interaction views: [active date editing at 390 × 360](affected-flow/custom-focused-390x360.png), [editing at 320 px](affected-flow/custom-editing-320.png), and [actual selected measurement](affected-flow/selected-source-detail-320.png).

### Tradeoffs and rejected routes

- A narrow HRV plot is 40 px shorter. At 320 × 568, its last 41.19 px, including the date axis, still require a small scroll. The first frame exposes the summary marks and substantially more of the trace.
- Opening device information costs one additional menu activation at 350 px and below. The actual device action was exercised there.
- A new permanent explanatory row was rejected; the existing legend has the necessary space.
- A separate range dialog was rejected for this scoped change. The existing inline form can be reopened directly and works in the short viewport.
- Shrinking every header action or reducing the title’s type size was rejected. Moving the occasional device action to the existing menu preserves the title and the remaining touch targets.

## Affected-flow verification

The [browser replay](source-after/tests/hrv-range-reading.browser.py) completed **9 checks**:

1. 7-, 28- and 90-day ranges show the matching period semantics.
2. Custom opens with field focus; invalid dates disable Apply; Escape restores trigger focus and leaves the route unchanged.
3. Enter applies the exact custom dates, collapses the form and restores the trigger’s focus.
4. The applied custom chart is fully visible and sampled reachable at 390 × 640.
5. Keyboard and touch select the exact daily values; the selection survives resize.
6. The selected night’s actual sleep route, Back and reload retain the range, selected date and HRV value.
7. The selected measurement record opens with its raw value; closing its dialog, Back and reload return to the same selected chart.
8. The 320 px title stays on one line and the device action works through the existing menu.
9. At a reduced 390 × 360 viewport, the focused date field stays above navigation and Enter applies the range. Its measured bounds were y = 155.06–204.66 px, above navigation at 294.81 px.

The short capture used a reduced headless viewport; no physical software keyboard was invoked.

| Gate | Result | Evidence |
|---|---|---|
| Typecheck | Exit 0 | [typecheck.txt](typecheck.txt) |
| Normal Vite build with isolated output | Exit 0 | [build.txt](build.txt) |
| Scoped diff whitespace check | Exit 0 | [diff-check.txt](diff-check.txt) |
| Affected browser flows | 9 / 9 | [checks.json](affected-flow/checks.json) |
| Interface audit | 7 states, 0 findings | [flow audits](affected-flow/checks.json), [additional audits](comparison.json) |
| Matched content and context | 4 / 4 | [comparison.json](comparison.json) |
| Shared recovery range control | Existing behavior retained | [comparison.json](comparison.json) |
| Browser page errors | 0 | [validation-summary.json](validation-summary.json) |
| Main ready state | Google sign-in, no developer password field, no overflow at 1440/390/320 | [deployment.json](deployment.json) |
| Public page, entry JS and CSS | HTTP 200; expected asset names | [public-verification.json](public-verification.json) |

The shared recovery control was checked because HealthPeriod is shared: its existing non-collapsible behavior remains intact. This iteration did not change recording, layout persistence, storage schema or algorithms.

### Probes retained during verification

| Probe | Observation | Replay adjustment |
|---|---|---|
| Sleep URL assertion | Body canonicalizes the selected day to matching From/To parameters | Check the clicked date and the actual canonical day scope |
| Measurement return | The record link opens an existing measurement dialog | Read the raw record, close the dialog, then use Back |
| Immediate source-return assertion | The scoped selected reading settles after route arrival | Wait for the expected date and exact displayed reading before comparison |
| Menu locator | The native summary was not matched by the assumed button-role selector | Activate the rendered health-menu summary |
| Public request with Python’s default client | HTTP 403 | WebCodex fetch_url confirmed HTTP 200 for the page, entry JavaScript and CSS |

Probe logs remain in [probe 2](affected-flow-probe-2.txt), [probe 3](affected-flow-probe-3.txt), [probe 4](affected-flow-probe-4.txt), [probe 5](affected-flow-probe-5.txt) and [the completed replay](affected-flow-probe-6.txt).

## Source, input and runtime provenance

The actual baseline was the deployed iteration 11 build:

| Runtime | Entry JavaScript | Entry stylesheet |
|---|---|---|
| Before | /assets/index-D9n6V3BK.js | /assets/index-BZbRL8tg.css |
| Deployed iteration 12 | /assets/index-FK5VV3cQ.js | /assets/index-BZbRL8tg.css |

Related lazy-loaded assets are recorded in [deployment.json](deployment.json). The captured HTML responses are text artifacts so documentation tooling does not treat them as runnable pages: [before](before-index-response.txt), [after](after-index-response.txt), [public](public-index-response.txt). Renaming the original before response preserved its bytes.

Atlas was a dirty working tree based on ae3f0a7a24a96f4c64aae1634811806fd1c63a8a. The narrow [source patch](source.patch), [before files](source-before/apps/web/src/pages/DailyHealthDetail.tsx) and [after files](source-after/apps/web/src/pages/DailyHealthDetail.tsx) identify this change. The base commit does not identify all existing dirty work.

The only production files changed in this iteration are:

- apps/web/src/pages/DailyHealthDetail.tsx
- apps/web/src/pages/DailyHealthDetail.css
- apps/web/src/components/HealthPeriod.tsx
- apps/web/src/components/HealthNavigation.tsx
- apps/web/src/components/HealthNavigation.css
- apps/web/src/components/WellnessCharts.tsx
- apps/web/src/components/WellnessCharts.css

One focused replay was added: tests/hrv-range-reading.browser.py. No files were staged, committed or reset.

The Productive UI shipping working tree was the UI/UX input. The core, Art direction, Typography, Refinement, Charts and Frontend engineering chapters were read before implementation. The audit and workspace scripts were read for verification. The entire current shipping skill directory was captured for usable navigation; the actual-read list and complete captured-file list are in [input-provenance.json](input-provenance.json). Its PUI base commit is provenance only; the snapshot includes the current working-tree updates.

## Deployment and repeatability

The finished build was copied to the existing main and preview static roots, with assets copied before index.html and old assets retained. The live services were not restarted. Their process identities, authentication configuration, local responses and public asset verification are recorded in [deployment.json](deployment.json). The public URL is confirmed from the main service’s APP_ORIGIN and its actual HTTP response.

The original matched fixture remains private at:

/home/nvidia/ping/training-atlas/.artifacts/v08/iteration-12/atlas-login.json

The retained complete baseline build is:

/home/nvidia/ping/training-atlas/.artifacts/v08/iteration-12/baseline-dist

The [neutral fresh-fixture helper](fresh-fixture.py) creates a new synthetic account and isolated browser state for a fresh reviewer. Give it a new private output directory. It contains setup only, with no prior scores or diagnosis. It uses the existing preview service and the established synthetic seed at docs/cases/products/atlas/v08/iteration-2/fixture.mts. Credentials and browser state stay in the private output directory.

All owned browser contexts and captured workers have finished. The matched fixture is retained for replay; this iteration’s browser flows made no training or health record edits.
