Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions androidApp/src/google/kotlin/org/meshtastic/app/map/MapView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,14 @@ private fun TracerouteMapContent(
)
}
displayNodes.forEach { node ->
val markerState = rememberUpdatedMarkerState(position = node.position.toLatLng())
MarkerComposable(state = markerState, zIndex = 4f) { NodeChip(node = node) }
// Key by the stable node num so each marker's composition state (and MarkerComposable's cached
// icon bitmap) stays bound to its node. Without this, reordering displayNodes between reloads
// reuses marker slots positionally and swaps node labels/positions (#6197). node.user.short_name
// is included as a bitmap key so the rendered chip refreshes when node metadata arrives.
key(node.num) {
val markerState = rememberUpdatedMarkerState(position = node.position.toLatLng())
MarkerComposable(node.num, node.user.short_name, state = markerState, zIndex = 4f) { NodeChip(node = node) }
}
Comment thread
jamesarich marked this conversation as resolved.
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
Expand Down Expand Up @@ -267,10 +268,12 @@ private fun TracerouteCardContent(time: String, summaryText: String, icon: Image
private fun TracerouteCardMetrics(point: TraceroutePoint) {
if (point.forwardHops == null && point.returnHops == null && point.roundTripSeconds == null) return
Spacer(modifier = Modifier.height(4.dp))
Row(
// FlowRow so the three metric labels wrap onto additional lines when they don't fit the card width
// (e.g. long translated strings), rather than the last item being crushed and wrapped per character (#5743).
FlowRow(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(12.dp),
verticalAlignment = Alignment.CenterVertically,
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
point.forwardHops?.let { hops ->
Row(verticalAlignment = Alignment.CenterVertically) {
Expand Down
Loading