Chart interaction fixes: scroll-through + comparison tooltip#331
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
surfaceVariantstyle, unlike the line/bar tooltips. It now tracks the crosshair X (clamped on screen) and uses the sharedinverseSurface/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 compileDebugKotlingreen;lintDebug/installDebugverified earlier on the same commits.🤖 Generated with Claude Code