color-by-sign: revert to upward V; sign → color - #11
Merged
Conversation
Round 12's diamond had two regressions: at rest the page filled with
hourglass shapes that don't read as ballot items, and the lower V's
gravity model required water to fill a downward-pointing apex. Round 13
restores the single upward V from rounds 4–11 and pulls all sign
communication into water color.
- Funnel: water height = |votes| × scale; fill uses voteColor(sign(v));
surface stroke uses voteColorDark(sign(v)); walls stay neutral.
Ruler reverts to unsigned 0–10 magnitude. ARIA still reports signed
votes; readout still uses U+2212 for negatives.
- CreditPool: neutral gray-blue gradient (--lqv-pool → --lqv-pool-dark)
so the pool doesn't pre-emptively bias toward either side.
- PourStream: takes voteSign prop; funnel-side gradient stop tracks
voteColor(sign), pool-side stays neutral. Suppressed at exactly v=0.
- voteColor() helper centralizes sign→color mapping. zero defaults to
positive but never visibly resolves (Funnel skips rendering at v=0).
- ThemeOverrides gains votePositive(/-Dark), voteNegative(/-Dark), and
poolDark for embeds that rebrand sign colors.
- Explainer gains a 4th step ("Or vote against. Press the − button.
The water turns red.") with a side-by-side green/red glyph; step 1's
funnel glyph recolored to positive green so explainer matches tool.
Math, reducer, and active-pour state machine unchanged. All 37 tests
still pass; lint, typecheck, and all 3 build targets clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Verified-DOM walkthrough of empty/positive/negative/mixed/cross-zero states with computed fill colors, plus notes on the voteColor helper, theme overrides, and the new explainer step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--lqv-pool→--lqv-pool-dark) so the budget reservoir doesn't pre-empt either side.src/lib/voteColor.tshelper centralizes the sign→color mapping;FunnelandPourStreamconsume it.ThemeOverridesgainsvotePositive(/-Dark),voteNegative(/-Dark), andpoolDarkso embeds can rebrand.aria-valuenow; the under-funnel readout still uses U+2212 for negatives.The signed-vote math —
s = sign(v) × v², monotonic cross-zero accumulation, signed clamping, sign-preserving rounding — is the round-12 implementation, unchanged. Only rendering and color wiring change.Test plan
npm test) — no new test cases needed; pure rendering/color refactor doesn't cross the math/reducer boundary.npm run lintclean.npm run typecheckclean.npm run build:allsucceeds across SPA, library, and Web Component targets.npm run dev:rgb(52, 211, 153)) up the upward V.rgb(248, 113, 113)) up the same upward V.v = 0so there's no flash of the wrong color at the transition.See
docs/round-13/README.mdfor verified-DOM walkthroughs of each state.Do not merge — for review only.
🤖 Generated with Claude Code