Skip to content

feat: dual-axis step graph with session editing#5

Merged
JanJetze merged 6 commits intomasterfrom
feat/step-graph-with-editing
Mar 6, 2026
Merged

feat: dual-axis step graph with session editing#5
JanJetze merged 6 commits intomasterfrom
feat/step-graph-with-editing

Conversation

@JanJetze
Copy link
Copy Markdown
Owner

@JanJetze JanJetze commented Mar 6, 2026

Summary

  • Add dual-line step graph (cumulative + per-bucket) with left/right Y-axis labels using nice rounded numbers
  • Add session editing via bottom sheet with manual override persistence (ManualSessionOverride Room entity)
  • Support centroid-anchored pinch-to-zoom, horizontal pan, tap-to-inspect with tooltips, and double-tap to reset
  • Add activity session boundary markers with dashed lines and tap-to-highlight

Test plan

  • Verify step graph renders correctly with real sensor data and test data
  • Pinch to zoom anchors at touch centroid, pan scrolls horizontally, double-tap resets
  • Tap near a session boundary to see marker tooltip with session details
  • Tap elsewhere to see crosshair tooltip with cumulative/bucket step counts
  • Y-axis labels show clean rounded numbers (e.g. 5k, 10k, 15k, 20k)
  • Legend shows visible colored line samples for both lines
  • Time labels adjust for zoom level (coarse vs fine)
  • Session edit sheet allows creating/deleting manual overrides
  • Bucket size selector (1m, 5m, 15m, 30m, 1h) updates graph

🤖 Generated with Claude Code

JanJetze and others added 6 commits March 6, 2026 20:13
Replace the thin ActivityTimeline bar on the Activities screen with an
interactive dual-axis step graph showing cumulative and per-bucket step
counts over the day.

Phase 1 — Step graph:
- buildStepGraphData() groups SensorWindows into configurable time buckets
- StepGraph composable with Canvas-based dual lines, activity region
  backgrounds, horizontal pan/pinch zoom, tap crosshair with tooltip
- BucketSizeSelector chips (1m/5m/15m/30m/1h)
- ViewModel extended with SensorWindowRepository and bucket size state

Phase 2 — Activity markers:
- Thin dashed vertical lines at session boundaries
- Tap near a marker shows session detail tooltip (type, range, duration, steps)
- highlightedSessionIndex highlights a session region on the graph
- Tapping a log row highlights and shows the marker tooltip

Phase 3 — Session editing:
- ManualSessionOverride Room entity + DAO with MIGRATION_3_4
- mergeSessionOverrides() merges recomputed sessions with manual overrides
- SessionEditSheet bottom sheet with zoomed graph, draggable start/end
  markers, activity type chips, save/cancel/delete
- ViewModel CRUD for overrides, 4-flow combine (sessions + windows +
  overrides + bucketSize)

21 StepGraph tests + 7 MergeSessionOverrides tests + 11 ViewModel tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Room entity and DAO for user-edited activity session overrides,
with database migration v3→v4. The mergeSessionOverrides() function
combines recomputed sessions with manual overrides at the ViewModel
level.

SessionEditSheet provides a bottom sheet with a zoomed step graph,
draggable start/end boundary markers, and activity type selector chips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a "Use test data" switch in Settings > Developer (debug only)
that replaces real sensor data with generated test data on both
the Dashboard and Activities screens. Each date produces a unique
pattern using date-seeded randomization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts:
#	app/src/main/java/com/podometer/ui/activities/ActivitiesViewModel.kt
#	app/src/test/java/com/podometer/ui/activities/ActivitiesViewModelTest.kt
Add YAxisLabels composable with nice rounded numbers (niceAxisMax),
fix centroid-anchored pinch zoom, use fractional positioning for time
labels, and give legend line samples explicit width so they're visible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- niceAxisMax: edge cases (0, negative), 1-2-5 rounding, always >= input
- formatAxisLabel: plain numbers, thousands with decimal, 10k+ shorthand
- TestDataGenerator: determinism, date variation, invariants (ordering,
  non-negative steps, chronological sessions), transitions, weekly
  summaries, cycling sessions, all 7 day types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JanJetze JanJetze merged commit 46e2cd7 into master Mar 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant