summaryrefslogtreecommitdiff
path: root/src/lib/random.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-28 16:56:33 +0300
committerPaul Buetow <paul@buetow.org>2026-06-28 16:56:33 +0300
commit320f9f084ec77b8543e17268ec5e2b3655f50082 (patch)
tree2446ddf24642200907319c5c820010e2f5426ebc /src/lib/random.source.sh
parentec88017a6c3bb2ad16d53dccde1d9546e15d1bdf (diff)
Fix stats gauge bars rendering at width:0% (stats_category_max)
Regression from or0 (STATS_* accessors): stats_category_max compared values via `(( _stats_counts_ref[key] > max ))`. For a nameref to an ASSOCIATIVE array, an arithmetic subscript is itself arithmetic-evaluated, so a string key (e.g. "sony") resolves to an unset variable -> 0, i.e. it always read index 0 and returned max 0. Every bar then scaled to width:0% (counts/percentages were unaffected, so only the bars looked broken). Read the value through a quoted ${assoc[$key]} expansion first, then compare. The byte-identical double-render test missed this because both renders were equally broken; added explicit non-zero bar-width assertions (100% / 50%) to test_render_stats_page_renders_sections_and_escapes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/random.source.sh')
0 files changed, 0 insertions, 0 deletions