From 957e4adc3f2c9373c6b4dccd28824c85c803e689 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 da9f3fee85..26df526c52 100644 --- a/crates/markdown/src/markdown.rs +++ b/crates/markdown/src/markdown.rs @@ -1209,6 +1209,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);