From a65ad1ba349564c1570b1d09fd346b690e07649b Mon Sep 17 00:00:00 2001
From: Michiel Berger
Date: Thu, 30 Apr 2026 21:44:09 +0200
Subject: [PATCH] Add column-glossary legend below the leaderboard table
---
src/pluginbattery/static/style.css | 12 ++++++++++++
src/pluginbattery/templates/index.html | 16 +++++++++++++---
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/pluginbattery/static/style.css b/src/pluginbattery/static/style.css
index 35c2370..ffc6bb9 100644
--- a/src/pluginbattery/static/style.css
+++ b/src/pluginbattery/static/style.css
@@ -188,6 +188,18 @@ table#leaderboard thead th.sort-asc::after { content: " ↑"; color: var(--acce
table#leaderboard thead th.sort-desc::after { content: " ↓"; color: var(--accent); }
table#leaderboard td.pos { color: var(--accent); }
table#leaderboard td.neg { color: var(--warn); }
+
+dl.legend {
+ margin: 1rem 0 0;
+ font-size: 0.78rem;
+ color: var(--muted);
+ display: grid;
+ grid-template-columns: max-content 1fr;
+ column-gap: 0.75rem;
+ row-gap: 0.2rem;
+}
+dl.legend dt { font-weight: 600; color: var(--text); }
+dl.legend dd { margin: 0; }
table#leaderboard tbody tr:hover { background: var(--panel2); }
table#leaderboard tbody tr:first-child { background: rgba(74, 222, 128, 0.08); }
diff --git a/src/pluginbattery/templates/index.html b/src/pluginbattery/templates/index.html
index 2f42eb0..c477e96 100644
--- a/src/pluginbattery/templates/index.html
+++ b/src/pluginbattery/templates/index.html
@@ -4,7 +4,7 @@
Honest battery payback — vs thuisbatterijgids.nl
-
+
@@ -108,7 +108,7 @@
| % sat |
-
+ {# rendered cells start below; legend follows the table. #}
{% for r in initial.batteries %}
| {{ loop.index }} |
@@ -127,6 +127,16 @@
{% endfor %}
+
+
+ - LP €/yr
- Honest year-1 savings from our linear-program oracle (perfect 24h foresight).
+ - LP yr
- Years until cumulative savings (with the chosen inflation rate) recoup the battery cost.
+ - 10-yr net
- Total profit over 10 years: cumulative savings (compounded by inflation) minus the battery cost. Red = doesn't break even within 10 yr.
+ - kWh capt
- kWh of available solar surplus the battery actually absorbed over the year.
+ - % capt
- That, as a percentage of the scenario's total surplus (shown in the heading).
+ - % full
- Of all surplus hours, the % when the battery was already full and couldn't store more — capacity-bottlenecked.
+ - % sat
- Of all surplus hours, the % when charging was pegged at max kW and couldn't keep up — power-bottlenecked.
+
@@ -140,6 +150,6 @@
-
+