From 8f88ccf5813d5ced14f8db784b150f9afb95d1e6 Mon Sep 17 00:00:00 2001 From: Tobi G Date: Fri, 28 Aug 2026 11:31:07 +0200 Subject: [PATCH] =?UTF-8?q?Zuletzt-Kachel:=20Werte=20jetzt=20wirklich=20sp?= =?UTF-8?q?altenb=C3=BCndig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .teaser-Klasse auf die Kachel gesetzt (teaser()). - .teaser .leaf .v: min-width:72px (gleiche Spaltenbreite je Zeile). - .teaser .leaf .k: flex:1 1 auto, damit unterschiedlich lange Labels nicht mehr über justify-content:space-between den ganzen Rest der Zeile verschieben - vorher blieben .v-Boxen zwar gleich breit, saßen aber an unterschiedlichen X-Positionen. Co-Authored-By: Claude Sonnet 5 --- AGENTS.md | 19 +++++++++++++++++++ .../frontend/audi-dashboard-app.js | 2 +- .../frontend/audi-dashboard.css | 16 ++++++++++++++++ .../audi_dashboard/manifest.json | 2 +- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 9a3c23c..c4b043e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4375,6 +4375,25 @@ separation between both stacked value pairs. Verified across `.11`/`.12`: `node --check` clean each time, manifest bumped `2026.8.28.10` → `.11` → `.12`, `audi_ha_test` restarted and confirmed clean via log at each step. +**`.13`/`.14`: the `.12` gap fix wasn't the whole story - the owner sent a screenshot with the two value +stacks bracketed at visibly different X positions.** Measured live rather than guessed: after `.12`, +`.teaser .leaf .v` (added a `.teaser` class on the tile in `.13`, scoped `min-width:72px` to it) DID make +both `.v` boxes the same 72px width, but their absolute `left`/`right` still differed by 56px +(`getBoundingClientRect()` on both: row 1 at x=570-643, row 2 at x=627-699). Root cause: `.leaf` itself +lays out its three children (`.k`/`.v`/chevron) via `justify-content:space-between`, and `.leaf .k` (the +label) has no `flex-grow` - a longer label ("Hermann Mogler Mineralölg. GmbH" vs. the trip row's bare "→") +leaves less leftover space, and `space-between` distributes that shrunk leftover differently, shifting the +*entire* rest of the row including the now-equal-width `.v` block. Fixed by adding `.teaser .leaf .k{flex:1 +1 auto;min-width:0}` alongside the `.13` width fix - `.k` now fills all remaining space itself, so `.v` +sits at a truly fixed offset from the right edge regardless of label length. Scoped to `.teaser` only +(same reasoning as the `.13` width fix - `.leaf` is reused by many other list rows across the app where +per-row value width is normal/desired, e.g. trip and refuel lists; forcing this there could look wrong). +Verified live: `getBoundingClientRect()` on both real rendered `.v` blocks now reports byte-identical +`left`/`right` (750/822 in both rows) - not just equal widths as after `.13` alone. + +Verified: `node --check` clean at both steps, manifest bumped `2026.8.28.12` → `.13` → `.14`, `audi_ha_test` +restarted and confirmed clean via log each time. + Verified live in `audi_ha_test` at every step (`.6` then `.7`), each time reading the actual rendered Setup popup fresh after a real restart (not a stale tab - confirmed via `performance.getEntriesByType('resource')` showing the new `?v=` served with a nonzero transfer size each time). Final state (`.7`), all 20 single-value diff --git a/custom_components/audi_dashboard/frontend/audi-dashboard-app.js b/custom_components/audi_dashboard/frontend/audi-dashboard-app.js index 9e6de41..3145818 100644 --- a/custom_components/audi_dashboard/frontend/audi-dashboard-app.js +++ b/custom_components/audi_dashboard/frontend/audi-dashboard-app.js @@ -1187,7 +1187,7 @@ function badge() { function teaser() { if (!TRIPS.length && !FILLS.length) return ""; const t = TRIPS[0], f = FILLS[0]; - return `
Zuletzt + return `
Zuletzt ${t ? `