From 4a0025d7b5e5c6b8b9ac8e8cd4ad77248b7501b6 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 09:06:56 -0600 Subject: [PATCH] Fix text overlap with markdown code block in list in agent response (cherry-pick #30377) (#30390) Cherry-picked Fix text overlap with markdown code block in list in agent response (#30377) Seems that `h_full` was causing it to use the height of the overall list item for some reason. Closes #30002 Release Notes: - Agent Panel: Fixed text overlap for code blocks nested in lists in agent response. Co-authored-by: Michael Sloan --- crates/agent/src/active_thread.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rs index 56a28f6896243ff3632bd96943a8545be0c2d8e6..463e44e19edab0eedab265e9b476aa1ddbc5e6f1 100644 --- a/crates/agent/src/active_thread.rs +++ b/crates/agent/src/active_thread.rs @@ -600,14 +600,8 @@ fn render_markdown_code_block( .bg(cx.theme().colors().editor_background) .child(codeblock_header) .when( - metadata.line_count > MAX_UNCOLLAPSED_LINES_IN_CODE_BLOCK, - |this| { - if is_expanded { - this.h_full() - } else { - this.max_h_80() - } - }, + metadata.line_count > MAX_UNCOLLAPSED_LINES_IN_CODE_BLOCK && !is_expanded, + |this| this.max_h_80(), ) }