Skip to content

Chart interaction fixes: scroll-through + comparison tooltip#331

Merged
vide merged 3 commits into
mainfrom
fix/chart-interaction
Jul 6, 2026
Merged

Chart interaction fixes: scroll-through + comparison tooltip#331
vide merged 3 commits into
mainfrom
fix/chart-interaction

Conversation

@vide

@vide vide commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Two small chart-interaction fixes, split out from the perf PR (#330, now merged). No behavioural change beyond what's described; visual changes limited to the comparison tooltip restyle.

Vertical swipes now scroll the page past charts

The line, dual-axis and power-vs-SoC charts consumed the pointer on touch-down (awaitFirstDown().consume() + drag), so a vertical swipe starting on a chart never reached the enclosing scroll container. Each now uses a tap detector (select/toggle the tooltip point) + detectHorizontalDragGestures (scrub the crosshair). Horizontal drags still scrub; vertical swipes fall through to the page scroll. Tap/scrub behaviour is preserved, including the dual-axis time-label-strip guard. Tap-only charts (InteractiveBarChart, TripCostDonut) already passed scrolls through; MonthScrollIndicator's drag is an intentional scrollbar.

Comparison-chart tooltip follows the crosshair and matches the others

The power-vs-SoC overlay tooltip (charge & drive comparison) was pinned top-center with a lighter surfaceVariant style, unlike the line/bar tooltips. It now tracks the crosshair X (clamped on screen) and uses the shared inverseSurface/inverseOnSurface + 8dp style, keeping its multi-session rows (one power value per compared curve at a given SoC). This was pre-existing (not a perf regression) but inconsistent.

Verification

  • ./gradlew compileDebugKotlin green; lintDebug/installDebug verified earlier on the same commits.
  • On-device: vertical scroll works starting on a chart; horizontal drag still scrubs; tap still selects.

🤖 Generated with Claude Code

vide and others added 3 commits July 4, 2026 12:03
… tooltips

The power-vs-SoC overlay tooltip (charge & drive comparison) was pinned to
the top-center and used a lighter surfaceVariant style, unlike the line/bar
chart tooltips which follow the selected point on an inverse-surface chip.
This was pre-existing (not from the perf pass) but inconsistent: the
tooltip now tracks the crosshair X (clamped on screen) and uses the shared
inverseSurface/inverseOnSurface + 8dp style. It keeps its multi-session
rows since a given SoC has one power value per compared curve.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The line, dual-axis and power-vs-SoC charts consumed the pointer on
touch-down (awaitFirstDown().consume() + drag), so a vertical swipe that
began on a chart never reached the enclosing scroll container. Split each
into a tap detector (select/toggle the tooltip point) and a
detectHorizontalDragGestures scrubber — horizontal drags still scrub the
crosshair, but vertical swipes are no longer claimed and fall through to
the page scroll. Same tap/scrub behaviour, including the dual-axis
time-label-strip guard.

The tap-only charts (InteractiveBarChart, TripCostDonut) already let
scrolls through; MonthScrollIndicator's drag is an intentional scrollbar.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The charge-detail, drive-detail, where-was-i and regions-visited maps
either panned on a single finger (blocking the page scroll) or didn't
release the parent at all. They now use the same gesture as the trip
detail map: one finger scrolls the surrounding page, two fingers
pan/zoom the map (requestDisallowInterceptTouchEvent only with a second
finger). Removed the now-unused MotionEvent imports.

The dashboard location card is left as-is: it's an inert map thumbnail
that opens the system Maps app on tap, not a movable map.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vide vide merged commit 9333a14 into main Jul 6, 2026
1 check passed
@vide vide deleted the fix/chart-interaction branch July 6, 2026 08:56
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