fix(map): keep compass icon visible while following bearing#5728
Conversation
CompassButton tinted its icon `colorScheme.primary` while following the phone bearing, but FilledIconButton's container is also `primary` — so the icon was painted the same color as its own background and disappeared. Tint it `StatusBlue` instead (consistent with the existing `StatusRed` north indicator), which stays legible on the primary-colored button. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📄 Docs staleness check — advisoryThis PR modifies user-facing UI source files but does not update any page under
Changed source files: What to check:
New page checklist (if adding a new doc page):
If this PR does not require a doc update (e.g., internal refactor, bug fix, test change), add the
|
🖼️ Preview staleness check — advisoryThis PR modifies UI composables but does not update any
Changed UI files: What to check:
Adding previews checklist:
If this PR does not require preview updates (e.g., logic-only change, non-visual refactor), add the |
Problem
The compass button on the Mesh Map disappears whenever the map is following the phone's bearing.
Root cause
CompassButton(inMapControlsOverlay.kt) tinted the iconMaterialTheme.colorScheme.primarywhile following. ButMapButtonrenders aFilledIconButton, whose container is alsocolorScheme.primary— so the icon was painted the same green as its own background and vanished. BecauseisFollowingis the first branch in thewhen, this happened for any bearing.This is theme-robust to reason about: the app defaults to
dynamicColor = true, soprimaryis device-dependent, but the icon and its container were always the same role, hence always invisible.Fix
Tint the following-state icon
StatusColors.StatusBlueinstead — a fixed indigo that stays legible on the primary-colored button and matches the existing pattern (thebearing == 0fbranch already uses fixedStatusRed).Testing
./gradlew :feature:map:allTests :feature:map:detekt spotlessCheck— pass (23 tests, no detekt/spotless violations).🤖 Generated with Claude Code