Every row, every time, dashes included

The information card drew a row only when it had a value, so two chargers
side by side had two different shapes and neither could be read against the
other — and a field the service is silent about looked the same as a field
the card never offers. Every row is drawn now, with a dash where there is
nothing to say, which is itself worth seeing.

Service id loses the rule that hid it when it matched the serial. Kept, it
would have printed a dash for a charger that does have one, and a dash that
means "no" where the answer is "the same as above" is worse than the
repetition.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tajniak81
2026-09-01 11:47:23 +02:00
co-authored by Claude Opus 5
parent ad785ee9f8
commit 7cbc81778c
+11 -8
View File
@@ -229,10 +229,11 @@ function homeChargerSubtitle(c) {
return [c.serial, c.model, c.siteName].filter(Boolean).join(" · "); return [c.serial, c.model, c.siteName].filter(Boolean).join(" · ");
} }
// Everything the record holds about one charger, as label/value rows. A field // Everything the card can say about one charger, as label/value rows. Every row
// the service never sent is left out rather than shown as a dash: the point of // is drawn every time, a field nothing supplied included: which fields a charger
// the card is what is known. The provider's own id for the charger is the serial // has an answer for is itself worth seeing, and a row that comes and goes with
// for both services we speak to, so it appears only when it is something else. // the data makes two chargers side by side impossible to read against each
// other. Nothing to say is said with a dash.
function chargerInfoRows(c) { function chargerInfoRows(c) {
const live = liveFor(c) || {}; const live = liveFor(c) || {};
const rows = [ const rows = [
@@ -250,12 +251,14 @@ function chargerInfoRows(c) {
// on it here would be inventing it. // on it here would be inventing it.
["chargePower", live.power], ["chargePower", live.power],
["ocpp", ocppStatusLabel(live)], ["ocpp", ocppStatusLabel(live)],
["providerId", c.providerChargerId === c.serial ? "" : c.providerChargerId], ["providerId", c.providerChargerId],
["added", c.created ? formatDateTime(c.created) : ""], ["added", c.created ? formatDateTime(c.created) : ""],
]; ];
return rows return rows.map(([key, value]) => ({
.filter(([, value]) => value !== "" && value != null) key,
.map(([key, value]) => ({ key, label: t(`charging.info.${key}`), value })); label: t(`charging.info.${key}`),
value: value === "" || value == null ? "—" : value,
}));
} }
async function refreshCtl() { async function refreshCtl() {