Feat/1919 pax graphs (#2477)

Signed-off-by: DaneEvans <dane@goneepic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
DaneEvans 2025-07-21 22:44:29 +10:00 committed by GitHub
parent d6354f7d0f
commit ee99d79574
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 507 additions and 12 deletions

View file

@ -237,6 +237,14 @@ internal fun DebugItem(
color = colorScheme.onSurface
)
)
// Show decoded payload if available
if (!log.decodedPayload.isNullOrBlank()) {
DecodedPayloadBlock(
decodedPayload = log.decodedPayload,
isSelected = isSelected,
colorScheme = colorScheme
)
}
}
}
}
@ -780,3 +788,48 @@ private suspend fun exportAllLogs(context: Context, logs: List<UiMeshLog>) = wit
warn("Error:IOException: " + e.toString())
}
}
@Composable
private fun DecodedPayloadBlock(
decodedPayload: String,
isSelected: Boolean,
colorScheme: ColorScheme
) {
Text(
text = stringResource(id = R.string.debug_decoded_payload),
style = TextStyle(
fontSize = if (isSelected) 10.sp else 8.sp,
fontWeight = FontWeight.Bold,
color = colorScheme.primary
),
modifier = Modifier.padding(top = 8.dp, bottom = 4.dp)
)
Text(
text = "{",
style = TextStyle(
fontSize = if (isSelected) 10.sp else 8.sp,
fontWeight = FontWeight.Bold,
color = colorScheme.primary
),
modifier = Modifier.padding(start = 8.dp, bottom = 2.dp)
)
Text(
text = decodedPayload,
softWrap = true,
style = TextStyle(
fontSize = if (isSelected) 10.sp else 8.sp,
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.8f)
),
modifier = Modifier.padding(start = 16.dp, bottom = 0.dp)
)
Text(
text = "}",
style = TextStyle(
fontSize = if (isSelected) 10.sp else 8.sp,
fontWeight = FontWeight.Bold,
color = colorScheme.primary
),
modifier = Modifier.padding(start = 8.dp, bottom = 4.dp)
)
}