Skip to content

feat(holdem): count stacks up and bump the pot when the winner is called - #93

Merged
JonasFocus merged 6 commits into
mainfrom
onyx/stack-tick
Oct 20, 2026
Merged

JonasFocus merged 6 commits into
mainfrom
onyx/stack-tick

Conversation

@JonasFocus

Copy link
Copy Markdown
Owner

Summary

Stacks now count up when the winner is called, and the pot bumps when swept bets land.

Changes

  • Count up the header stack and every seat stack with the shared useCountUp hook, starting from the pre-award value.
  • Add stackBeforeAward in lib/texasholdem/winners.ts, built on paidOut, so uncalled-bet refunds also count up.
  • Bump the pot when swept bets land; the bump and the count-up are disabled under reduced motion.
  • Make useCountUp return its target immediately when motion is reduced.

Closes #45

Why

Chips used to jump to their new totals at showdown, which made it hard to see who won what. Counting up from the held-back stack ties the payout to the winner call.

Testing

  • pnpm typecheck and pnpm test (337 pass)
  • Added assertions in tests/texasholdem.test.ts for the uncalled-bet case (held stacks at showdown, unchanged on the river)
  • Ran the server and played two seats to showdown over a ws client; the held-back stack matched the expected pre-award value

Notes

The animation timing and pot bump were not checked in a browser.

… the felt motion helpers

- Tween the header stack from its held-back value to the final one on reveal, and add stackBeforeAward for the seat label and header
- Replace the local reducedMotion and gapTo with the casino/motion exports
- Skip the .tx-lift and TurnClock transitions under prefers-reduced-motion

Claude-Session: https://claude.ai/code/session_01SiinSXHP71xKCXmAjpTHaM
- Animate the seat and header stacks from the held-back value to the paid-out value with the shared useCountUp hook, which already skips to the end under reduced motion
- Derive the held-back stack from paidOut so an uncalled bet refund counts up too, and move stackBeforeAward next to it
- Bump the pot figure as swept bets land, with the bump disabled under prefers-reduced-motion
- Cover stackBeforeAward in the engine tests

Claude-Session: https://claude.ai/code/session_01SiinSXHP71xKCXmAjpTHaM
@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

@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

@JonasFocus JonasFocus added ready Green and self-reviewed; waiting for merge and removed ready Green and self-reviewed; waiting for merge labels Oct 20, 2026
@JonasFocus

Copy link
Copy Markdown
Owner Author

Conflicts with main after #86 and #100 merged (both touch Panel.tsx). Merge origin/main into this branch, resolve keeping both changes, push, and re-add the ready label once CI is green.

# Conflicts:
#	lib/texasholdem/index.ts
#	lib/texasholdem/winners.ts
# Conflicts:
#	components/texasholdem/TexasHoldem.tsx
#	components/texasholdem/texasholdem.css
#	lib/texasholdem/index.ts
@JonasFocus JonasFocus added the ready Green and self-reviewed; waiting for merge label Oct 20, 2026
@JonasFocus
JonasFocus merged commit bf86d68 into main Oct 20, 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.

Count up the winner's stack and bump the pot

1 participant