Skip to content

feat(holdem): add a session leaderboard of net winnings - #97

Merged
JonasFocus merged 2 commits into
mainfrom
onyx/holdem-leaderboard
Oct 21, 2026
Merged

JonasFocus merged 2 commits into
mainfrom
onyx/holdem-leaderboard

Conversation

@JonasFocus

@JonasFocus JonasFocus commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a "Net" button to the Hold'em header that opens a Sheet ranking players by net winnings tonight.

Changes

  • TxState.buyIns records each player's buy-ins by id: the starting stack on a fresh join (including a bust rejoining) and every rebuy. It survives leaving and rejoining.
  • standings() in lib/texasholdem/winners.ts computes net as chips held minus buy-ins. Chips committed to a live pot still count as held, so a bet does not read as a loss.
  • New components/texasholdem/Standings.tsx renders the list in the existing Sheet.

Why

Nothing showed who is up tonight.

Testing

  • New unit tests for the net calculation, rebuys, rejoin and redaction in tests/texasholdem.test.ts.
  • pnpm lint, pnpm typecheck, pnpm test, pnpm build pass.
  • Smoke test: two ws clients played a room; buy-ins were broadcast, the opponent's hole cards stayed hidden and the deck stayed empty; the room page returned 200.

Notes

  • buyIns is public (only totals, no card information), so redaction is unchanged.
  • A player pruned after the disconnect grace period gets a fresh stack and buy-in on return, as before.

Closes #57

Track each player's buy-ins (starting stack plus every rebuy) in the table
state and show a Sheet of players ranked by holdings minus buy-ins.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RtWWceFv5N8M8qxEPgg2qq
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

Deployment failed for project game-time with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/cloverings1s-projects?upgradeToPro=build-rate-limit

@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

Deployment failed for project game-time with the following error:

Resource is limited - try again in 1 day (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/cloverings1s-projects?upgradeToPro=build-rate-limit

- Keep canRebuyTx on rebuy and record the rebuy in buyIns
- Export standings alongside handLabel, potWon and stackBeforeAward
@JonasFocus JonasFocus added the ready Green and self-reviewed; waiting for merge label Oct 21, 2026
@JonasFocus
JonasFocus merged commit b094071 into main Oct 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Green and self-reviewed; waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a session leaderboard of net winnings

1 participant