Skip to content

feat: TCX and GPX export format selection on post-workout panel #158

@MaximumTrainer

Description

@MaximumTrainer

Summary

Allow users to export completed activities in TCX or GPX format from the post-workout panel in addition to the automatically-generated FIT file, providing compatibility with platforms that do not accept FIT (e.g. older Garmin devices, some third-party apps).

Motivation

A XmlStreamWriterTCX and GpxParser already exist in src/persistence/file/ but they are not exposed in the UI. Many training platforms and devices accept TCX or GPX but not FIT, so exposing these existing writers directly is a low-effort, high-value improvement.

Acceptance Criteria

  • The post-workout panel includes an Export section with three buttons: ''Save as FIT'' (auto-saved, greyed out once done), ''Save as TCX'', ''Save as GPX''
  • Clicking ''Save as TCX'' or ''Save as GPX'' opens a file-save dialog pre-populated with the workout name and date
  • The TCX export uses the existing XmlStreamWriterTCX and produces a valid TCX 2.0 file
  • The GPX export uses GpxParser (or a new GpxWriter following the same pattern) and produces a valid GPX 1.1 file with power, HR, and cadence extensions (Garmin TrainingCenterDatabase extension)
  • Export is disabled if no DataWorkout object is available (i.e. workout was cancelled before any data was recorded)
  • On WASM, the export triggers a browser file download rather than a native save dialog
  • Unit tests verify TCX and GPX output against a reference file for a known DataWorkout fixture
  • Existing auto-save-as-FIT behaviour is unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions