Skip to content

fix(golf): restore missing Knock button during play phase#199

Merged
aaylward merged 1 commit into
mainfrom
fix/golf-knock-button
Mar 10, 2026
Merged

fix(golf): restore missing Knock button during play phase#199
aaylward merged 1 commit into
mainfrom
fix/golf-knock-button

Conversation

@aaylward

Copy link
Copy Markdown
Contributor

Summary

The Knock button — the only way to end a Golf game — was never visible during play. The render condition depended on allPlayersPeeked, which the backend resets to false when transitioning from the peeking phase to playing. Since gamePhase === 'playing' already guarantees peeking is complete, the redundant flag check is removed.

What Changed

  • Removed gameState.allPlayersPeeked from the Knock button render condition in GolfGame.tsx

Testing Done

  • TypeScript typecheck — clean
  • All 214 unit tests passing
  • Traced the bug through frontend and backend code to confirm root cause
flowchart LR
    A[All players peek] -->|backend| B["allPlayersPeeked = true\ngamePhase = peeking"]
    B -->|countdown ends| C["allPlayersPeeked = false\ngamePhase = playing"]
    C -->|"before fix"| D["❌ Knock button hidden\n(allPlayersPeeked is false)"]
    C -->|"after fix"| E["✅ Knock button visible\n(only checks gamePhase)"]

    style D fill:#d9534f,color:#fff
    style E fill:#5cb85c,color:#fff
Loading

🤖 Generated with Claude Code

The Knock button was gated on `gameState.allPlayersPeeked`, which the
backend resets to false when transitioning from peeking to playing.
This made the button permanently hidden. The `gamePhase === 'playing'`
check already guarantees peeking is complete, so the redundant flag
is removed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aaylward aaylward enabled auto-merge (squash) March 10, 2026 20:30
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
muchq c2f5f5c Commit Preview URL

Branch Preview URL
Mar 10 2026, 08:31 PM

@aaylward aaylward merged commit 63b08f0 into main Mar 10, 2026
2 checks passed
@aaylward aaylward deleted the fix/golf-knock-button branch March 10, 2026 20:32
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.

1 participant