Repository navigation
Elemental Showdown: the locked Stats screen and sharing (#165) - #176
Merged
jacobcheatley merged 1 commit intoSep 22, 2026
Merged
Conversation
jacobcheatley
added this pull request to stack #182
September 22, 2026 00:37
jacobcheatley
marked this pull request as ready for review
September 22, 2026 00:38
The Stats have a screen of their own at `/elemental-showdown/stats`, and until the crowd has cast 250 Votes and the Voter 20 of their own it says so rather than showing anything. The gate is the server's: a locked answer carries the two counts and how many tiles the mosaic has, and no Element, colour or Effectiveness leaves the machine. The crowd's number comes from the cached aggregate and counts every Vote ever cast, on an Active Matchup or not, so switching an Element off never walks the meter backwards; the Voter's own is a fresh query, so the Vote they just cast is in it. Both numbers are inclusive, and nothing is stored about having passed them: Votes are never deleted, so the Stats open once and never re-lock. The gate itself is a pure predicate over the two counts, beside the two named constants, so the unlock can be read before and after a Vote as easily as on a page load. What the server function answers is a discriminated union, locked or unlocked; the unlocked side is a placeholder until the Element pages fill it. The locked screen is the prototype's: the display heading, a blank tile per Active Element, a meter each for the two numbers that turns green when it is met, one line on what is still missing, "keep voting" and the share button. Sharing is one button used twice, on the locked screen and at the foot of the exhausted screen: the platform's share sheet where there is one, the clipboard everywhere else, over the absolute address of the voting screen. A Voter who closes the sheet has changed their mind, so an AbortError is not logged as a failure. `/elemental-showdown` is now a layout with no page of its own, holding the head that the voting screen and the Stats share, so the Project's two webfonts are linked once and still by no other page. The voting screen gains its corner link to the Stats in the top Element's own ink, and the exhausted screen gains the Stats button its copy always promised. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AVEtgjCoEbaNHrYfzyCRNH
jacobcheatley
force-pushed
the
feat/165-locked-stats-sharing
branch
from
September 22, 2026 01:08
761fcc8 to
fa45022
Compare
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.
Closes #165. Part of #158.
/elemental-showdown/statsand its gate.showdownStatsanswers a discriminated union: until there are 250 Votes overall (from the cached aggregate) and 20 from this Voter (a fresh query), both inclusive and counting every Vote, it returns only the two counts and the number of Active Elements, so no Effectiveness leaves the server.isStatsUnlockedis the pure predicate over the two counts. Nothing is stored about unlocking: Votes are never deleted, so the Stats never re-lock.The locked screen: "the stats are locked", a mosaic of blank tiles, two meters that turn green when met, one line on what is missing, "keep voting" and a share button.
ShareButtonuses Web Share when present and otherwise copies the link; a cancelled share sheet is not an error. It also sits on theexhaustedscreen beside a Stats button, and the voting screen gains its small link to the Stats./elemental-showdownbecomes a head-only layout route carrying the fonts and meta for both pages.Verification
Real-Postgres tests (inclusive at both numbers, the whole locked payload pinned, a deactivated Element's Votes still counted), component tests (meters, the missing line, both share paths), an e2e smoke test for a fresh browser, and a browser pass beside prototype variant D.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AVEtgjCoEbaNHrYfzyCRNH