From cd405e66fbdda60836f1c2322f9bd07d2ac8df24 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 26 Sep 2026 21:46:37 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=90=20style:=20Set=20the=20Reasoning?= =?UTF-8?q?=20Header=20at=20the=20Shared=20Row=20Scale=20(#16391)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The standalone thinking disclosure and its non-interactive marker were the one activity row sized to the reader's body text (`fontSize`, 16px at the default), while tool calls, grouped thoughts and phase summaries all sit at `tool-status-text` (0.9× the markdown size, 14.4px). The same thought read at two sizes depending on which surface held it, and at larger settings the header outgrew the message heading beside it. Both headers now take `tool-status-text` and the medium weight every other row label carries. The thought body keeps the body size, as prose should. --- .../Chat/Messages/Content/Parts/Thinking.tsx | 20 +++----- .../Content/Parts/__tests__/Thinking.test.tsx | 51 +++++++++++++++++++ 2 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 client/src/components/Chat/Messages/Content/Parts/__tests__/Thinking.test.tsx 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" > { - const fontSize = useAtomValue(fontSizeAtom); return (
-
+
- {label} + {label}
); 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: () =>