From 758cb8e4915c305b44b88d4235bdb6c497cd492a 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 c0d42bf5a2fafeed2e3b308118e9edca4e5d4684..623b8efefced45a42c3e0f1db2aefb7c41d601b4 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 @@ -2356,7 +2356,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; }