From e3eb649178b8fb97d0f762cd51564ecb379214f2 Mon Sep 17 00:00:00 2001 From: David Mann Date: Mon, 30 Nov 2026 12:57:07 +0100 Subject: [PATCH] Canvas: a press that activates another tile reruns the pass, as in #18273 The new craft-libs pin draws the tiles before the press activates the other document, so the contextual task bar stayed on the old tile for a frame. The same change as in the craft-libs pin PR #18273, so the two merge cleanly. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/canvas/document_area.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/ui-egui/src/canvas/document_area.rs b/crates/ui-egui/src/canvas/document_area.rs index 95bd4f4264..64d7572b28 100644 --- a/crates/ui-egui/src/canvas/document_area.rs +++ b/crates/ui-egui/src/canvas/document_area.rs @@ -311,6 +311,11 @@ fn arranged(app: &mut PhotocraftApp, ui: &mut egui::Ui, rect: Rect, active: usiz } } if let Some(d) = selected { + // The tiles drew before the press activated another one: run the pass again, so this frame already shows the + // contextual task bar on the new active tile and not on the tile that was active. + if d != active { + ui.ctx().request_discard("a pressed tile became the active document"); + } app.session.set_active(d); } // A clean document can leave the session immediately, so close only after the pane indices were used.