Skip to content

Commit 7955967

Browse files
jamesarichclaude
andauthored
refactor(ui): remove StatusSurface scrim behind status-colored chips (#6367)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 602b9b0 commit 7955967

49 files changed

Lines changed: 33 additions & 174 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItem.kt

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ private fun NodeBatteryPositionRow(
284284
@Suppress("CyclomaticComplexMethod", "LongMethod")
285285
@Composable
286286
private fun NodeSignalRow(thatNode: Node, isThisNode: Boolean, contentColor: Color) {
287-
// The signal pill bundles SNR + RSSI + quality into one scrim-backed chip (legibility, see StatusSurface). It's
288-
// wider than a 1/3 grid cell, so it renders on its own line at natural width; the short metrics flow in the grid.
287+
// The signal pill bundles SNR + RSSI + quality into one row. It's wider than a 1/3 grid cell, so it renders on
288+
// its own line at natural width; the short metrics flow in the grid.
289289
var signalChip: (@Composable () -> Unit)? = null
290290
val items =
291291
buildList<@Composable () -> Unit> {
@@ -316,10 +316,10 @@ private fun NodeSignalRow(thatNode: Node, isThisNode: Boolean, contentColor: Col
316316
val showRssi = thatNode.rssi < 0
317317
if (showSnr || showRssi) {
318318
signalChip = {
319-
// Full-width pill: SNR left, RSSI center, quality right — the pre-scrim spread, now
320-
// scrimmed.
321-
StatusSurface(
319+
// Full-width row: SNR left, RSSI center, quality right.
320+
Row(
322321
modifier = Modifier.fillMaxWidth(),
322+
verticalAlignment = Alignment.CenterVertically,
323323
horizontalArrangement = Arrangement.SpaceBetween,
324324
) {
325325
if (showSnr) Snr(thatNode.snr)
@@ -448,29 +448,27 @@ private fun MetricsGrid(items: List<@Composable () -> Unit>) {
448448
}
449449

450450
/**
451-
* [LastHeardInfo] backed by a scrim chip and tinted StatusGreen when [online] — the legible "online" affordance —
452-
* rendered plain otherwise. Shared by the complete and compact node rows.
451+
* [LastHeardInfo] tinted StatusGreen when [online] — the "online" affordance — rendered plain otherwise. Shared by the
452+
* complete and compact node rows.
453453
*/
454454
@Composable
455455
internal fun StatusAwareLastHeard(lastHeard: Int, online: Boolean, contentColor: Color, relative: Boolean = true) {
456-
if (online) {
457-
StatusSurface {
458-
LastHeardInfo(
459-
lastHeard = lastHeard,
460-
showLabel = false,
461-
relative = relative,
462-
contentColor = MaterialTheme.colorScheme.StatusGreen,
463-
)
464-
}
465-
} else {
466-
LastHeardInfo(lastHeard = lastHeard, showLabel = false, relative = relative, contentColor = contentColor)
467-
}
456+
LastHeardInfo(
457+
lastHeard = lastHeard,
458+
showLabel = false,
459+
relative = relative,
460+
contentColor = if (online) MaterialTheme.colorScheme.StatusGreen else contentColor,
461+
)
468462
}
469463

470-
/** Key status (always status-colored) + the signed-node shield share one scrim chip so both stay legible. */
464+
/** Key status (always status-colored) + the signed-node shield. */
471465
@Composable
472466
fun NodeSecurityIcons(thatNode: Node, modifier: Modifier = Modifier, iconSize: Dp = 20.dp) {
473-
StatusSurface(modifier = modifier) {
467+
Row(
468+
modifier = modifier,
469+
verticalAlignment = Alignment.CenterVertically,
470+
horizontalArrangement = Arrangement.spacedBy(4.dp),
471+
) {
474472
if (thatNode.signsPackets) {
475473
NodeSignedStatusIcon(modifier = Modifier.size(iconSize))
476474
}

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItemCompact.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,12 @@ private fun CompactHealthRow(
356356
val quality = determineSignalQuality(thatNode.snr, LocalModemPreset.current)
357357
add(
358358
@Composable {
359-
StatusSurface {
360-
IconInfo(
361-
icon = vectorResource(quality.icon),
362-
contentDescription = stringResource(quality.nameRes),
363-
contentColor = quality.color.invoke(),
364-
text = stringResource(quality.nameRes),
365-
)
366-
}
359+
IconInfo(
360+
icon = vectorResource(quality.icon),
361+
contentDescription = stringResource(quality.nameRes),
362+
contentColor = quality.color.invoke(),
363+
text = stringResource(quality.nameRes),
364+
)
367365
},
368366
)
369367
}

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/StatusSurface.kt

Lines changed: 0 additions & 67 deletions
This file was deleted.

core/ui/src/commonTest/kotlin/org/meshtastic/core/ui/component/StatusSurfaceTest.kt

Lines changed: 0 additions & 63 deletions
This file was deleted.

feature/messaging/src/commonMain/kotlin/org/meshtastic/feature/messaging/component/MessageItem.kt

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import androidx.compose.foundation.layout.Arrangement
2323
import androidx.compose.foundation.layout.Box
2424
import androidx.compose.foundation.layout.Column
2525
import androidx.compose.foundation.layout.IntrinsicSize
26-
import androidx.compose.foundation.layout.PaddingValues
2726
import androidx.compose.foundation.layout.Row
2827
import androidx.compose.foundation.layout.Spacer
2928
import androidx.compose.foundation.layout.fillMaxWidth
@@ -79,7 +78,6 @@ import org.meshtastic.core.ui.component.NODE_TINT_NORMAL
7978
import org.meshtastic.core.ui.component.NodeChip
8079
import org.meshtastic.core.ui.component.Rssi
8180
import org.meshtastic.core.ui.component.Snr
82-
import org.meshtastic.core.ui.component.StatusSurface
8381
import org.meshtastic.core.ui.component.TransportIcon
8482
import org.meshtastic.core.ui.component.nodeBorderStroke
8583
import org.meshtastic.core.ui.component.nodeTintedContainer
@@ -329,21 +327,16 @@ fun MessageItem(
329327
if (!message.fromLocal) {
330328
// XEdDSA is only set on verified broadcasts, never DMs — so this never shows on a DM.
331329
if (message.xeddsaSigned) {
332-
// Solo icon → equal padding so the pill renders as a circle.
333-
StatusSurface(contentPadding = PaddingValues(3.dp)) {
334-
Icon(
335-
imageVector = MeshtasticIcons.ShieldCheck,
336-
contentDescription = stringResource(Res.string.security_signed_verified),
337-
modifier = Modifier.size(16.dp),
338-
tint = MaterialTheme.colorScheme.StatusGreen,
339-
)
340-
}
330+
Icon(
331+
imageVector = MeshtasticIcons.ShieldCheck,
332+
contentDescription = stringResource(Res.string.security_signed_verified),
333+
modifier = Modifier.size(16.dp),
334+
tint = MaterialTheme.colorScheme.StatusGreen,
335+
)
341336
}
342337
if (message.hopsAway == 0 && !message.viaMqtt) {
343-
StatusSurface {
344-
Snr(message.snr)
345-
Rssi(message.rssi)
346-
}
338+
Snr(message.snr)
339+
Rssi(message.rssi)
347340
} else {
348341
Row(
349342
verticalAlignment = Alignment.CenterVertically,

0 commit comments

Comments
 (0)