feat: explicit + prefix on positive P&L values (CVD accessibility)

Gain/loss no longer rides on green/red alone — red-green color vision
deficiency affects ~8% of males; the minus sign already printed, now the
plus does too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
momentum devandClaude Fable 5 committed 2026-07-31 18:36:41 -05:00
1 parent da17be8969
commit 81bf1540ef
1 file changed
+4 -1
+4 -1
View File
@@ -690,7 +690,10 @@ const money = (v) => (v === null || v === undefined || isNaN(+v)) ? "—" : (v <
const esc = (s) => String(s ?? "").replace(/[&<>"']/g, c => ({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[c]));
const timeOf = (ts) => { try { return new Date(ts).toLocaleTimeString(); } catch { return "—"; } };
const signed = (el, v) => {
el.textContent = (v === null || v === undefined || isNaN(+v)) ? "—" : money(v);
// explicit "+" so gain/loss never rides on color alone (red-green CVD ~8% of
// males; the minus already prints, the plus must too)
el.textContent = (v === null || v === undefined || isNaN(+v)) ? "—"
: (+v > 0 ? "+" : "") + money(v);
el.className = "value num " + (+v > 0 ? "pos" : +v < 0 ? "neg" : "");
};