🫳 fix: Let the Composer Column Shrink Below a Queued Row's Text (#15665)

A queued follow-up or failed steer row longer than the composer widened
the whole composer column to the text's own length instead of truncating:
the row's controls left the viewport, the composer ran under the side
panel, and the chat pane grew a horizontal scrollbar.

The row's text is `nowrap` with `min-w-0 flex-1 truncate`, but nothing
caps its width, so its min-content width propagates up through the chips
column and the composer surface to the form's `flex-1` child. That child
is a flex item with `min-width: auto`, so its automatic minimum becomes
the text's width and the form cannot shrink it. The quote and skill chips
beside it never trigger this only because each carries a fixed `max-w-`.

`min-w-0` on that column wrapper lets it shrink to the form again;
everything below it is already `w-full` or `overflow-hidden`, so the text
truncates where it was meant to. The queue e2e test now queues a paragraph
wider than the composer and asserts the row ends inside the form with its
remove button fully in the viewport; it fails on the previous build by
2119px and passes on this one.
This commit is contained in:
Danny Avila 2026-09-06 15:32:01 -04:00 • committed by GitHub
parent ebf70826b5
commit deb3dad265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 2 deletions

View file

@ -550,7 +550,7 @@ const ChatForm = memo(function ChatForm({
: 'sm:mb-10',
)}
>
<div className="relative flex h-full flex-1 items-stretch md:flex-col">
<div className="relative flex h-full min-w-0 flex-1 items-stretch md:flex-col">
{/* Primary composer owns the selection popup so split-view doesn't double it. */}
{index === 0 && quotesEnabled && <QuoteButton conversationId={conversationId} />}
{/* `relative` anchors the in-flight steer overlay, which floats above

View file

@ -21,6 +21,11 @@ const MCP_SERVER_TITLE = 'E2E Memory';
/** Last chunk streamed by the fake model's slow replies (160 chunks, 0-indexed). */
const SLOW_REPLY_LAST_CHUNK = 'chunk-159';
const SLOW_REPLY_CONTINUATION_TEXT = 'E2E slow reply continued';
/** A pasted paragraph wider than the composer at any desktop viewport. */
const LONG_PASTE = Array.from(
{ length: 6 },
(_, index) => `pasted line ${index + 1}: a follow-up long enough to overflow the composer`,
).join(' ');
const uniqueLabel = (prefix: string) =>
`${prefix}-${Date.now()}-${Math.floor(Math.random() * 1e4)}`;
@ -508,7 +513,9 @@ test.describe('mid-run steering and queuing', () => {
}) => {
test.setTimeout(120000);
const label = uniqueLabel('queue');
const queueText = `Queued follow-up ${label}`;
/** Wider than the composer at every desktop width: the row must truncate
* the text rather than widen the composer column to fit it. */
const queueText = `Queued follow-up ${label} ${LONG_PASTE}`;
await page.goto(NEW_CHAT_PATH, { timeout: 10000 });
await selectMockEndpoint(page, MOCK_ENDPOINTS[0]);
@ -525,6 +532,20 @@ test.describe('mid-run steering and queuing', () => {
// Queued means NOT injected into the live thread.
await expect(inFlightSteers(page)).toHaveCount(0);
// The queued text's natural width must not leak into the composer's size:
// the row ends where the form ends and its controls stay on screen.
const overflow = await row.evaluate((element) => {
const form = element.closest('form');
if (form == null) {
return Number.POSITIVE_INFINITY;
}
return element.getBoundingClientRect().right - form.getBoundingClientRect().right;
});
expect(overflow).toBeLessThanOrEqual(0);
await expect(row.getByRole('button', { name: 'Remove message' })).toBeInViewport({
ratio: 1,
});
// Clean completion drains exactly one queued message as a new user turn.
await expect(row).toHaveCount(0, { timeout: 60000 });
await expect(messageTurns(page)).toHaveCount(6, { timeout: 30000 });