Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

📐 style: Set the Reasoning Header at the Shared Row Scale (#16391)

Danny Avilacd405e66fbdd
diff --git a/client/src/components/Chat/Messages/Content/Parts/Thinking.tsx b/client/src/components/Chat/Messages/Content/Parts/Thinking.tsx
index 5b8bc23155..0c91612261 100644
--- a/client/src/components/Chat/Messages/Content/Parts/Thinking.tsx
+++ b/client/src/components/Chat/Messages/Content/Parts/Thinking.tsx
@@ -97,7 +97,6 @@ export const ThinkingButton = memo(
shimmerLabel?: boolean;
}) => {
const localize = useLocalize();
- const fontSize = useAtomValue(fontSizeAtom);
const [isCopied, setIsCopied] = useState(false);
@@ -116,10 +115,11 @@ export const ThinkingButton = memo(
onClick={onClick}
aria-expanded={isExpanded}
aria-controls={contentId}
- className={cn(
- 'group/button flex flex-1 items-center justify-start rounded-lg pr-10 leading-[18px]',
- fontSize,
- )}
+ /** `tool-status-text`, not the reader's body size: this header is a
+ * row in the same list as tool calls, grouped thoughts and phase
+ * summaries, all set at that scale. Sized to the body it read as a
+ * second, larger kind of row beside them. */
+ className="group/button tool-status-text flex flex-1 items-center justify-start rounded-lg pr-10"
>
<span className={cn(ROW_GLYPH_SLOT, 'relative mr-2')}>
<Lightbulb
@@ -156,7 +156,7 @@ export const ThinkingButton = memo(
<span
key={animateLabel ? label : undefined}
className={cn(
- 'min-w-0 truncate text-left',
+ 'min-w-0 truncate text-left font-medium',
shimmerLabel && !animateLabel && 'shimmer',
animateLabel &&
'duration-300 ease-out animate-in fade-in-0 slide-in-from-bottom-1 motion-reduce:animate-none',
@@ -195,17 +195,13 @@ export const ThinkingButton = memo(
* presentation identical across surfaces without offering an empty disclosure.
*/
export const ThinkingLabel = memo(({ label, title }: { label: string; title?: string }) => {
- const fontSize = useAtomValue(fontSizeAtom);
return (
<div className="mb-2 pb-2 pt-2">
- <div
- className={cn('flex w-full items-center justify-start leading-[18px]', fontSize)}
- title={title}
- >
+ <div className="tool-status-text flex w-full items-center justify-start" title={title}>
<span className={cn(ROW_GLYPH_SLOT, 'relative mr-2')}>
<Lightbulb className="icon-sm text-text-secondary" aria-hidden="true" />
</span>
- <span className="min-w-0 truncate text-left text-text-secondary">{label}</span>
+ <span className="min-w-0 truncate text-left font-medium text-text-secondary">{label}</span>
</div>
</div>
);
diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/Thinking.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/Thinking.test.tsx
new file mode 100644
index 0000000000..d06f277361
--- /dev/null
+++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/Thinking.test.tsx
@@ -0,0 +1,51 @@
+import React from 'react';
+import { render, screen } from '@testing-library/react';
+import { ThinkingButton, ThinkingLabel } from '../Thinking';
+
+jest.mock('~/hooks', () => ({
+ useLocalize: () => (key: string) => key,
+ useExpandCollapse: () => ({ style: {}, ref: { current: null } }),
+}));
+
+jest.mock('~/store/fontSize', () => ({
+ fontSizeAtom: { toString: () => 'fontSizeAtom' },
+}));
+
+jest.mock('jotai', () => ({
+ ...jest.requireActual('jotai'),
+ useAtomValue: () => 'text-xl',
+}));
+
+jest.mock('~/components/Messages/Content/CopyButton', () => ({
+ __esModule: true,
+ default: () => <button type="button" data-testid="copy-thoughts" />,
+}));
+
+/** Every activity row — a tool call, a grouped thought, a phase summary — is
+ * set at `tool-status-text`. A reasoning header sized to the reader's body
+ * text instead was the one row that grew with that setting, so the same
+ * thought read at two sizes depending on which surface held it. */
+describe('reasoning header rows', () => {
+ it('sets the thinking disclosure at the shared row scale, not the body size', () => {
+ render(
+ <ThinkingButton
+ isExpanded={false}
+ onClick={() => {}}
+ label="Reframing the analysis"
+ contentId="thoughts"
+ />,
+ );
+ const button = screen.getByRole('button', { name: 'Reframing the analysis' });
+ expect(button).toHaveClass('tool-status-text');
+ expect(button).not.toHaveClass('text-xl');
+ expect(screen.getByText('Reframing the analysis')).toHaveClass('font-medium');
+ });
+
+ it('sets the non-interactive marker the same way', () => {
+ render(<ThinkingLabel label="Thoughts" />);
+ const label = screen.getByText('Thoughts');
+ expect(label.parentElement).toHaveClass('tool-status-text');
+ expect(label.parentElement).not.toHaveClass('text-xl');
+ expect(label).toHaveClass('font-medium');
+ });
+});