diff --git a/AGENTS.md b/AGENTS.md index dd38608..a8f35a8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3234,6 +3234,39 @@ interact with there); `batterie.py` re-`py_compile`d clean after the floor chang restart confirmed clean via log at every step (single `audi_dashboard` loader warning each time, no duplicate-domain regression). +**Third follow-up (2026.8.27.5): a real regression from the `.1` width fix, plus a robustness gap, both +found from an owner screenshot of the wide-screen chart.** (1) **"Numbers are too large" / "reduce the +height"** - the `.1` fix (aspect-ratio matching the 320:170 viewBox so height scales with width) meant the +whole coordinate system, axis text included, scaled up together: at the full ~772px column width the SVG's +Y-scale grew to ~2.4×, so the `font-size="11"` axis labels rendered at ~26px and the chart itself grew to +~410px tall - both regressions from the same root cause, not two separate bugs. Reverted to a **fixed pixel +height** (`height:${BV_H}px` = 170px, dropping `aspect-ratio` entirely) with `width:100%` unchanged - the +Y-scale is now always exactly 1:1 regardless of container width, so axis text stays a normal ~11px and the +chart stays a compact, constant 170px tall on any screen; only the X-axis stretches to fill the column, +which is exactly the wide-and-short shape the owner asked for. companion-app's `Verlaufsdiagramm` never had +this bug (`.dm-diagramm` already used a fixed `height:120px` with no SVG-embedded text) - nothing to fix +there, confirmed by inspection. +(2) **"0V is being respected on the real instance - why isn't it ignored?"** - the screenshot showed a data +point plotted **below the axis's bottom edge**, past the 10V gridline, and a `0,0 V` SOC readout. Two +different things bundled in that one report: the underlying data point is almost certainly a pre-`.4` +reading (the same class of stale-data issue as `.2` item 1 above) sitting in the **real instance's** +`batteriespannung.jsonl` from before that instance was updated to run the raised `SPANNUNG_MIN_V=10.0` floor +- this session only ever touched `audi_ha_test`, never the owner's real instance, so nothing here confirms +the real instance is even running `.4`/`.5` yet (needs the self-update button + restart, or `install.ps1`, +plus a swipe-delete of the offending day exactly like `.2` item 1). Separately, and fixed here regardless of +that: **`bvSkalaY()` never clamped its output** - a point outside `[yMin, yMax]` (whatever the reason: a +stale reading, a not-yet-updated instance, a future edge case) extrapolated linearly past the plot area +instead of pinning to the axis edge, which is what actually drew the line running off the bottom of the +chart in the screenshot. Clamped the fraction to `[0, 1]` before scaling, in both codebases (companion-app's +equivalent `y()` in `Verlaufsdiagramm` got the identical clamp, for the same reason - it had no text-scaling +bug but shared this gap). This is a defensive rendering fix, not a data fix - it stops a bad point from +visually breaking the chart, but the owner's real instance still needs updating and the stale entry still +needs deleting for the *readout* (SOC/current-value tiles) to stop showing 0V too. Verified live: SVG +measured 736×170px at a 1400px viewport (Y-scale exactly `1`), axis label `getComputedStyle` font-size +`11px`, screenshot confirmed normal-sized labels and a compact chart using the full column. companion-app: +`tsc --noEmit` clean. Manifest bumped to `2026.8.27.5`, `npm run ota` rerun, `audi_ha_test` restart confirmed +clean via log. + --- ## Working conventions (observed — keep them) diff --git a/companion-app/src/screens/Batterie.tsx b/companion-app/src/screens/Batterie.tsx index 76a59bd..124e000 100644 --- a/companion-app/src/screens/Batterie.tsx +++ b/companion-app/src/screens/Batterie.tsx @@ -162,7 +162,12 @@ function Verlaufsdiagramm({ werte }: { werte: Tageswert[] }) { const x = (i: number) => rand + (i / Math.max(1, werte.length - 1)) * (breite - 2 * rand) - const y = (v: number) => hoehe - rand - ((v - kleinster) / spanne) * (hoehe - 2 * rand) + // Anteil auf [0,1] geklemmt statt roh extrapoliert - ein Ausreißer außerhalb + // von kleinster/groesster zeichnet sich sonst weit außerhalb der Fläche. + const y = (v: number) => { + const anteil = Math.max(0, Math.min(1, (v - kleinster) / spanne)) + return hoehe - rand - anteil * (hoehe - 2 * rand) + } const linie = (auswahl: (t: Tageswert) => number | null) => werte diff --git a/custom_components/audi_dashboard/frontend/app/bundle.json b/custom_components/audi_dashboard/frontend/app/bundle.json index 8570a6a..3f3108e 100644 --- a/custom_components/audi_dashboard/frontend/app/bundle.json +++ b/custom_components/audi_dashboard/frontend/app/bundle.json @@ -1 +1 @@ -{"version":"2026.8.27.3","sha256":"b99d93aae2ff58e58107e04f25edfb590e159f55414c11ba4645e82a36f09108","bytes":235508,"gebaut":"2026-08-27T16:01:36Z"} \ No newline at end of file +{"version":"2026.8.27.5","sha256":"8d63b052bdcf4cf2eabd5a01f525fc25c4ab8eea30327dc3b8cbd0db2feb05ed","bytes":235510,"gebaut":"2026-08-27T16:30:48Z"} \ No newline at end of file diff --git a/custom_components/audi_dashboard/frontend/app/bundle.zip b/custom_components/audi_dashboard/frontend/app/bundle.zip index 1ca8eac..9b644a1 100644 Binary files a/custom_components/audi_dashboard/frontend/app/bundle.zip and b/custom_components/audi_dashboard/frontend/app/bundle.zip differ diff --git a/custom_components/audi_dashboard/frontend/audi-dashboard-app.js b/custom_components/audi_dashboard/frontend/audi-dashboard-app.js index 2ed3d14..f934320 100644 --- a/custom_components/audi_dashboard/frontend/audi-dashboard-app.js +++ b/custom_components/audi_dashboard/frontend/audi-dashboard-app.js @@ -1806,7 +1806,7 @@ function vBatterieverlauf() { ${genug ? `