Skip to content

fix: Delete could remove the selection behind an open dialog - #337

Merged
pshenok merged 1 commit into
mainfrom
fix/delete-behind-dialog
Nov 4, 2026
Merged

pshenok merged 1 commit into
mainfrom
fix/delete-behind-dialog

Conversation

@pshenok

@pshenok pshenok commented Nov 4, 2026

Copy link
Copy Markdown
Owner

My own miss from #333, found in self-review. The Delete key only checked the main menu. With the Share, Help, Save or Trophies dialog open, pressing Delete or Backspace removed the selected nodes behind it, where the player couldn't see them go, and refunded only half their cost.

It now does nothing while any dialog is open: the check is any *-modal without .hidden. All nine dialogs hide that way.

Checked

The new tests failed before the fix, one per dialog, and pass after it.

In a real browser, with a real click and real key presses:

step services on the board
select a node, open Share, press Delete and Backspace 2, nothing removed
close the dialog, press Delete 1, the selected node is gone

After starting a game and skipping the tutorial, no dialog reads as open, so the check doesn't block Delete in normal play.

The Delete key from the multi-select change only checked the main menu.
With the Share, Help, Save or Trophies dialog open, pressing Delete or
Backspace removed the selected nodes behind it, where the player couldn't
see them go, and refunded only half their cost.

It now does nothing while any dialog is open.
@pshenok
pshenok merged commit 95b537b into main Nov 4, 2026
1 check passed
@pshenok
pshenok deleted the fix/delete-behind-dialog branch November 4, 2026 07:03
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