Handle empty hand slots properly #2

Merged
max merged 1 commit from timotree/deck-website:null-cards into main 2025-08-14 22:01:13 +02:00
Collaborator

Empty slots in the hand are now represented by a null card. I carefully checked every use of state.hand to make sure this is accounted for properly.

Fixes bugs where:

  • Styles are not removed when a card becomes an empty slot.
  • Importing a game crashes when it contains an action on a slot to the right of an empty slot.
  • Updating the DOM crashes when a player clues and the next player's leftmost slot is empty.
    • In order to fix this, I changed the default rank clue to be the highest rank, rather than the rank of their leftmost slot.
Empty slots in the hand are now represented by a `null` card. I carefully checked every use of `state.hand` to make sure this is accounted for properly. Fixes bugs where: - Styles are not removed when a card becomes an empty slot. - Importing a game crashes when it contains an action on a slot to the right of an empty slot. - Updating the DOM crashes when a player clues and the next player's leftmost slot is empty. - In order to fix this, I changed the default rank clue to be the highest rank, rather than the rank of their leftmost slot.
Empty slots in the hand are now represented by a `null` card.
I carefully checked every use of `state.hand` to make sure this is accounted for properly.
Fixes bugs where:
- Styles are not removed when a card becomes an empty slot.
- Importing a game crashes when it contains an action on a slot to the right of an empty slot.
- Updating the DOM crashes when a player clues and the next player's leftmost slot is empty.
  - In order to fix this, I changed the default rank clue to be the highest rank,
    rather than the rank of their leftmost slot.
max approved these changes 2025-08-14 22:00:58 +02:00
Owner

thanks

thanks
max merged commit d4ec19168b into main 2025-08-14 22:01:13 +02:00
Sign in to join this conversation.
No reviewers
max
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Hanabi/deck-website!2
No description provided.