diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-27 22:54:55 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-27 22:54:55 +0300 |
| commit | 5c7b3a78f2195c217453eda86818d340332e76c5 (patch) | |
| tree | c970f8037d2a50dc909f734acf7ff89edc5c3637 /src/lib/metadata-cache.source.sh | |
| parent | 2a79fd67e8a29e4e37cda38acd9390c5f4594dc2 (diff) | |
stats: replace render_kind case with declare -F name dispatch
_stats_render_category dispatched on render_kind via a four-arm case
(camera|ranked|ordered|month), a modification magnet inconsistent with
the codebase's other data-driven dispatch (the STATS_RECORD_FUNCTIONS
registry and template.source.sh's prepare_template_render_var__<kind>
declare -F lookup).
Resolve the per-kind renderer by name instead: dispatch to
_stats_render_section__<render_kind> via `declare -F`, guarded so a
missing handler fails loudly (and so set -euo pipefail's errexit does
not trip on declare -F's non-zero "absent" status). Rename the three
section renderers to the _stats_render_section__{ranked,ordered,month}
convention.
Fold the camera kind into ranked: the camera leaderboard differed from
an ordinary ranked section only by the extra 'stats-leaderboard' <ul>
class -- data, not logic -- so it becomes a 'ranked' entry carrying that
class in a new optional 5th spec field (list_class), eliminating the
camera special case. Stats body output is byte-identical before/after
for every render kind (verified via snapshot diff); the existing stats
tests stay green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/metadata-cache.source.sh')
0 files changed, 0 insertions, 0 deletions
