Skip to content

Win confirmation dialog: rollback, continue, or end game #13

@BySplashGm

Description

@BySplashGm

Description

When a player's throw reaches exactly 0 (winning throw), the game currently navigates straight to GameSummaryScreen. Instead, show a dialog giving the active player a chance to correct a mis-entry or, in multiplayer games, let the remaining players finish.

Dialog options

Option When shown Action
Rollback last throw Always Undo the winning dart, stay on the active game screen with the score restored
End game Always Confirm the win, persist the result, navigate to GameSummaryScreen
Continue Only when 3+ players are in the game Mark this player as finished, keep playing so remaining players can complete their game

With 2 players there is no meaningful "continue" — one wins, the other loses. The option is hidden.

Current behaviour (bug)

recordThrow() in lib/providers/game_provider.dart (~line 134) calls _db.updateGame() and sets isGameOver = true immediately on a winning throw with no user confirmation. The game is silently finalised even if the score was entered by mistake.

Acceptance criteria

  • Winning throw is detected before the game is persisted as finished
  • A non-dismissible dialog appears immediately after the winning throw is recorded in the DB
  • Rollback calls undoLastThrow(), closes the dialog, and restores the active game screen
  • End game finalises the game (sets winnerId, endDate) and navigates to GameSummaryScreen
  • Continue (3+ players only) marks the winner's score as 0, removes them from the active rotation, and passes the turn to the next remaining player
  • This dialog is always shown on a winning throw, regardless of whether the score confirmation setting (Settings screen (sound, haptics, default variant) #10) is enabled
  • The fix also covers the case where score confirmation is disabled (see Settings screen (sound, haptics, default variant) #10): even without the staging UX, the winning dart must pause for this dialog

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestui/uxUI and UX improvements

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions