From e95424277875f24bd4429101fc32da4d79371ced Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Tue, 6 Oct 2026 20:23:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20refactor:=20Clear=20Chat=20Desig?= =?UTF-8?q?n=20Suppressions=20That=20Render=20Nothing=20(#16822)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: Clear Chat Design Suppressions That Render Nothing * test: Tag the Steer Render Spec as a Scenario --- .../Chat/Input/Files/Table/DataTable.tsx | 2 +- .../Messages/Content/ActivityPhaseGroup.tsx | 2 +- .../Messages/Content/Parts/Attachment.tsx | 5 +--- .../Chat/Messages/Content/Parts/Reasoning.tsx | 6 ++--- .../Chat/Messages/Content/Parts/SteerPart.tsx | 3 ++- .../Parts/__tests__/SteerPart.test.tsx | 2 +- .../components/Chat/Messages/MessageNav.tsx | 8 +++---- .../Messages/__tests__/MessageNav.spec.tsx | 5 ++-- e2e/specs/mock/steering.spec.ts | 2 +- eslint-suppressions.json | 23 ++++--------------- 10 files changed, 20 insertions(+), 38 deletions(-) diff --git a/client/src/components/Chat/Input/Files/Table/DataTable.tsx b/client/src/components/Chat/Input/Files/Table/DataTable.tsx index f8b33f483b..287064e96f 100644 --- a/client/src/components/Chat/Input/Files/Table/DataTable.tsx +++ b/client/src/components/Chat/Input/Files/Table/DataTable.tsx @@ -225,7 +225,7 @@ export default function DataTable({ columns, data }: DataTablePro key={cell.id} size="compact" className={cn( - 'align-start px-2 text-xs sm:px-4 sm:text-sm [tr[data-disabled=true]_&]:opacity-50', + 'px-2 text-xs sm:px-4 sm:text-sm [tr[data-disabled=true]_&]:opacity-50', cell.column.id === 'select' ? 'overflow-visible' : 'overflow-x-auto', )} style={style} diff --git a/client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsx b/client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsx index 0c904dd9de..29c11b7baf 100644 --- a/client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsx +++ b/client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsx @@ -192,7 +192,7 @@ const PhaseLabel = memo(function PhaseLabel({ key={`retired-${lines.retired}`} className={cn( 'absolute inset-x-0 top-0 block truncate', - 'animate-out fade-out-0 slide-out-to-top-5 fill-mode-forwards', + 'animate-out fade-out-0 slide-out-to-top-5 [animation-fill-mode:forwards]', FOLD_EASING, failed && 'text-text-warning', )} diff --git a/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx b/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx index 4b5b705f5c..4adfb893f6 100644 --- a/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx @@ -132,7 +132,6 @@ const FileAttachment = memo(({ attachment }: { attachment: Partial return (
return (
{ return (
{ /** Fixed-height window the text scrolls through. The one-line top pad * keeps the first streaming line below the top fade (a blank line * above it) instead of jammed against the faded edge. */ - 'text-text-primary h-[5.5rem] overflow-hidden pt-[26px] leading-[26px] break-words whitespace-pre-wrap', + 'text-text-primary h-[5.5rem] overflow-hidden pt-6.5 leading-6.5 break-words whitespace-pre-wrap', fontSize, )} style={{ maskImage: PEEK_FADE, WebkitMaskImage: PEEK_FADE }} @@ -426,9 +426,7 @@ export const ReasoningCompact = memo(
{shouldRenderBody && (
-

- {reasoningText} -

+

{reasoningText}

diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/SteerPart.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/SteerPart.test.tsx index ba0a530330..3b2f7ba18d 100644 --- a/client/src/components/Chat/Messages/Content/Parts/__tests__/SteerPart.test.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/SteerPart.test.tsx @@ -178,7 +178,7 @@ describe('SteerPart presentation', () => { renderPart(); const part = screen.getByTestId('steer-part'); expect(part).toHaveAttribute('id', 'steer-s1'); - expect(part).toHaveClass('steer-render'); + expect(part).toHaveAttribute('data-steer-render'); }); it('stays on the message content edge instead of outdenting', () => { diff --git a/client/src/components/Chat/Messages/MessageNav.tsx b/client/src/components/Chat/Messages/MessageNav.tsx index 7d6ca3c6a0..d4b78b89b7 100644 --- a/client/src/components/Chat/Messages/MessageNav.tsx +++ b/client/src/components/Chat/Messages/MessageNav.tsx @@ -80,10 +80,10 @@ export function buildEntry(id: string, msg: TMessage, node?: HTMLElement): Messa } const USER_TURN_SELECTOR = '.user-turn'; -const STEER_RENDER_CLASS = 'steer-render'; +const STEER_RENDER_ATTRIBUTE = 'data-steer-render'; /** One query, document order: steer nodes interleave at their in-thread * position INSIDE the response that absorbed them. */ -const ENTRY_NODE_SELECTOR = `.message-render, .${STEER_RENDER_CLASS}`; +const ENTRY_NODE_SELECTOR = `.message-render, [${STEER_RENDER_ATTRIBUTE}]`; /** Rail-relevant node: a message row or an in-thread steer part. The mutation * filter must match BOTH — a steer node swap (optimistic → persisted) or @@ -91,7 +91,7 @@ const ENTRY_NODE_SELECTOR = `.message-render, .${STEER_RENDER_CLASS}`; function isEntryNode(node: HTMLElement): boolean { return ( node.classList?.contains('message-render') === true || - node.classList?.contains(STEER_RENDER_CLASS) === true + node.hasAttribute?.(STEER_RENDER_ATTRIBUTE) === true ); } @@ -165,7 +165,7 @@ function getMessageEntries(root: ParentNode, messagesById: Map continue; } seen.add(id); - if (node.classList.contains(STEER_RENDER_CLASS)) { + if (node.hasAttribute(STEER_RENDER_ATTRIBUTE)) { entries.push(buildSteerEntry(node, id)); continue; } diff --git a/client/src/components/Chat/Messages/__tests__/MessageNav.spec.tsx b/client/src/components/Chat/Messages/__tests__/MessageNav.spec.tsx index 2c37bb2ef3..2d71a30e51 100644 --- a/client/src/components/Chat/Messages/__tests__/MessageNav.spec.tsx +++ b/client/src/components/Chat/Messages/__tests__/MessageNav.spec.tsx @@ -473,7 +473,8 @@ describe('MessageNav', () => { ): HTMLDivElement { const steer = document.createElement('div'); steer.id = `steer-${steerId}`; - steer.className = 'steer-render group relative'; + steer.className = 'group relative'; + steer.setAttribute('data-steer-render', ''); const header = document.createElement('h2'); header.textContent = 'Danny'; const body = document.createElement('div'); @@ -743,7 +744,7 @@ describe('MessageNav', () => { * two places short of the end while the reader sat at the very bottom. */ const steer = document.createElement('div'); steer.id = 'steer-s1'; - steer.className = 'steer-render'; + steer.setAttribute('data-steer-render', ''); steer.textContent = 'mid-run steer'; Object.defineProperty(steer, 'offsetTop', { value: 60, configurable: true }); Object.defineProperty(steer, 'offsetHeight', { value: 40, configurable: true }); diff --git a/e2e/specs/mock/steering.spec.ts b/e2e/specs/mock/steering.spec.ts index d15252055a..56419f5582 100644 --- a/e2e/specs/mock/steering.spec.ts +++ b/e2e/specs/mock/steering.spec.ts @@ -117,7 +117,7 @@ test.describe('mid-run steering and queuing', () => { * SURVIVES inside the response after run end, with no degradation to a * queued follow-up turn. */ - test('steers mid-run: anchored bubble appears immediately and applies at the next tool boundary', async ({ + test('steers mid-run: anchored bubble appears immediately and applies at the next tool boundary @scenario:steer-renders-in-thread', async ({ page, }) => { test.setTimeout(150000); diff --git a/eslint-suppressions.json b/eslint-suppressions.json index 0c430ac9be..98c2925607 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -228,10 +228,7 @@ }, "client/src/components/Chat/Input/Files/Table/DataTable.tsx": { "shadcn/no-restyle": { - "count": 14 - }, - "shadcn/no-unknown-classes": { - "count": 1 + "count": 13 } }, "client/src/components/Chat/Input/HeaderOptions.tsx": { @@ -360,13 +357,10 @@ }, "client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsx": { "shadcn/no-arbitrary-values": { - "count": 1 + "count": 2 }, "shadcn/no-inline-styles": { "count": 2 - }, - "shadcn/no-raw-colors": { - "count": 1 } }, "client/src/components/Chat/Messages/Content/AgentHandoff.tsx": { @@ -459,14 +453,8 @@ "shadcn/no-inline-styles": { "count": 9 }, - "shadcn/no-raw-colors": { - "count": 1 - }, "shadcn/no-restyle": { "count": 6 - }, - "shadcn/no-unknown-classes": { - "count": 3 } }, "client/src/components/Chat/Messages/Content/Parts/BashCall.tsx": { @@ -531,9 +519,6 @@ } }, "client/src/components/Chat/Messages/Content/Parts/Reasoning.tsx": { - "shadcn/no-arbitrary-values": { - "count": 3 - }, "shadcn/no-inline-styles": { "count": 4 }, @@ -551,7 +536,7 @@ }, "client/src/components/Chat/Messages/Content/Parts/SteerPart.tsx": { "shadcn/no-unknown-classes": { - "count": 2 + "count": 1 } }, "client/src/components/Chat/Messages/Content/Parts/Summary.tsx": { @@ -2183,4 +2168,4 @@ "count": 1 } } -} \ No newline at end of file +}