From 6dd6297414122e88a10936576512304ecf7a9d02 Mon Sep 17 00:00:00 2001 From: mesalogo Date: Thu, 17 Sep 2026 13:06:28 +0800 Subject: [PATCH] fix: prevent subagent progress content from being clipped Constrain nested subagent grids so long tool summaries cannot widen progress and final output beyond the card. Preserve text wrapping and local scrolling for code and tables, and extend the layout regression test. Release note: Subagent progress and results now stay within the card width, keeping long text and tool status controls readable. --- src/renderer/src/ChatTimeline.test.tsx | 11 ++++++++--- src/renderer/src/styles.css | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/ChatTimeline.test.tsx b/src/renderer/src/ChatTimeline.test.tsx index d789589c..1ea6001c 100644 --- a/src/renderer/src/ChatTimeline.test.tsx +++ b/src/renderer/src/ChatTimeline.test.tsx @@ -98,11 +98,16 @@ describe('ChatTimeline', () => { expect(Boolean(card.querySelector('.tool-execution__full-summary'))).toBe(hasSummary) }) - it('constrains tool grid columns so long summaries cannot clip controls', () => { + it('constrains tool and subagent grid columns so long content cannot clip text or controls', () => { for (const selector of ['.tool-execution-list', '.tool-execution-list > ol', - '.tool-execution__details', '.tool-execution__details section']) { - const rule = stylesheet.slice(stylesheet.indexOf(`${selector} {`)).split('}')[0] + '.tool-execution__details', '.tool-execution__details section', + '.subagent-status-list', '.subagent-status-card__details', + '.subagent-status-card__progress', '.subagent-status-card__details section']) { + const rule = stylesheet.slice(stylesheet.indexOf(`\n${selector} {`)).split('}')[0] expect(rule).toContain('grid-template-columns: minmax(0, 1fr)') + if (selector.startsWith('.subagent-')) { + expect(rule).toContain('min-width: 0') + } } }) diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.css index d138ddf0..cc50c8dc 100644 --- a/src/renderer/src/styles.css +++ b/src/renderer/src/styles.css @@ -6402,6 +6402,8 @@ button > svg { .subagent-status-list { display: grid; + grid-template-columns: minmax(0, 1fr); + min-width: 0; margin: var(--space-2) 0 var(--space-4); gap: var(--space-2); } @@ -6558,6 +6560,8 @@ button > svg { .subagent-status-card__details { display: grid; + grid-template-columns: minmax(0, 1fr); + min-width: 0; padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--border-subtle); background: var(--surface-subtle); @@ -6566,6 +6570,7 @@ button > svg { .subagent-status-card__progress { display: grid; + grid-template-columns: minmax(0, 1fr); min-width: 0; gap: var(--space-3); padding-left: var(--space-3); @@ -6574,6 +6579,8 @@ button > svg { .subagent-status-card__details section { display: grid; + grid-template-columns: minmax(0, 1fr); + min-width: 0; gap: var(--space-2); }