From 6582192741896cb150974acfc19b306df08da7c5 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 28 May 2025 14:50:45 +0200 Subject: [PATCH] Fix lag when interacting with `MarkdownElement` (#31585) Previously, we forgot to associate the `Markdown` entity to `MarkdownElement` during `prepaint`. This caused calls to `Context::notify` to not invalidate the view cache, which meant we would have to wait for some other invalidation before seeing the results of that initial notify. Release Notes: - Improved responsiveness of mouse interactions with the agent panel. Co-authored-by: Ben Brandt --- crates/markdown/src/markdown.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/markdown/src/markdown.rs b/crates/markdown/src/markdown.rs index a3a8e7c4564e8d5f440be4c6fe2b4fe98b48b124..7cc4e39924ec65253231bf7ff16c0068c3232438 100644 --- a/crates/markdown/src/markdown.rs +++ b/crates/markdown/src/markdown.rs @@ -1196,6 +1196,7 @@ impl Element for MarkdownElement { ) -> Self::PrepaintState { let focus_handle = self.markdown.read(cx).focus_handle.clone(); window.set_focus_handle(&focus_handle, cx); + window.set_view_id(self.markdown.entity_id()); let hitbox = window.insert_hitbox(bounds, false); rendered_markdown.element.prepaint(window, cx);