Claude commited on
Commit
134bb77
·
1 Parent(s): 3af727f

Add hoverable/expandable About panels to data-type checkboxes

Browse files

- Remove sub-labels (Power, MW) and ⓘ info icon from checkbox rows
- Add ▶ About toggle button next to each checkbox label; hover shows
a compact tooltip, click expands an inline column-definition panel
- Stack same-section result panels flush (card-group, no gap) while
keeping clear spacing between top-level sections (Select Data,
SCADA results, Energy results, About this app)

https://claude.ai/code/session_01TrCrzZmWbQscJiAQaW7Rg8

app/static/css/style.css CHANGED
@@ -118,10 +118,22 @@ select:disabled, input:disabled {
118
  .data-type-group {
119
  display: flex;
120
  flex-direction: column;
121
- gap: 0.45rem;
122
  padding-top: 0.2rem;
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  .check-label {
126
  display: flex;
127
  align-items: center;
@@ -147,12 +159,69 @@ select:disabled, input:disabled {
147
  cursor: not-allowed;
148
  }
149
 
150
- .check-sub {
151
- font-size: 0.78rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  font-weight: 400;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  color: var(--text-muted);
 
154
  }
155
 
 
 
 
 
 
 
 
 
156
  /* ── Buttons ── */
157
  .btn {
158
  display: inline-flex;
@@ -415,12 +484,32 @@ select:disabled, input:disabled {
415
  gap: 3rem;
416
  }
417
 
418
- /* Space between the individual panels within each section */
419
  #scada-results,
420
  #energy-results {
421
  display: flex;
422
  flex-direction: column;
423
- gap: 1.5rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  }
425
 
426
  /* ── Charts ── */
 
118
  .data-type-group {
119
  display: flex;
120
  flex-direction: column;
121
+ gap: 0.55rem;
122
  padding-top: 0.2rem;
123
  }
124
 
125
+ .check-row {
126
+ display: flex;
127
+ flex-direction: column;
128
+ gap: 0;
129
+ }
130
+
131
+ .check-row-header {
132
+ display: flex;
133
+ align-items: center;
134
+ gap: 0.5rem;
135
+ }
136
+
137
  .check-label {
138
  display: flex;
139
  align-items: center;
 
159
  cursor: not-allowed;
160
  }
161
 
162
+ /* ▶ About toggle button */
163
+ .about-toggle {
164
+ background: none;
165
+ border: none;
166
+ color: var(--text-muted);
167
+ font-size: 0.72rem;
168
+ font-weight: 500;
169
+ font-family: inherit;
170
+ cursor: pointer;
171
+ padding: 0 0.15rem;
172
+ position: relative;
173
+ white-space: nowrap;
174
+ transition: color 0.15s;
175
+ }
176
+
177
+ .about-toggle:hover { color: var(--accent); }
178
+
179
+ /* Tooltip on the About button */
180
+ .about-toggle::after {
181
+ content: attr(data-tip);
182
+ position: absolute;
183
+ top: calc(100% + 7px);
184
+ left: 0;
185
+ background: var(--surface);
186
+ border: 1px solid var(--border);
187
+ border-radius: var(--radius);
188
+ padding: 0.5rem 0.7rem;
189
+ font-size: 0.75rem;
190
  font-weight: 400;
191
+ color: var(--text);
192
+ white-space: normal;
193
+ width: 260px;
194
+ z-index: 200;
195
+ pointer-events: none;
196
+ opacity: 0;
197
+ transition: opacity 0.15s;
198
+ line-height: 1.5;
199
+ box-shadow: 0 4px 16px rgba(0,0,0,0.5);
200
+ text-align: left;
201
+ }
202
+
203
+ .about-toggle:hover::after { opacity: 1; }
204
+
205
+ /* Expandable about panel */
206
+ .check-about {
207
+ margin-top: 0.55rem;
208
+ padding: 0.7rem 0.85rem;
209
+ background: rgba(255,255,255,0.025);
210
+ border: 1px solid var(--border);
211
+ border-radius: var(--radius);
212
+ font-size: 0.78rem;
213
  color: var(--text-muted);
214
+ line-height: 1.6;
215
  }
216
 
217
+ .about-source {
218
+ font-size: 0.75rem;
219
+ margin-bottom: 0.6rem;
220
+ color: var(--text-muted);
221
+ }
222
+
223
+ .about-source strong { color: var(--text); }
224
+
225
  /* ── Buttons ── */
226
  .btn {
227
  display: inline-flex;
 
484
  gap: 3rem;
485
  }
486
 
487
+ /* Panels within each section are stacked flush no gap */
488
  #scada-results,
489
  #energy-results {
490
  display: flex;
491
  flex-direction: column;
492
+ gap: 0;
493
+ }
494
+
495
+ /* Card-group: square off inner edges, collapse duplicate borders */
496
+ #scada-results .panel,
497
+ #energy-results .panel {
498
+ border-radius: 0;
499
+ }
500
+ #scada-results .panel:first-child,
501
+ #energy-results .panel:first-child {
502
+ border-top-left-radius: var(--radius);
503
+ border-top-right-radius: var(--radius);
504
+ }
505
+ #scada-results .panel:last-child,
506
+ #energy-results .panel:last-child {
507
+ border-bottom-left-radius: var(--radius);
508
+ border-bottom-right-radius: var(--radius);
509
+ }
510
+ #scada-results .panel + .panel,
511
+ #energy-results .panel + .panel {
512
+ border-top: none;
513
  }
514
 
515
  /* ── Charts ── */
app/static/index.html CHANGED
@@ -48,15 +48,65 @@
48
  <div class="form-group">
49
  <label>Data Types</label>
50
  <div class="data-type-group">
51
- <label class="check-label">
52
- <input type="checkbox" id="chk-scada" checked />
53
- 4-second SCADA <span class="check-sub">(Power, MW)</span>
54
- </label>
55
- <label class="check-label">
56
- <input type="checkbox" id="chk-energy" checked />
57
- 5-minute Dispatch <span class="check-sub">(Energy, MWh)</span>
58
- <span class="info-icon tip-below" data-tip="INITIALMW, INITIAL_ENERGY_STORAGE and ENERGY_STORAGE from AEMO's DISPATCH_UNIT_SOLUTION table. Available from 11 Feb 2025."></span>
59
- </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  </div>
61
  </div>
62
 
 
48
  <div class="form-group">
49
  <label>Data Types</label>
50
  <div class="data-type-group">
51
+
52
+ <div class="check-row">
53
+ <div class="check-row-header">
54
+ <label class="check-label">
55
+ <input type="checkbox" id="chk-scada" checked />
56
+ 4-second SCADA
57
+ </label>
58
+ <button class="about-toggle" data-tip="4-sec power output &amp; quality flags from AEMO FPP Daily (PUBLIC_NEXT_DAY_FPPMW). Available from 28 Feb 2025." aria-expanded="false" aria-controls="about-scada">▶ About</button>
59
+ </div>
60
+ <div class="check-about hidden" id="about-scada">
61
+ <p class="about-source">Source: <strong>PUBLIC_NEXT_DAY_FPPMW</strong> (FPP Daily) &nbsp;·&nbsp; Available from <strong>28 Feb 2025</strong></p>
62
+ <div class="col-defs">
63
+ <div class="col-def">
64
+ <span class="col-name">INTERVAL_DATETIME</span>
65
+ <span class="col-desc">Target 4-second grid slot (YYYY/MM/DD HH:MM:SS). Each measurement is snapped to the nearest standard interval.</span>
66
+ </div>
67
+ <div class="col-def">
68
+ <span class="col-name">MEASUREMENT_DATETIME</span>
69
+ <span class="col-desc">Actual timestamp the SCADA reading was recorded. May differ slightly from <code>INTERVAL_DATETIME</code> due to communication latency.</span>
70
+ </div>
71
+ <div class="col-def">
72
+ <span class="col-name">MEASURED_MW</span>
73
+ <span class="col-desc">Instantaneous power (MW). Positive = discharging (generation), negative = charging (load).</span>
74
+ </div>
75
+ <div class="col-def">
76
+ <span class="col-name">MW_QUALITY_FLAG</span>
77
+ <span class="col-desc">Data health code — <strong style="color:var(--good)">0</strong> Good · <strong style="color:var(--suspect)">1</strong> Substituted · <strong style="color:var(--bad)">2</strong> Bad · <strong style="color:var(--na)">3</strong> Manual Override.</span>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
82
+
83
+ <div class="check-row">
84
+ <div class="check-row-header">
85
+ <label class="check-label">
86
+ <input type="checkbox" id="chk-energy" checked />
87
+ 5-minute Dispatch
88
+ </label>
89
+ <button class="about-toggle" data-tip="5-min dispatch energy storage &amp; MW from AEMO DISPATCH_UNIT_SOLUTION. Available from 11 Feb 2025." aria-expanded="false" aria-controls="about-energy">▶ About</button>
90
+ </div>
91
+ <div class="check-about hidden" id="about-energy">
92
+ <p class="about-source">Source: <strong>DISPATCH_UNIT_SOLUTION</strong> via Next_Day_Dispatch &nbsp;·&nbsp; Available from <strong>11 Feb 2025</strong></p>
93
+ <div class="col-defs">
94
+ <div class="col-def">
95
+ <span class="col-name">INITIALMW</span>
96
+ <span class="col-desc">Actual power output (MW) at the exact start of the 5-minute dispatch interval. Used as the baseline for the next dispatch instruction.</span>
97
+ </div>
98
+ <div class="col-def">
99
+ <span class="col-name">INITIAL_ENERGY_STORAGE</span>
100
+ <span class="col-desc">State of Energy (SoE) at interval start (MWh) — energy physically available in the battery before dispatch began.</span>
101
+ </div>
102
+ <div class="col-def">
103
+ <span class="col-name">ENERGY_STORAGE</span>
104
+ <span class="col-desc">Target energy level at interval end (MWh) — accounts for scheduled charging or discharging during the 5-minute block.</span>
105
+ </div>
106
+ </div>
107
+ </div>
108
+ </div>
109
+
110
  </div>
111
  </div>
112
 
app/static/js/app.js CHANGED
@@ -85,6 +85,17 @@ async function init() {
85
  chkScada.addEventListener('change', onCheckboxChange);
86
  chkEnergy.addEventListener('change', onCheckboxChange);
87
  btnLoad.addEventListener('click', onLoad);
 
 
 
 
 
 
 
 
 
 
 
88
  }
89
 
90
  function onStateChange() {
 
85
  chkScada.addEventListener('change', onCheckboxChange);
86
  chkEnergy.addEventListener('change', onCheckboxChange);
87
  btnLoad.addEventListener('click', onLoad);
88
+
89
+ // ▶ About toggles
90
+ document.querySelectorAll('.about-toggle').forEach(btn => {
91
+ btn.addEventListener('click', () => {
92
+ const panel = document.getElementById(btn.getAttribute('aria-controls'));
93
+ const expanded = btn.getAttribute('aria-expanded') === 'true';
94
+ btn.setAttribute('aria-expanded', String(!expanded));
95
+ panel.classList.toggle('hidden', expanded);
96
+ btn.textContent = expanded ? '▶ About' : '▼ About';
97
+ });
98
+ });
99
  }
100
 
101
  function onStateChange() {