iOS: route trim UI + RouteTrimmer (epic #992) #994

Closed
opened 2026-08-07 03:50:49 +00:00 by spikerj · 1 comment
Owner

Part of epic #992.

  • Core/Tracking/RouteTrimmer.swift: apply(points:keepStart:keepEnd:) (inclusive slice + segment rebase) and suggest(points:activityType:) per epic heuristic; reuses TrackStats.haversineKm.
  • TrimRecordedRouteRequestDTO + SpikerSoftAPI.trimActivityRoute(id:_:) -> RecordedRouteDetailDTO.
  • TrimRangeSlider.swift (small dual-thumb control) + RouteTrimView.swift sheet: map preview, suggested-trim button, live before/after stats via TrackStats.stats(for:), confirm dialog with exact delta.
  • Commit paths: serverId == nil → local apply + recompute + routeStore.save (stays pendingUpload); serverId != nil → API trim then rewrite local file from response (stays synced); offline+synced → error, no local mutation. Never flip synced → pendingUpload (server dup).
  • TrackerMapView.swift + TrackerStyle.json: trim-dimmed + trim-handles sources/layers, optional overlay inputs in applyOverlays.
  • RouteDetailView.swift: toolbar Trim button; refresh on dismiss. Server-only routes out of iOS v1 scope (web covers).
  • RouteTrimmerTests.swift with the shared fixture; xcodegen generate.
Part of epic #992. - `Core/Tracking/RouteTrimmer.swift`: `apply(points:keepStart:keepEnd:)` (inclusive slice + segment rebase) and `suggest(points:activityType:)` per epic heuristic; reuses `TrackStats.haversineKm`. - `TrimRecordedRouteRequestDTO` + `SpikerSoftAPI.trimActivityRoute(id:_:) -> RecordedRouteDetailDTO`. - `TrimRangeSlider.swift` (small dual-thumb control) + `RouteTrimView.swift` sheet: map preview, suggested-trim button, live before/after stats via `TrackStats.stats(for:)`, confirm dialog with exact delta. - Commit paths: `serverId == nil` → local apply + recompute + `routeStore.save` (stays pendingUpload); `serverId != nil` → API trim then rewrite local file from response (stays synced); offline+synced → error, no local mutation. Never flip synced → pendingUpload (server dup). - `TrackerMapView.swift` + `TrackerStyle.json`: `trim-dimmed` + `trim-handles` sources/layers, optional overlay inputs in `applyOverlays`. - `RouteDetailView.swift`: toolbar Trim button; refresh on dismiss. Server-only routes out of iOS v1 scope (web covers). - `RouteTrimmerTests.swift` with the shared fixture; `xcodegen generate`.
Author
Owner

Migrated to spikerj/spikersoft-ios#16 as part of the umbrella-tracker breakup.

Verified 2026-08-07 against spikersoft-ios@6926525 (main). Status: not started. No Core/Tracking/RouteTrimmer.swift, no TrimRangeSlider.swift, no RouteTrimView.swift, no RouteTrimmerTests.swift; TrackerStyle.json has no trim-dimmed / trim-handles sources or layers; RouteDetailView.swift has no Trim toolbar button. Nothing in main's 30-commit history touches trim.

Its dependencies are ready: the backend endpoint (#993) is merged at spikersoft-backend@f8f402cd and live (POST /api/recorded-routes/{id}/trim → 401, bogus sibling path → 404), and the Android twin (#995) shipped at spikersoft-android@4aa6100 as the reference implementation to mirror.

Closing here. Work now lives in the repo that holds the fix, so fixes #16 in a PR will auto-close it on merge. The umbrella tracker keeps cross-repo epics only.

— Opus 5 Agent

Migrated to **spikerj/spikersoft-ios#16** as part of the umbrella-tracker breakup. Verified 2026-08-07 against `spikersoft-ios@6926525` (main). Status: **not started.** No `Core/Tracking/RouteTrimmer.swift`, no `TrimRangeSlider.swift`, no `RouteTrimView.swift`, no `RouteTrimmerTests.swift`; `TrackerStyle.json` has no `trim-dimmed` / `trim-handles` sources or layers; `RouteDetailView.swift` has no Trim toolbar button. Nothing in main's 30-commit history touches trim. Its dependencies are ready: the backend endpoint (#993) is merged at `spikersoft-backend@f8f402cd` and **live** (`POST /api/recorded-routes/{id}/trim` → 401, bogus sibling path → 404), and the Android twin (#995) shipped at `spikersoft-android@4aa6100` as the reference implementation to mirror. Closing here. Work now lives in the repo that holds the fix, so `fixes #16` in a PR will auto-close it on merge. The umbrella tracker keeps cross-repo epics only. — Opus 5 Agent
Sign in to join this conversation.