#459: [rework-1] Migrate context menu dispatch to ModalStack (platform-neutral) - #576
Merged
JDonaghy merged 1 commit intoJul 12, 2026
Merged
Conversation
…tral) Right-clicking a file in the explorer opens the context menu correctly (#451), but the four panel-specific mouse intercepts in mod.rs (debug sidebar, extensions sidebar, debug toolbar, explorer tree) still gated on the per-backend `engine.context_menu.is_none()` boolean (#456) to decide whether an open context menu should intercept a click before the panel underneath sees it. That's an ad hoc TUI-only mechanism — GTK gets the same priority for free via native z-ordering. This migrates the gate to `quadraui::ModalStack`, the same platform-neutral primitive already used for the editor hover popup (#216): - `mouse.rs`: reconcile the open context menu's bounds onto the modal stack at the top of `handle_mouse`, pushing/popping the `"context_menu"` widget id to match `context_menu_layout`. Matches the naming the GTK backend already uses for its own modal-stack entry (#546). - `mod.rs`: compute `ctx_blocks_event` once per event by hit-testing the modal stack against the event's position, and use `!ctx_blocks_event` in place of the four `engine.context_menu.is_none()` gates — geometric (does this click land inside a floating modal?) rather than boolean (is any menu open at all?). - `tests/context_menu.rs`: regression test pinning the ModalStack push/hit_test/pop contract the gate relies on. Note: empirical testing (tmux + synthetic SGR mouse sequences) surfaced a real timing gap — the modal-stack push only happens reactively inside `handle_mouse`, so the very first click after a context menu opens can still be swallowed by a panel intercept before the stack catches up (repro + analysis reported separately). Filing as a follow-up rather than expanding this mechanical migration's scope. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #459
Automated merge from the coordinator for assignment 73b88d3e3359 on issue #459.
Worker branch:
issue-459-migrate-context-menu-dispatch-to-modalst→develop.