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: Put the Grouped Thought on the Row Rail (#15674)

Marco Berettadcf417efecd8
diff --git a/client/src/components/Chat/Messages/Content/Parts/Reasoning.tsx b/client/src/components/Chat/Messages/Content/Parts/Reasoning.tsx
index 01bff0c253..41162fe41a 100644
--- a/client/src/components/Chat/Messages/Content/Parts/Reasoning.tsx
+++ b/client/src/components/Chat/Messages/Content/Parts/Reasoning.tsx
@@ -18,6 +18,7 @@ import CopyButton from '~/components/Messages/Content/CopyButton';
import { showThinkingAtom } from '~/store/showThinking';
import { fontSizeAtom } from '~/store/fontSize';
import { useMessageContext } from '~/Providers';
+import { ROW_GLYPH_SLOT } from '../rows';
import { cn } from '~/utils';
const stripThinkTags = (reasoning: string): string =>
@@ -365,7 +366,9 @@ export const ReasoningCompact = memo(
aria-controls={contentId}
className="group/disclosure h-auto min-w-0 flex-1 justify-start gap-2 rounded-none p-0 font-normal text-text-secondary hover:bg-transparent"
>
- <Lightbulb className="size-4 shrink-0 text-text-secondary" aria-hidden="true" />
+ <span className={ROW_GLYPH_SLOT} aria-hidden="true">
+ <Lightbulb className="size-4 shrink-0 text-text-secondary" />
+ </span>
<span className="tool-status-text font-medium">{label}</span>
<ChevronDown
className={cn(
diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/ReasoningCompact.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/ReasoningCompact.test.tsx
index 2a9f2e9cb7..ee6228759b 100644
--- a/client/src/components/Chat/Messages/Content/Parts/__tests__/ReasoningCompact.test.tsx
+++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/ReasoningCompact.test.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { ReasoningCompact } from '../Reasoning';
+import { ROW_GLYPH_SLOT } from '../../rows';
jest.mock('~/hooks', () => ({
useLocalize: () => (key: string) => key,
@@ -54,6 +55,22 @@ describe('ReasoningCompact', () => {
expect(chevron.className).not.toContain('transition-opacity');
});
+ it('takes the shared glyph slot so it lands on the row rail', () => {
+ /** Every other row under a message header centers its glyph in the 24px
+ * slot, including the `ThinkingLabel` marker that stands in for this
+ * exact row when a projection has no text. Bare, the bulb sat on the
+ * pre-rail axis and the label 8px left of its neighbours. */
+ render(<ReasoningCompact reasoning="A useful thought" label="Thoughts" showThinking={false} />);
+
+ const slot = screen.getByTestId('thoughts-icon').parentElement;
+ for (const token of ROW_GLYPH_SLOT.split(' ')) {
+ expect(slot).toHaveClass(token);
+ }
+ /** 24px slot plus the row's 8px gap is what puts the label where the
+ * header's name starts. */
+ expect(screen.getByRole('button', { name: 'Thoughts' })).toHaveClass('gap-2');
+ });
+
it('removes the extra top margin when Thoughts follows a tool', () => {
render(
<ReasoningCompact