Add portable TCX session history and metric refinements#4
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
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