You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fixed markdown code blocks rendering with a fixed/tall height by removing the scrollbar wrapper that forced size_full.
5
+
- Added periodic re-measurement for visible assistant messages containing fenced code to pick up async markdown/highlight layout changes.
6
+
7
+
## Context
8
+
- After switching chat history to a virtual list with estimated sizes, code block heights stayed large even for 1-2 lines.
9
+
- The UI showed tall, empty code blocks and inconsistent height updates during streaming/async parsing.
10
+
11
+
## Root Cause
12
+
-`overflow_x_scrollbar()` wraps the code block in a Scrollable that uses a `size_full()` container, which forces the code block to match the parent height.
13
+
- Virtual list item sizing relied on cached estimates; async markdown/highlight updates could change real height without triggering re-measurement.
14
+
15
+
## Changes
16
+
-`crates/gpui-markdown/src/render.rs`
17
+
- Use `overflow_x_scroll()` instead of `overflow_x_scrollbar()` to avoid the size_full wrapper.
18
+
-`src/message_list.rs`
19
+
- Track last measured time per item.
20
+
- Re-measure visible assistant messages that contain fenced code blocks on a short interval to catch async layout changes.
21
+
22
+
## Result
23
+
- Code block height now matches content length instead of a fixed tall box.
24
+
- Virtual list item heights stay in sync when markdown/highlighting finishes.
25
+
26
+
## Follow-ups
27
+
- If a visible horizontal scrollbar is required, implement a custom scrollbar layer that does not enforce size_full.
28
+
- Consider tuning the re-measure interval if needed for performance.
0 commit comments