No description
Find a file
Jonathan Hvid 5ddaad3da3 feat(vote): show percentages after voting + allow change-of-mind
The pulse vote widget on /pulse and on /dispatches/[slug] now behaves
the way the v5 spec asks:

- Eyebrow shortens: 'This week's pulse' → 'This week's'.
- Status line copy changes shape depending on whether the viewer has
  voted yet. Pre-vote: 'Vote to see how the council weighs in · Closes
  TUESDAY' — sets expectations that the percentages reveal after a
  vote. Post-vote: '2 of 7 voted · Closes TUESDAY · Click to change' —
  tells the viewer they can change their mind.
- Each option now renders a right-aligned tabular-nums percentage badge,
  but only after the viewer has voted. Pre-vote there's no percentage
  on screen at all — voting is a commitment, not a peek.
- Options stay clickable after voting (no `disabled`). Re-clicking a
  different option changes the vote.

DB: new helper castOrChangeVote(pulseId, userId, optionIndex) does an
UPSERT — INSERT on first vote, UPDATE option_index + voted_at on
subsequent. Returns true if this was the brand-new vote, so the caller
can write the 'voted' activity row exactly once and not double-count
changes-of-mind in the feed. castVote(...) (INSERT OR IGNORE) stays in
db.ts for callers that explicitly want first-vote-wins semantics.

Status-class rename: .locked → .closed on both pulse-option and
inline-poll-option. The class now reflects what it actually represents
(the pulse is closed) rather than the false invariant 'the user has
voted and can't change'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 11:20:16 +02:00
.claude style: drop eyebrows + body italics across editorial pages 2026-05-12 09:52:29 +02:00
content feat: database schema, migrations, and seed data 2026-04-18 22:43:16 +02:00
design chore: add Innofounder logo to public, wire to home page 2026-04-19 20:36:54 +02:00
migrations feat(db): roadmap_items gains 'considering' + 'in_beta' rename, --on-ink tokens 2026-05-12 10:46:39 +02:00
public chore: add Innofounder logo to public, wire to home page 2026-04-19 20:36:54 +02:00
scripts feat(pulse): spacing pass + council section header + 7-item roadmap seed 2026-05-12 10:58:34 +02:00
src feat(vote): show percentages after voting + allow change-of-mind 2026-05-12 11:20:16 +02:00
tests feat(pulse): two-column greeting + tenure-milestone copy 2026-05-12 10:48:50 +02:00
.env.example feat: database schema, migrations, and seed data 2026-04-18 22:43:16 +02:00
.gitignore wip: scaffold and index before style-guide 2026-04-18 16:09:49 +02:00
astro.config.mjs feat: database schema, migrations, and seed data 2026-04-18 22:43:16 +02:00
CLAUDE.md wip: scaffold and index before style-guide 2026-04-18 16:09:49 +02:00
DECISIONS.md docs: document decisions D-15 through D-18 2026-04-19 20:32:09 +02:00
HANDOVER.md docs: HANDOVER.md — build summary and next steps 2026-04-18 22:54:48 +02:00
KNOWN_ISSUES.md feat(db): add migration 0003 for council portal schema 2026-05-11 14:39:07 +02:00
package.json chore(demo): seed-demo.js + utc fix for last_seen_at 2026-05-11 15:04:11 +02:00
pnpm-lock.yaml feat: database schema, migrations, and seed data 2026-04-18 22:43:16 +02:00
SPEC.md wip: scaffold and index before style-guide 2026-04-18 16:09:49 +02:00
todo.md docs: capture deferred home-page features in todo.md 2026-05-11 17:04:40 +02:00
tsconfig.json wip: scaffold and index before style-guide 2026-04-18 16:09:49 +02:00
vitest.config.ts test: vitest suite — pulse status, vote uniqueness, home route 2026-05-11 14:45:55 +02:00