#454: [rework-1] Wire toast rendering + click dispatch in GTK backend - #573
Merged
JDonaghy merged 1 commit intoJul 11, 2026
Merged
Conversation
Mirrors the TUI toast wiring from #450: render `engine.toasts` via `render::build_toast_stack` and dispatch clicks (dismiss ×, actions) through `engine.handle_toast_hit` before any other click handler, so a toast dismiss doesn't leak through to the editor underneath. The original May-30 branch for this issue targeted `draw.rs::draw_editor`, which was the live GTK paint path at the time. Since then the #540 Relm4→ShellApp migration made that function dead code (it has zero callers and is `#[allow(dead_code)]` at the module level — see the `#546` comment already in `render_content` documenting the same trap for dialogs/context-menus). This wires the toast overlay into `render_content` (the actual live `ShellApp::render_content` path) instead: drawn last via `Backend::draw_toast_stack`, anchored to the full window viewport like TUI's `frame.area()`, with the returned `ToastStackLayout` cached on `engine.toast_layout` for hit-testing. `handle_mouse_click_msg` gets the toast hit-test dispatch, same as TUI's mouse.rs: hit_test → handle_toast_hit before scroll-surface/ other click handling, so a consumed click returns early. Also fixes a pre-existing `clippy::collapsible_else_if` on `Msg::WindowMaximize` (unrelated to toasts, but in the same file and required for the mandatory `cargo clippy -- -D warnings` gate to pass against current develop). Verified empirically under Xvfb + xdotool: `:Toast <text>` renders the toast bottom-right, and clicking its × dismisses it without falling through to the explorer/editor underneath. Co-Authored-By: Claude Sonnet 5 <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 #454
Automated merge from the coordinator for assignment af6455d1683c on issue #454.
Worker branch:
issue-454-wire-toast-rendering-click-dispatch-in-g→develop.