trails/openspec/specs/gpx-import/spec.md
Ullrich Schäfer 0b9b99984e Fix all OpenSpec validation failures (36/36 passing)
- Add ## Purpose sections and convert delta headers to ## Requirements
  on all 25 specs
- Add SHALL keywords to requirements missing them (gpx-import,
  planner-session, planner-journal-handoff)
- Convert prose GPX format section to proper scenarios (no-go-areas)
- Create specs/ delta files for 7 changes that were missing them
  (activity-photos, local-dev-stack, multi-day-routes, route-discovery,
  route-sharing, visual-redesign, waypoint-notes)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:17:52 +02:00

42 lines
1.8 KiB
Markdown

## Purpose
GPX file import in the Planner via home page file picker and in-session drag-and-drop, with client-side parsing and waypoint extraction.
## Requirements
### Requirement: Import GPX from home page
Users SHALL be able to import a GPX file from the planner home page to start a new planning session.
#### Scenario: Upload GPX via file picker
- **WHEN** a user clicks the "Import GPX" button on the home page and selects a GPX file
- **THEN** the file is parsed client-side using `parseGpxAsync`
- **AND** waypoints are extracted via `extractWaypoints` (Douglas-Peucker for single-segment tracks)
- **AND** no-go areas are extracted from GPX extensions if present
- **AND** a new session is created with the extracted data
- **AND** the user is redirected to the new session
#### Scenario: Invalid GPX file
- **WHEN** a user uploads a file that is not valid GPX
- **THEN** an error message is shown
- **AND** no session is created
### Requirement: Import GPX via drag-and-drop
Users SHALL be able to drag a GPX file onto the map in an existing session.
#### Scenario: Drop GPX on map
- **WHEN** a user drags a `.gpx` file onto the map area
- **THEN** a visual drop zone indicator appears
- **AND** on drop, the file is parsed client-side
- **AND** a confirmation dialog asks whether to replace the current route
- **AND** on confirm, the session's waypoints and no-go areas are replaced with the imported data
#### Scenario: Cancel import
- **WHEN** a user drops a GPX file and the confirmation dialog appears
- **THEN** clicking "Cancel" leaves the session unchanged
### Requirement: Non-GPX file rejection
The Planner SHALL reject non-GPX files dropped on the map.
#### Scenario: Drop non-GPX file
- **WHEN** a user drops a non-GPX file on the map
- **THEN** the file is ignored with a brief error toast