Enable viewing other players' Yahtzee scoresheets#243
Enable viewing other players' Yahtzee scoresheets#243mohammad-aloufi wants to merge 10 commits intoXGDevGroup:mainfrom
Conversation
|
Review generated by Claude (Anthropic's coding assistant), posted at the repo owner's request. Thanks for this — being able to inspect any player's sheet is a nice quality-of-life win for Yahtzee. Claude tested the PR end-to-end (real A few things worth discussing. UX concernCommon case is now slower. Pressing
Worth picking one before merging. Picker also blocks all other keybinds while open. Pre-existing behavior — Code-quality issues1. def _handle_transient_display_selection(self, player, selection_id):
super()._handle_transient_display_selection(player, selection_id)
state = self._get_transient_display_state(player)
if not state:
return
if state.kind == "scoresheet_player_select":
...This works today only because the base implementation doesn't mutate state for unknown kinds. If anyone later adds a new kind to the base that does mutate state, the override will dispatch on the wrong state. The robust pattern is to check kind first, handle locally, and delegate to super for unknown kinds: state = self._get_transient_display_state(player)
if state and state.kind == "scoresheet_player_select":
self._close_transient_display(player)
target = self.get_player_by_id(selection_id)
if target:
self._show_player_scoresheet(player, target)
return
super()._handle_transient_display_selection(player, selection_id)2. Brittle blind cast ( 3. 4. 5. Trailing whitespace at lines 554 and 632. Smaller observations6. Spectators still can't view scoresheets. The TestingThe PR description describes manual testing only. Claude wrote 8 targeted tests in |
|
Done.
|
Summary
This PR enhances the UX in Yahtzee by allowing players to check the scoresheets of any active participant in the game. Previously, the
ckeybind would automatically jump into displaying the scoresheet of the player whose turn it currently is. This introduces a transient menu when pressingcgiving the flexibility to select and view the detailed scoresheet of any given active player.Changes Made
_action_view_scoresheetto display a transient menu (kind="scoresheet_player_select") populated with all active players in the game instead of instantly rendering a scoresheet._show_player_scoresheethelper method to build and render the target player's metrics._handle_transient_display_selectioninYahtzeeGame.Testing Notes
cat any point during active play and verify that the target player list is shown correctly.