Commit 2de9b0b
refactor(mcp): collapse monitor dashboard helpers and close two unit-test gaps
Perf — uncached dashboard render now runs the per-table monitor CTE 3 times
instead of 5 (review feedback #4). ``get_monitor_changes_by_tables`` already
had the total in hand from ``list_monitor_table_summaries`` and was throwing
it away; ``count_monitor_changes_by_tables`` then re-ran the full CTE
(rows + COUNT) just to recover that total. Helper now returns
``(rows, total)`` directly and the count helper is gone. Render code
unpacks the tuple.
Tests:
- ``test_get_monitor_summary_lookback_out_of_range`` is parametrized over
the lower bound, upper bound, beyond-upper, and a negative — was only
pinning ``lookback=0`` before, so the 1-365 ceiling was untested.
- New ``test_parse_monitor_table_sort_rejects_legacy_row_count_desc``
asserts the legacy ``row_count_desc`` name is rejected and the error
surfaces the renamed ``row_count_change_desc`` — guards against an
accidental revert of the column-rename signal that the dashboard cell
shows a delta, not the raw current count.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 32ffc20 commit 2de9b0b
3 files changed
Lines changed: 28 additions & 30 deletions
File tree
- testgen/ui/views
- tests/unit/mcp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 145 | | |
151 | 146 | | |
152 | 147 | | |
| |||
358 | 353 | | |
359 | 354 | | |
360 | 355 | | |
361 | | - | |
| 356 | + | |
362 | 357 | | |
363 | 358 | | |
364 | | - | |
365 | | - | |
366 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
367 | 365 | | |
368 | 366 | | |
369 | | - | |
| 367 | + | |
370 | 368 | | |
371 | 369 | | |
372 | 370 | | |
373 | 371 | | |
374 | 372 | | |
375 | 373 | | |
376 | 374 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
| 375 | + | |
| 376 | + | |
394 | 377 | | |
395 | 378 | | |
396 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
905 | 917 | | |
906 | 918 | | |
907 | 919 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
203 | | - | |
| 205 | + | |
204 | 206 | | |
| 207 | + | |
205 | 208 | | |
206 | 209 | | |
207 | 210 | | |
| |||
0 commit comments