Skip to content

card-layout: identity → status → visual → action - #12

Merged
jackhenderson12 merged 2 commits into
mainfrom
card-layout
May 9, 2026
Merged

card-layout: identity → status → visual → action#12
jackhenderson12 merged 2 commits into
mainfrom
card-layout

Conversation

@jackhenderson12

Copy link
Copy Markdown
Contributor

Summary

  • Reorganizes each candidate card so every element has one clean vertical position: name → readout → funnel → centered ±buttons. The readout moves from sharing a row with the buttons at the bottom to sitting directly under the candidate name.
  • The reset link stays visually pinned to the top-right corner (absolute positioning) but moves to last in source order so the tab path is funnel slider → − → + → reset rather than starting on reset.
  • Pure layout refactor: one file (src/components/LiquidQV.tsx), per-card JSX block. No math, no state, no new components, no color or rendering changes.

What didn't change

  • Funnel.tsx, PourStream.tsx, PourControl.tsx, CreditPool.tsx — untouched.
  • All math (src/math/qv.ts), the reducer, the active-pour state machine.
  • ARIA labels, the Unicode-minus readout, integer formatting.
  • The intro copy, on-load explainer, footer, default ballot.

Test plan

  • All 37 existing tests pass (npm test) — no behavioral change, no new tests required.
  • npm run lint clean.
  • npm run typecheck clean.
  • npm run build:all succeeds across SPA, library, and Web Component targets.
  • Visually verified in npm run dev:
    • Empty load: each card renders name → 0 votes 0 credits → empty funnel → centered ±buttons; reset top-right.
    • Positive vote: hold + on Harris ~1.5 s → readout above the funnel updates to +3 votes 9 credits; green water at level 3; buttons stay centered.
    • Negative vote: hold − on Newsom ~1.5 s → readout reads −3 votes 9 credits; red water at level 3.
    • Mixed-sign grid (4 of 6 active): pool 74/100, all readouts updated in place above their funnels.
    • Mid-pour with stream: stream renders in the gap between readout and funnel SVG (the same 64-px slot it always reserves) — readout updates live, layout doesn't shift.
    • Cross-zero hold: drained Harris from +3 through zero to −2 in one continuous gesture; readout flipped through the integers and water flipped color, all in the same vertical column.
    • Mobile (375 × 812): cards stack one-per-row; vertical layout reads cleanly with no horizontal scrolling.
  • Tab order verified: Votes for Kamala Harris (slider) → Move … vote downMove … vote upReset votes on Kamala Harris.

See docs/round-14/README.md for verified-DOM walkthroughs of each state.

Do not merge — for review only.

🤖 Generated with Claude Code

Jack Henderson and others added 2 commits May 8, 2026 17:24
The old card put the vote readout in a row with the +/− buttons at
the bottom, forcing the eye to drop down and across after registering
the funnel — text arriving late, competing with the controls for the
same horizontal band.

Reorganize each card into a top-to-bottom column with one element per
position:

  1. Candidate name + party                    (top, with reset)
  2. Vote readout ("+5 votes 25 credits")      (NEW: above the funnel)
  3. Funnel SVG with ruler                     (unchanged)
  4. ±buttons centered                         (NEW: below the funnel)

Pure layout change — no math, no state, no new components, no color
or rendering changes. The readout keeps its full type weight; it now
heads the card's text column rather than sharing space with the
controls.

Reset link stays visually pinned to the top-right corner via absolute
positioning, but is sourced last so the focusable tab order ends on
it: funnel slider → − → + → reset (matches reading order).

Verified: 37/37 tests pass; lint, typecheck, and all 3 build targets
clean. Visual states checked in dev preview at desktop (3-col grid)
and mobile (375 px stacked) — empty, mid-pour with active stream,
positive vote, negative vote, mixed-sign grid, and cross-zero hold.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per-state walkthrough (empty / positive / negative / mixed / mid-pour
/ cross-zero / mobile) with verified-DOM snapshots and tab-order
listing for the Harris card. Same documentation pattern as round-13.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jackhenderson12
jackhenderson12 merged commit b61be17 into main May 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant