Multiple modals can stack — sync_setup, achievements, and leaderboard guard by plugin marker not ModalScrim #30

Closed
opened 2026-05-19 18:44:35 +00:00 by funman300 · 0 comments
Owner

Files

  • solitaire_engine/src/sync_setup_plugin.rs (~line 219 open_sync_setup_modal, ~line 549 open_delete_confirm_modal)
  • solitaire_engine/src/achievement_plugin.rs (toggle_achievements_screen)
  • solitaire_engine/src/leaderboard_plugin.rs (handle_set_display_name_button)

Description

CLAUDE.md §14.2 requires checking scrims.is_empty() before spawning any modal. Each of these openers guards only with its own plugin-specific marker (e.g. With<SyncSetupScreen>, With<AchievementsScreen>, With<DisplayNameModal>). Triggering two of these in rapid succession — or triggering any one while another modal is already open — produces concurrent ModalScrim entities and stacked overlays.

Fix

Add Query<(), With<ModalScrim>> to each opener and return early when !scrims.is_empty().

## Files - `solitaire_engine/src/sync_setup_plugin.rs` (~line 219 `open_sync_setup_modal`, ~line 549 `open_delete_confirm_modal`) - `solitaire_engine/src/achievement_plugin.rs` (`toggle_achievements_screen`) - `solitaire_engine/src/leaderboard_plugin.rs` (`handle_set_display_name_button`) ## Description CLAUDE.md §14.2 requires checking `scrims.is_empty()` before spawning any modal. Each of these openers guards only with its own plugin-specific marker (e.g. `With<SyncSetupScreen>`, `With<AchievementsScreen>`, `With<DisplayNameModal>`). Triggering two of these in rapid succession — or triggering any one while another modal is already open — produces concurrent `ModalScrim` entities and stacked overlays. ## Fix Add `Query<(), With<ModalScrim>>` to each opener and return early when `!scrims.is_empty()`.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#30