feat(firmware): add firmware edition handling (#2508)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2025-07-25 07:07:01 -05:00 committed by GitHub
parent 45ad973d35
commit 924bd25f60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 598 additions and 557 deletions

View file

@ -255,13 +255,16 @@ private fun handleNodeAction(
val channel = if (hasPKC) DataPacket.PKC_CHANNEL_INDEX else node.channel
navigateToMessages("$channel${node.user.id}")
}
is NodeMenuAction.Remove -> {
uiViewModel.handleNodeMenuAction(menuAction)
onNavigateUp()
}
else -> uiViewModel.handleNodeMenuAction(menuAction)
}
}
is NodeDetailAction.ShareContact -> {
/* Handled in NodeDetailContent */
}
@ -438,11 +441,19 @@ private fun AdministrationSection(
}
}
node.metadata?.firmwareVersion?.let { firmwareVersion ->
val latestStable = metricsState.latestStableFirmware
val latestAlpha = metricsState.latestAlphaFirmware
PreferenceCategory(stringResource(R.string.firmware)) {
val firmwareEdition = metricsState.firmwareEdition
firmwareEdition?.let {
NodeDetailRow(
label = stringResource(R.string.firmware_edition),
icon = Icons.Default.Download,
value = it.name,
)
}
node.metadata?.firmwareVersion?.let { firmwareVersion ->
val latestStable = metricsState.latestStableFirmware
val latestAlpha = metricsState.latestAlphaFirmware
PreferenceCategory(stringResource(R.string.firmware)) {
val deviceVersion = DeviceVersion(firmwareVersion.substringBeforeLast("."))
val statusColor = deviceVersion.determineFirmwareStatusColor(latestStable, latestAlpha)