Skip to content

fix: stabilize traceroute map node identity & fix log metric alignment - #6270

Merged
jamesarich merged 2 commits into
mainfrom
claude/pensive-leavitt-0e935b
Jul 15, 2026
Merged

fix: stabilize traceroute map node identity & fix log metric alignment#6270
jamesarich merged 2 commits into
mainfrom
claude/pensive-leavitt-0e935b

Conversation

@jamesarich

@jamesarich jamesarich commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Why

Two related bugs in the traceroute UI/rendering path, grouped because they live in the same view and are cheap to fix together.

🐛 #6197 — Traceroute map node IDs change on every reload

On the traceroute map, node markers show the wrong IDs, and re-opening the same traceroute shuffles them. The google-flavor marker loop in TracerouteMapContent emitted MarkerComposables positionally with no composition key and no MarkerComposable keys:

displayNodes.forEach { node ->
    val markerState = rememberUpdatedMarkerState(position = node.position.toLatLng())
    MarkerComposable(state = markerState, zIndex = 4f) { NodeChip(node = node) }
}

displayNodes is derived from a live, time-sorted node flow, so its order is not stable between reloads. MarkerComposable caches its rendered icon bitmap keyed by its keys vararg (empty here), and Compose reuses marker slots positionally — so when the list reorders, a marker keeps a stale cached chip while getting a different node's position, making node IDs look wrong and unstable. This is the same unstable-key class of bug seen elsewhere in the app (lists keyed on index/timestamp instead of node.num).

Fix: wrap each marker in key(node.num) and pass node.num + short_name as MarkerComposable keys, so each marker's composition state and cached bitmap stay bound to its stable node identity. This mirrors the existing NodeTrackMap marker pattern, which already wraps markers in key(position.time).

🐛 #5743 — Traceroute log metric alignment

In the Traceroute Logs list, the third metric label (round-trip time) was crushed and wrapped one character per line vertically. The metrics sat in a plain Row with three items that can't fit the narrow card — worse with longer translated strings (reported in Russian, also reproduces on desktop and in English).

Fix: use FlowRow so the metrics wrap onto a new line cleanly instead of the last item being squeezed to zero width.

Testing Performed

  • ./gradlew spotlessApply spotlessCheck detekt — clean, no violations
  • ./gradlew assembleDebug — passes (all flavors)
  • ./gradlew :feature:node:allTests — passes (~130 tests)

Marker keying is a Compose-recomposition fix that isn't covered by the existing headless tests; the node-selection resolution (tracerouteNodeSelection, already num-keyed) remains covered by TracerouteNodeSelectionTest.

Closes #6197
Closes #5743

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved traceroute map marker stability so hop markers keep the correct node details when the list updates or reorders.
  • UI Improvements
    • Enhanced traceroute metrics layout to wrap onto multiple lines on smaller screens, improving readability when labels don’t fit horizontally.

…nment

Fixes two bugs in the traceroute UI/rendering path.

#6197 — Traceroute map node IDs changing every reload: the google-flavor
traceroute marker loop emitted MarkerComposables positionally with no
composition key and empty MarkerComposable keys. When displayNodes reorders
between reloads, marker slots (and their cached icon bitmaps) get reused
positionally, so node chips/positions appear swapped and unstable. Wrap each
marker in key(node.num) and pass node.num + short_name as MarkerComposable
keys, matching the existing NodeTrack marker pattern.

#5743 — Traceroute log metric alignment: the three metric labels (forward
hops / return hops / round trip) were laid out in a plain Row that can't fit
three items on the narrow card, crushing the last item to ~zero width so it
wrapped one character per line (worse with long translated strings). Use
FlowRow so items wrap onto a new line cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 671cd994-d07f-4386-9ffb-28a5b47f23c5

📥 Commits

Reviewing files that changed from the base of the PR and between 5eea521 and b06bed5.

📒 Files selected for processing (1)
  • androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt

📝 Walkthrough

Walkthrough

Traceroute map markers now use stable Compose keys tied to node identity and receive node metadata inputs. Traceroute log metrics now use a wrapping FlowRow with configured horizontal and vertical spacing.

Changes

Traceroute UI

Layer / File(s) Summary
Stable traceroute map markers
androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt
Traceroute node markers and their chip composition state are keyed by node number, while marker metadata is passed through composition inputs.
Wrapping traceroute metrics
feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/TracerouteLog.kt
TracerouteCardMetrics uses FlowRow with full-width layout and explicit spacing so metric labels can wrap onto additional lines.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two traceroute UI fixes and matches the PR changes.
Linked Issues check ✅ Passed The changes address both linked bugs: stable traceroute map node identity and improved traceroute log metric wrapping.
Out of Scope Changes check ✅ Passed Only traceroute map and log UI changes are present, with no unrelated scope added.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jamesarich jamesarich changed the title 🐛 fix: stabilize traceroute map node identity & fix log metric alignment fix: stabilize traceroute map node identity & fix log metric alignment Jul 15, 2026
@jamesarich jamesarich added the bugfix PR tag label Jul 15, 2026
@jamesarich
jamesarich marked this pull request as ready for review July 15, 2026 01:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt`:
- Around line 1265-1272: Update the marker key arguments around NodeChip and
MarkerComposable to include node.colors and node.isIgnored in addition to
node.num and node.user.short_name, ensuring the marker recomposes when any
NodeChip input changes while preserving the stable node identity.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 27daed07-24b0-4cdb-bb7e-1d75c92e7bb9

📥 Commits

Reviewing files that changed from the base of the PR and between 0c21e98 and 5eea521.

📒 Files selected for processing (2)
  • androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt
  • feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/TracerouteLog.kt

Comment thread androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt
Add node.colors and node.isIgnored to the MarkerComposable keys so the cached
marker icon bitmap refreshes when those NodeChip inputs change (not just
node.num / short_name). Prevents stale colors or strike-through styling on a
marker whose num and short name are unchanged. Addresses CodeRabbit review.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jamesarich
jamesarich added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit 40a9f22 Jul 15, 2026
29 of 31 checks passed
@jamesarich
jamesarich deleted the claude/pensive-leavitt-0e935b branch July 15, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Traceroute map changing nodes IDs every reload [Bug]: Trace route text alignment issue

1 participant