🧹 refactor: Clear Chat Design Suppressions That Render Nothing (#16822)

* refactor: Clear Chat Design Suppressions That Render Nothing

* test: Tag the Steer Render Spec as a Scenario
This commit is contained in:
Marco Beretta 2026-10-06 20:23:17 +02:00 • committed by GitHub
parent e0344846f9
commit e954242778
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 20 additions and 38 deletions

View file

@ -225,7 +225,7 @@ export default function DataTable<TData, TValue>({ 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}

View file

@ -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',
)}

View file

@ -132,7 +132,6 @@ const FileAttachment = memo(({ attachment }: { attachment: Partial<TAttachment>
return (
<div
className={cn(
'file-attachment-container',
'transition-all duration-300 ease-out',
isVisible ? 'translate-y-0 opacity-100' : 'translate-y-2 opacity-0',
)}
@ -153,7 +152,6 @@ const FileAttachment = memo(({ attachment }: { attachment: Partial<TAttachment>
return (
<div
className={cn(
'file-attachment-container',
'transition-all duration-300 ease-out',
isVisible ? 'translate-y-0 opacity-100' : 'translate-y-2 opacity-0',
)}
@ -333,7 +331,7 @@ const TextAttachment = memo(
return (
<div
className={cn(
'text-attachment-container flex w-full flex-col gap-1.5',
'flex w-full flex-col gap-1.5',
'transition-all duration-300 ease-out',
isVisible ? 'translate-y-0 opacity-100' : 'translate-y-2 opacity-0',
)}
@ -415,7 +413,6 @@ const ImageAttachment = memo(({ attachment }: { attachment: TAttachment }) => {
return (
<div
className={cn(
'image-attachment-container',
'transition-all duration-500 ease-out',
isLoaded ? 'scale-100 opacity-100' : 'scale-[0.98] opacity-0',
)}

View file

@ -97,7 +97,7 @@ export const StreamingThoughtPeek = memo(({ text }: { text: string }) => {
/** 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(
<div className="overflow-hidden" ref={expandRef}>
{shouldRenderBody && (
<div className="border-border-light bg-surface-secondary text-text-secondary relative my-2 rounded-2xl border p-4">
<p className={cn('leading-[26px] whitespace-pre-wrap', fontSize)}>
{reasoningText}
</p>
<p className={cn('leading-6.5 whitespace-pre-wrap', fontSize)}>{reasoningText}</p>
<FloatingThinkingBar
isVisible={isBarVisible && isExpanded && !headerInViewport}
isExpanded={isExpanded}

View file

@ -116,7 +116,8 @@ const SteerPart = memo(function SteerPart({
return (
<div
id={steerId ? `steer-${steerId}` : undefined}
className="steer-render group relative my-5 flex w-full justify-end"
data-steer-render
className="group relative my-5 flex w-full justify-end"
data-testid="steer-part"
>
<div className="user-turn relative flex w-fit max-w-[90%] flex-col items-end sm:max-w-[85%]">

View file

@ -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', () => {

View file

@ -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<string, TMessage>
continue;
}
seen.add(id);
if (node.classList.contains(STEER_RENDER_CLASS)) {
if (node.hasAttribute(STEER_RENDER_ATTRIBUTE)) {
entries.push(buildSteerEntry(node, id));
continue;
}

View file

@ -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 });

View file

@ -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);

View file

@ -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
}
}
}
}