Skip to content

[History] 2 - Trim range selection #288

Description

@KacperKozak

Parent

What to build

Trim range selection when creating a Favorite. The star action on an open history ride enters trim mode: two drag handles on the metric chart timeline (time is domain truth; map trimming is ambiguous on loops), defaulting to the full Moving Window. Dragging updates a live highlight of the selected sub-range on the map route and live-recomputed stats for the range. Save creates the Favorite from the selected range (free milliseconds — no snapping, no minimum range). Multiple Favorites can be created from one ride.

Likely files

  • src/modules/history/components/HistorySessionSheet.tsx - hosts the star action and chart; trim mode lives here
  • src/modules/history/components/historyChartMetrics.ts - chart data shaping for the timeline
  • src/modules/history/lib/rideFormat.ts - stat formatting for the live recompute readout
  • src/modules/history/store/historyStore.ts - selected session samples feeding live stats
  • src/components/gestures/ - existing gesture primitives for drag handles

Implementation hints

  • Live stats can be computed JS-side from already-loaded session samples for preview; the durable stats are still computed natively at creation (slice 1 API).
  • Highlighting a sub-range on the route: filter loaded GPS samples by the handle range; reuse the existing route rendering path rather than a second map source if possible.
  • Use Reanimated shared values for handle drags to avoid render storms (see docs/agents/react.md conventions).
  • If the trim handles become a reusable control, add a showcase preview under src/app/settings/components/.

Acceptance criteria

  • Star enters trim mode with handles defaulted to the full Moving Window
  • Handles drag freely in time; no snapping, no enforced minimum
  • Map highlights the selected sub-range live while dragging
  • Stats readout recomputes live for the selected range
  • Save creates a Favorite for exactly the selected range
  • Creating several Favorites from the same ride works

Blocked by

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:historyRide history, sessions, buckets, graphscomplexity:mediumNeeds care, moderate integration surface. Use sonnet.ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions