mirror of
https://github.com/vide/matedroid.git
synced 2026-01-20 00:03:17 +08:00
refactor(stats): move AC/DC ratio near charges, remove power card
- Moved AC/DC Charging Ratio card right after Charges Overview - Removed the Charging Power card (the "Peak Power" record is still in Records) - Simplified the deep stats section to only show temperature stats 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
626f736c36
commit
28e7d4ccc9
@@ -276,22 +276,19 @@ private fun StatsContent(
|
||||
QuickStatsChargesCard(quickStats = stats.quickStats, palette = palette)
|
||||
}
|
||||
|
||||
// AC/DC Ratio (moved here, near charges)
|
||||
stats.deepStats?.let { deepStats ->
|
||||
item {
|
||||
AcDcRatioCard(deepStats = deepStats, palette = palette)
|
||||
}
|
||||
}
|
||||
|
||||
// Deep Stats - only if available
|
||||
stats.deepStats?.let { deepStats ->
|
||||
// Temperature Stats
|
||||
item {
|
||||
TemperatureStatsCard(deepStats = deepStats, palette = palette)
|
||||
}
|
||||
|
||||
// Charging Power Stats
|
||||
item {
|
||||
ChargingPowerCard(deepStats = deepStats, palette = palette)
|
||||
}
|
||||
|
||||
// AC/DC Ratio
|
||||
item {
|
||||
AcDcRatioCard(deepStats = deepStats, palette = palette)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -688,35 +685,6 @@ private fun TemperatureStatsCard(deepStats: DeepStats, palette: CarColorPalette)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ChargingPowerCard(deepStats: DeepStats, palette: CarColorPalette) {
|
||||
if (deepStats.maxChargerPowerKw == null) {
|
||||
return // No charging power data
|
||||
}
|
||||
|
||||
StatsCard(
|
||||
title = "Charging Power",
|
||||
icon = Icons.Default.ElectricBolt,
|
||||
palette = palette
|
||||
) {
|
||||
Row(modifier = Modifier.fillMaxWidth()) {
|
||||
StatItem(
|
||||
label = "Max Power Achieved",
|
||||
value = "${deepStats.maxChargerPowerKw} kW",
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
}
|
||||
deepStats.chargeWithMaxPower?.let { record ->
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text(
|
||||
text = "on ${record.date?.take(10) ?: "unknown date"}",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = palette.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun formatEnergy(kwh: Double): String {
|
||||
return if (kwh >= 1000) {
|
||||
"%.1f MWh".format(kwh / 1000)
|
||||
|
||||
Reference in New Issue
Block a user