Skip to content

Elemental Showdown: the reveal (#162) - #173

Merged
jacobcheatley merged 1 commit into
feat/161-scoring-functionfrom
feat/162-reveal
Sep 22, 2026
Merged

jacobcheatley merged 1 commit into
feat/161-scoring-functionfrom
feat/162-reveal

Conversation

@jacobcheatley

@jacobcheatley jacobcheatley commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #162. Part of #158.

Casting a Vote now returns the reveal: a fresh per-request split for that Matchup (the Vote just cast included), the Voter's stored value, the share that voted the same, the headline kind and the crowd's mean when there is a verdict. The server flips all of it into the as-shown orientation once, so the Tug never thinks about ids. A repeat Vote reveals the first Vote, which stands.

On screen the seam rests where the Voter left it, each tab becomes one ink shape with a zero-based count bar whose length is that value's share, the Voter's bar takes the pill's place with a "▲ your vote" tag, and a dashed line marks the mean. A card carries the headline, "N% voted the same, of M" and a 3.5s draining bar; the next Matchup is drawn while the Voter reads and slides in when the bar drains or at once on a tap. Under 5 Votes the card says "first to call it" or "early days, only N votes" with no mean line, no verdict and no share line.

Verification

Real-Postgres tests (counts include the Vote just cast; the reveal read from the top Element's side with the higher id on top; a repeat Vote), component tests on fake timers (nothing of the crowd before the Vote, the marked bar and headline, the early form, advance on drain and on tap), and a headless Chromium pass at phone size beside prototype variant G.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AVEtgjCoEbaNHrYfzyCRNH

@jacobcheatley
jacobcheatley added this pull request to stack #182 September 22, 2026 00:37
@jacobcheatley jacobcheatley changed the title Elemental Showdown: reveal the crowd's split on the Vote just cast Elemental Showdown: the reveal (#162) Sep 22, 2026
@jacobcheatley
jacobcheatley marked this pull request as ready for review September 22, 2026 00:38
Casting a Vote now hands back the reveal: the five counts with the
Voter's own Vote in them, the Vote that stands, the share who voted the
same, a headline kind and the crowd's mean when the Matchup has enough
Votes to have a verdict. The counts are a fresh per-request tally of
that one Matchup, so a Voter always sees their own Vote counted, and a
repeat Vote reads the first one back out of the table rather than
echoing what was sent.

A Matchup is stored from the lower-id Element's side and shown from the
top Element's, so the server turns the whole reveal — counts, the Vote
and the mean — into the orientation the Tug is showing before it leaves.
The result carries a `state` tag, which is where the rate limit's
`limited` and the unlock flag go later.

On screen the seam stays where the Voter left it and the five tabs
become five count bars: a fixed-width label, a faint divider, then a
zero-based bar whose length is that value's share and nothing else. The
Voter's own bar takes the pill's place with a heavier outline and a
"your vote" tag, the dashed crowd line travels to the mean, and a card
on the winner's side carries the headline, "N% voted the same, of M" and
a draining bar. Under five Votes there is no mean line and no verdict,
only "first to call it" or "early days". The next Matchup is drawn while
the Voter reads, and slides in when the bar drains or at once on a tap.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AVEtgjCoEbaNHrYfzyCRNH
@jacobcheatley
jacobcheatley merged commit aa7cae0 into main Sep 22, 2026
14 checks passed
@jacobcheatley
jacobcheatley deleted the feat/162-reveal branch September 22, 2026 06:13
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.

Elemental Showdown: the reveal

1 participant