Skip to content

Add portable TCX session history and metric refinements#4

Merged
lookfirst merged 26 commits into
mainfrom
refactor/tanstack-store
Jul 19, 2026
Merged

Add portable TCX session history and metric refinements#4
lookfirst merged 26 commits into
mainfrom
refactor/tanstack-store

Conversation

@lookfirst

Copy link
Copy Markdown
Collaborator

What changed

  • import individual TCX files and nested ZIP archives into local session history
  • embed and preserve Ride Control session identifiers, with legacy fingerprint fallback for duplicate detection
  • download all saved sessions as a collision-safe ZIP of TCX files
  • retain imported-session metadata, highlight newly imported rides, and show a compact imported-file marker
  • track and display maximum resistance and virtual gear values
  • simplify repeated metric units and improve session summary readability
  • add subtle separator bands between stacked session graphs

Why

Session history previously supported one-at-a-time export but had no restore or bulk-backup path. Control aggregates also omitted maxima, and several history/chart details repeated units or lacked visual separation.

Impact

Riders can now back up and restore their complete local ride history, reliably avoid duplicate imports, and review clearer session metrics and charts.

Validation

  • bun run ci
  • 141 tests passing
  • Ultracite/Biome, Tailwind diagnostics, TypeScript, and production build all pass

lookfirst added 26 commits July 19, 2026 09:35
Introduce common unit conversion, numeric bounds, metric presentation, formatting, error, DOM event, and dialog lifecycle utilities.

Reuse storage keys, timing constants, distance and calorie calculations, chart metadata, session summaries, Bluetooth helpers, and export formatting across the application. Add focused unit coverage and document the repository's DRY expectations.
Replace the monolithic dashboard and its broad prop surface with focused layout, toolbar, metrics, session, footer, and training-control components.

Extract complete gear and resistance panels behind a small mode dispatcher, centralize mutually exclusive overlays, and move save, start, and continuation transitions into a tested session workflow hook and reducer. Keep keyboard controls coordinated at the application boundary.
Replace the external reconnect-help link with concise Chrome Bluetooth permission steps inside the paired-devices tray, while keeping the guidance hidden in unsupported browsers.

Make the browser settings address copyable, confirm that it is ready to paste into a new tab, reuse the shared dialog lifecycle and controller-count helpers, remove the obsolete documentation URL, and cover the rendered guidance.
Replace scattered control-mode strings with a named domain constant, derived union type, centralized boundary validation, and exhaustive rendering branches.

Move cycling calorie assumptions and calculations out of session logic into a focused energy module with direct tests, and document the shared-domain constant convention.
Allow the copied Chrome Bluetooth settings address to wrap at natural URL boundaries and keep wrapped lines left aligned instead of orphaning centered characters.
Replace scattered runtime type checks with reusable guards for finite numbers, strings, records, and functions while relying on ordinary presence checks for trusted optional fields.

Apply the guards to stored sessions, charts, Click metadata, and browser-facing data; add focused coverage and document the boundary-validation rule for future changes.
Detect Chrome's persistent Web Bluetooth backend through the getDevices capability and replace setup instructions with a compact configured confirmation when reconnect support is available.

Keep guidance visible when configuration is still required, preserve unsupported-browser behavior, isolate the status presentation from the device panel, and document and test both states.
Organize history shortcuts into Navigation, Session, and General sections so the history help dialog matches the grouped structure of the main keyboard reference.

Add metadata and rendered-heading coverage and document the grouped history shortcut help.
Track maximum resistance and virtual gear values in session aggregates and preserve them across restore flows.

Separate numeric totals from subdued unit labels and remove repeated units from saved-session metric summaries.
Import individual TCX files or nested ZIP archives, preserve Ride Control identifiers, and reject duplicate sessions using identifiers or stable legacy fingerprints.

Export all saved rides as a collision-safe ZIP, retain imported-session metadata, highlight fresh imports, and label imported rides with a compact file-check marker.

Tighten history controls, show control metric maximums, and add subtle separator bands between stacked session graphs.
@lookfirst
lookfirst merged commit 2ed6d87 into main Jul 19, 2026
1 check passed
@lookfirst
lookfirst deleted the refactor/tanstack-store branch July 19, 2026 20:13
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.

1 participant