From 4deb8cce8df72b4f9dcb86342f939402c67147e1 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Mon, 12 May 2025 11:17:37 +0200 Subject: [PATCH] agent: Fix 10 line code blocks being expandable despite fitting (#30540) Release Notes: - N/A --- crates/agent/src/active_thread.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rs index 4cec6429814dbf62d6cb86795263b249d3ce0543..c3674ffc919a881067b3e029976b246e46eca847 100644 --- a/crates/agent/src/active_thread.rs +++ b/crates/agent/src/active_thread.rs @@ -487,7 +487,7 @@ fn render_markdown_code_block( .copied_code_block_ids .contains(&(message_id, ix)); - let can_expand = metadata.line_count > MAX_UNCOLLAPSED_LINES_IN_CODE_BLOCK; + let can_expand = metadata.line_count >= MAX_UNCOLLAPSED_LINES_IN_CODE_BLOCK; let is_expanded = if can_expand { active_thread.read(cx).is_codeblock_expanded(message_id, ix) @@ -2347,7 +2347,7 @@ impl ActiveThread { move |el, range, metadata, _, cx| { let can_expand = metadata.line_count - > MAX_UNCOLLAPSED_LINES_IN_CODE_BLOCK; + >= MAX_UNCOLLAPSED_LINES_IN_CODE_BLOCK; if !can_expand { return el; }