Skip to content

feat(signal-viewer): show clock time on the session signal x-axis#35

Merged
kabaka merged 1 commit into
mainfrom
claude/session-signals-chart-time-o330r3
Jun 17, 2026
Merged

feat(signal-viewer): show clock time on the session signal x-axis#35
kabaka merged 1 commit into
mainfrom
claude/session-signals-chart-time-o330r3

Conversation

@kabaka

@kabaka kabaka commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

The session signal viewer's x-axis previously labelled ticks with elapsed time since the session start (e.g. 01:23:45). It now shows the recording device's then-current local wall-clock time, because knowing the actual time of night an event happened is critical for interpreting CPAP therapy data.

What changed

  • Clock-time tick labels — 24-hour HH:MM, or HH:MM:SS when zoomed in far enough that ticks are finer than a minute. (24h matches the existing crosshair style and is unambiguous across midnight.)
  • Day-boundary markers — each midnight inside the visible window draws a solid full-height vertical rule with a Mon DD date label, so recordings that cross midnight (i.e. most of them) read unambiguously. Redundant non-color cue (line weight + dated text).
  • Duration stays discoverable — it moves off the individual ticks but the crosshair/keyboard readout now leads with clock time and appends the elapsed offset (e.g. 23:16:42 (+1:12:08)), and the "Showing" status reads as a clock range plus span (e.g. 23:14 – 23:19 · 5m).
  • Correctness — clock time derives from the wall-clock-as-UTC session epoch (sessionWallClockEpoch) formatted with UTC getters, so the axis and crosshair are guaranteed to agree and labels are independent of the viewer's current timezone (they reflect the machine's local clock at recording time). hoverReadout.formatClockTime was reconciled to the same convention.
  • Accessibility — screen-reader announcements lead with clock time, spell the elapsed duration naturally, and append the date once the cursor crosses into a later calendar day; the off-canvas axis description includes the visible clock range.
  • Graceful fallback — if a session's start time is unparseable, the axis falls back to the previous duration labels with no day-boundary artifacts.

Design decisions (delegated to the agent team)

  • Clock time replaces duration on the axis rather than per-tick Time (Duration) (rejected as cluttered); duration lives in the crosshair and viewport-span readout instead.
  • 24-hour, fixed (not locale 12/24h), for consistency with the crosshair and unambiguous midnight crossings.
  • DST: monotonic elapsed wall-clock (UTC arithmetic, no gap/repeat), consistent with the app's existing single-zone assumption.

Testing

  • tsc --noEmit, ESLint, Prettier: clean.
  • Vitest: 464 tests green across the affected src/components/charts and src/views/Sessions suites, including new coverage for clock-label formatting, UTC-getter timezone independence, day-boundary detection (single/none/multi-midnight, non-finite, non-positive), strict <60s tick-precision boundary, the NaN/undefined fallback, and axis↔crosshair agreement.
  • Reviewed and approved by the qa agent (no blockers); security agent: no findings (fully client-side, no new deps, DOM sinks React-escaped, day-boundary loop hard-capped).

Privacy

Fully client-side. No network calls, no telemetry, no new dependencies; nothing leaves the browser.

🤖 Generated with Claude Code


Generated by Claude Code

The signal viewer x-axis previously labelled ticks with elapsed time
since the session start (e.g. 01:23:45). It now shows the recording
device's then-current local wall-clock time (24-hour HH:MM, or HH:MM:SS
when ticks are finer than a minute), so the actual time of night an
event occurred is immediately visible.

- Midnight day-boundaries draw a full-height rule with a `Mon DD` label,
  so recordings that cross midnight read unambiguously.
- Duration into the session stays discoverable: the crosshair/keyboard
  readout leads with clock time and appends the elapsed offset
  (e.g. 23:16:42 (+1:12:08)), and the "Showing" status reads as a clock
  range plus span (e.g. 23:14 - 23:19 · 5m).
- Clock time derives from the wall-clock-as-UTC session epoch formatted
  with UTC getters, so the axis and crosshair always agree and labels are
  independent of the viewer's current timezone.
- Screen-reader announcements lead with clock time, spell the elapsed
  duration, and append the date once the cursor crosses into a later day.
- Falls back to the previous duration labels when the session start time
  is unparseable. Fully client-side; nothing leaves the browser.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PM5QGXfGYbRrGe2YPfBsXj
@kabaka kabaka merged commit 4250761 into main Jun 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants