Tanken: Distanz-Vorschlag bevorzugt TANK_DISTANZ_SENSOR; Zuletzt-Kachel: Zeilenabstand ergänzt

- distanzVorschlag(): liest jetzt zuerst den Live-Wert von TANK_DISTANZ_SENSOR
  (wie backendseitig schon in distanz_seit_tankung()), fällt ohne Zuordnung
  auf die bisherige FILLS-Berechnung zurück (jetzt distanzVorschlagBerechnet()).
- .leaf .v: gap:3px ergänzt (fehlte im Gegensatz zu .leaf .k) - die zweizeiligen
  Werte in der "Zuletzt"-Kachel (Übersicht) berührten sich sonst.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-28 11:26:23 +02:00
parent ff9aaeb338
commit dd8d62e3b3
4 changed files with 56 additions and 7 deletions
+31
View File
@@ -4344,6 +4344,37 @@ Verified: `py_compile` clean on `einstellungen.py` (inside `audi_ha_test`, `MSYS
Windows path once, worth remembering for future sessions), manifest bumped to `2026.8.28.10`,
`audi_ha_test` restarted and confirmed clean via log, both fixes confirmed live in the browser as above.
**`.11`: "Gefahrene Distanz" in `Neuer Tankvorgang` prefers the live `TANK_DISTANZ_SENSOR` reading.**
Owner report: after the `.9` negative-distance clamp, the field showed a plain "0" placeholder and the
owner expected "the current sensor output" there instead, plus asked to confirm the AUTO-DETECTED refuel
path already uses `TANK_DISTANZ_SENSOR`. Confirmed the second part first by reading `tankerkennung.py`:
`distanz_seit_tankung()` (called from `_automatisch_anlegen()`) already prefers the sensor and only falls
back to the odometer-subtraction when unmapped - built in section Q, unchanged. The frontend's manual-entry
prefill never had that preference though - `distanzVorschlag()` only ever did the FILLS-based subtraction.
Split it: the old body is now `distanzVorschlagBerechnet()` (pure fallback, same negative-clamp from `.9`),
and `distanzVorschlag()` itself now checks `ENTITAETEN.werte.TANK_DISTANZ_SENSOR` first and returns its
live numeric state if mapped and valid, falling back to `distanzVorschlagBerechnet()` otherwise - the exact
same "sensor preferred, own calculation as fallback" order as the backend, just mirrored in JS for the
still-unsaved form. Verified live: the container's real mapped sensor
(`sensor.testcar_b9_fmm003_testintegratoin_calculated_distance_covered_after_the_latest_refueling`) reads
`407` - opening `Neuer Tankvorgang` now shows `407` (real value, not placeholder-grey) instead of the
`.9`-era empty/`"0"`-placeholder state. companion-app has no "Gefahrene Distanz" field in its own Tanken
form at all (structurally never had one - the backend fills it in itself when omitted), so nothing to port
there, per the parity rule's carve-out for structural differences.
**`.12`: "offen"/"offen" and "51,59 l"/"85,59 €" were touching, not just close** - the Übersicht's
"Zuletzt" tile (`teaser()`) stacks a value and a `<small>` caption via `.leaf .v{display:flex;
flex-direction:column}` - the sibling `.leaf .k` column already had `gap:3px` for the same two-line
pattern, but `.leaf .v` never got it, so its two lines had zero gap and visually touched. Added the
matching `gap:3px`. Panel-only bug (companion-app's equivalent "Letzte Fahrt"/"Letzter Tankvorgang" tiles
use the shared `@audi-dash/ui` `NaviKachel` grid component, a structurally different layout with no
equivalent gap-less two-line stack) - confirmed via source, no companion-app change needed. Verified live:
`getComputedStyle` on the real rendered `.leaf .v` reports `gap: 3px`, and the screenshot shows clear
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.
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