v0.4.2 — voter-share % for multi-choice polls
Highlights
Multi-choice poll percentages now answer "what fraction of the room picked X?" A question with 2 voters and max=3 picks rendered "33% SAP Machine" even when both voters had picked it — the figure was selection-share (count / total selections) rather than voter-share. Audience reading bars as "share of the room" got nonsensical numbers like "33% among 2 voters".
Leader-row percentage label is readable again. The leader row applied color: var(--sp-accent-fg) row-wide, but the bar fill only spans pct% of the row width. The right-anchored percentage label sat outside the bar when pct < 100, so in dark theme the near-black accent-fg landed on the dark row background — illegible.
Fix
ResultsPaneldenominator switches tovoterCountwhenmaxSelections > 1. Single-choice keeps the historicalcount / totalpath (the two are equivalent there). Each voter contributes at most 1 to any option's count, socount / voterCount ≤ 1by construction.- Scoped the leader colour override to
.sp-rp__labelonly. The label sits at the left edge (always inside the bar when pct > 0) and keeps the on-accent foreground; the percentage inherits theme--sp-fgand reads against--sp-bg-subtleoutside the bar.
Tests
- New
ResultsPanel.test.tscase reproduces the exact 2-voter / 6-selection scenario and asserts SAP Machine renders100%(not33%), singletons50%, unpicked0%.