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

refactor: Remove Visible Composer Hint Row And Tips Setting

Marco Berettaf87fb0dbc61a
diff --git a/client/src/components/Chat/ChatView.tsx b/client/src/components/Chat/ChatView.tsx
index aef8fd047f..3ab4180407 100644
--- a/client/src/components/Chat/ChatView.tsx
+++ b/client/src/components/Chat/ChatView.tsx
@@ -30,7 +30,6 @@ import ConversationStarters from './Input/ConversationStarters';
import { pendingApprovalActionFamily } from './approval/state';
import ProjectBadge from '~/components/Projects/ProjectBadge';
import { composerLiftFamily } from './Input/Composer/state';
-import { showComposerTipsAtom } from '~/store/composerTips';
import { OwnerTextProvider } from './Messages/PrivateText';
import { useGetMessagesByConvoId } from '~/data-provider';
import Footer, { useConfiguredFooter } from './Footer';
@@ -69,7 +68,6 @@ function ChatView({
const rootSubmission = useRecoilValue(store.submissionByIndex(index));
const isSubmitting = useRecoilValue(store.isSubmittingFamily(index));
const saveDrafts = useRecoilValue(store.saveDrafts);
- const showComposerTips = useAtomValue(showComposerTipsAtom);
const enterToSend = useRecoilValue(store.enterToSend);
const autoSendText = useRecoilValue(store.autoSendText);
const speechSettingsInitialized = useRecoilValue(store.speechSettingsInitialized);
@@ -264,7 +262,6 @@ function ChatView({
placeholder={chatFormPlaceholder}
project={isProjectLandingPage ? project : undefined}
isLandingPage={isLandingPage}
- showComposerTips={showComposerTips}
enterToSend={enterToSend}
autoSendText={autoSendText}
speechSettingsInitialized={speechSettingsInitialized}
diff --git a/client/src/components/Chat/Input/ChatForm.tsx b/client/src/components/Chat/Input/ChatForm.tsx
index be905123e0..2f4c310fcf 100644
--- a/client/src/components/Chat/Input/ChatForm.tsx
+++ b/client/src/components/Chat/Input/ChatForm.tsx
@@ -110,8 +110,6 @@ interface ChatFormProps {
/** Owned by ChatView: which layout the composer sits in — the welcome screen
* floats or bottoms it out, a conversation ends the page with it. */
isLandingPage: boolean;
- /** Owned by the host: the persisted preference for showing keyboard hints. */
- showComposerTips: boolean;
/** Owned by the host: the persisted preference for whether Enter sends the
* message (vs. queues a newline). The composer only consumes it. */
enterToSend: boolean;
@@ -163,7 +161,6 @@ const ChatForm = memo(function ChatForm({
placeholder,
project,
isLandingPage,
- showComposerTips,
enterToSend,
autoSendText,
speechSettingsInitialized,
@@ -1016,7 +1013,6 @@ const ChatForm = memo(function ChatForm({
<Hints
index={index}
enterToSend={enterToSend}
- showTips={showComposerTips}
hasText={(textValue?.trim() ?? '') !== ''}
isSubmitting={isSubmitting}
duringRunActive={steering.duringRunActive}
@@ -1047,7 +1043,6 @@ function ChatFormWrapper({
placeholder,
project,
isLandingPage,
- showComposerTips,
/** Defaults to the atom's own default (`atomWithLocalStorage('enterToSend',
* true)`) so call sites that predate this prop, mainly tests, keep their
* prior behavior without passing it explicitly. */
@@ -1062,7 +1057,6 @@ function ChatFormWrapper({
index?: number;
placeholder?: string;
project?: TChatProject;
- showComposerTips: boolean;
enterToSend?: boolean;
autoSendText?: number;
speechSettingsInitialized?: boolean;
@@ -1142,7 +1136,6 @@ function ChatFormWrapper({
return (
<ChatForm
index={index}
- showComposerTips={showComposerTips}
enterToSend={enterToSend}
autoSendText={autoSendText}
speechSettingsInitialized={speechSettingsInitialized}
diff --git a/client/src/components/Chat/Input/Composer/Hints.tsx b/client/src/components/Chat/Input/Composer/Hints.tsx
index e52a16c454..45fd4cef42 100644
--- a/client/src/components/Chat/Input/Composer/Hints.tsx
+++ b/client/src/components/Chat/Input/Composer/Hints.tsx
@@ -7,52 +7,20 @@ import useComposerHint from '~/hooks/Input/useComposerHint';
export const composerHintId = (index: number) => `composer-hint-${index}`;
/**
- * The dim line under the composer carrying whatever the current state affords:
- * most importantly the during-run modifiers (`⌘⏎` queue, `⌥⏎` interrupt & send),
- * which had no on-screen presence at all before.
- *
- * Ambient tips are opt-in and off by default: they are discovery copy, and the
- * row they sit on costs the thread height on every turn. A paused question and
- * the during-run modifiers report themselves either way. Upload progress is
- * already visible on the file chips, so uploads update the accessible description
- * and any existing hint row without mounting another row that moves the textarea.
- *
- * The visible line is `aria-hidden`; the current hint or upload status lives in a
- * visually-hidden node that the textarea points at via `aria-describedby`, which
- * is why hiding the line costs a screen reader nothing. An `aria-live` region
- * here would re-announce on every keystroke as the hint flips between idle and
- * typing, so the description channel carries it instead.
+ * The composer's accessible description: whatever the current state affords
+ * (during-run modifiers, upload progress, a paused question). It is visually
+ * hidden and the textarea points at it via `aria-describedby`; no visible row is
+ * rendered under the composer. An `aria-live` region here would re-announce on
+ * every keystroke as the hint flips between idle and typing, so the description
+ * channel carries it instead.
*/
-function Hints({
- index,
- enterToSend,
- showTips,
- ...state
-}: ComposerHintState & { index: number; showTips: boolean }) {
+function Hints({ index, enterToSend, ...state }: ComposerHintState & { index: number }) {
const hint = useComposerHint({ ...state, enterToSend });
- const visible =
- showTips ||
- (hint.kind === 'state' &&
- (state.uploadingCount === 0 ||
- state.answerModeActive ||
- state.isSubmitting ||
- (state.duringRunActive && state.hasText)));
return (
- <>
- {visible && (
- <div
- aria-hidden="true"
- data-testid="composer-hints"
- className="text-text-secondary pointer-events-none px-3 pt-1.5 text-center text-xs leading-4 select-none"
- >
- {hint.text}
- </div>
- )}
- <span id={composerHintId(index)} className="sr-only">
- {hint.text}
- </span>
- </>
+ <span id={composerHintId(index)} className="sr-only">
+ {hint.text}
+ </span>
);
}
diff --git a/client/src/components/Chat/Input/Composer/__tests__/Hints.spec.tsx b/client/src/components/Chat/Input/Composer/__tests__/Hints.spec.tsx
index 2847c46d99..36441bf255 100644
--- a/client/src/components/Chat/Input/Composer/__tests__/Hints.spec.tsx
+++ b/client/src/components/Chat/Input/Composer/__tests__/Hints.spec.tsx
@@ -25,25 +25,34 @@ const baseState: ComposerHintState = {
idleActions: { prompts: true, mentions: true, attach: true },
};
-function hints(state: Partial<ComposerHintState> = {}, showTips = false, index = 0) {
- return <Hints {...baseState} {...state} showTips={showTips} index={index} />;
+function hints(state: Partial<ComposerHintState> = {}, index = 0) {
+ return <Hints {...baseState} {...state} index={index} />;
}
const description = (index = 0) => document.getElementById(composerHintId(index));
-describe('composer upload hints', () => {
+describe('composer hints', () => {
+ it.each([
+ {},
+ { hasText: false },
+ { isSubmitting: true, duringRunActive: true },
+ { answerModeActive: true },
+ ])('never renders a visible hint row (%j)', (state) => {
+ render(hints(state));
+ expect(screen.queryByTestId('composer-hints')).not.toBeInTheDocument();
+ expect(description()).toHaveClass('sr-only');
+ });
+
it.each([{ hasText: false }, { hasText: true }, { hasText: false, duringRunActive: true }])(
- 'keeps uploads out of the visible hint row through progress, completion and cancellation (%j)',
+ 'keeps upload progress in the accessible description (%j)',
(state) => {
const { rerender } = render(hints(state));
const idleDescription = description()?.textContent;
- for (const uploadingCount of [1, 2, 1, 0, 1, 0]) {
+ for (const uploadingCount of [1, 2, 1, 0]) {
rerender(hints({ ...state, uploadingCount }));
- expect(screen.queryByTestId('composer-hints')).not.toBeInTheDocument();
if (uploadingCount > 0) {
expect(description()).toHaveTextContent(/Uploading/);
- expect(description()).toHaveClass('sr-only');
} else {
expect(description()?.textContent).toBe(idleDescription);
}
@@ -51,28 +60,6 @@ describe('composer upload hints', () => {
},
);
- it.each([
- ['enabled tips', {}, true],
- ['an active run', { isSubmitting: true, duringRunActive: true }, false],
- ] as const)('preserves %s while an upload starts and finishes', (_name, state, showTips) => {
- const { rerender } = render(hints(state, showTips));
- const visibleHint = screen.getByTestId('composer-hints');
- const text = visibleHint.textContent;
-
- for (const uploadingCount of [1, 2, 0]) {
- rerender(hints({ ...state, uploadingCount }, showTips));
- expect(screen.getByTestId('composer-hints')).toBe(visibleHint);
- expect(visibleHint).toHaveAttribute('aria-hidden', 'true');
- if (uploadingCount > 0) {
- expect(visibleHint).toHaveTextContent(/Uploading/);
- expect(description()).toHaveTextContent(/Uploading/);
- } else {
- expect(visibleHint.textContent).toBe(text);
- expect(description()?.textContent).toBe(text);
- }
- }
- });
-
it('keeps answer mode ahead of upload status', () => {
const { rerender } = render(hints({ answerModeActive: true }));
const answer = description()?.textContent;
@@ -80,20 +67,18 @@ describe('composer upload hints', () => {
rerender(hints({ answerModeActive: true, uploadingCount: 1 }));
expect(description()?.textContent).toBe(answer);
- expect(screen.getByTestId('composer-hints').textContent).toBe(answer);
expect(description()).not.toHaveTextContent(/Uploading/);
});
it('keeps the accessible upload descriptions scoped to each pane', () => {
render(
<>
- {hints({ uploadingCount: 1 }, false, 0)}
- {hints({ uploadingCount: 2 }, false, 1)}
+ {hints({ uploadingCount: 1 }, 0)}
+ {hints({ uploadingCount: 2 }, 1)}
</>,
);
expect(description(0)).toHaveTextContent('Uploading 1 file');
expect(description(1)).toHaveTextContent('Uploading 2 files');
- expect(screen.queryByTestId('composer-hints')).not.toBeInTheDocument();
});
});
diff --git a/client/src/components/Chat/Input/__tests__/ChatForm.approvalMode.spec.tsx b/client/src/components/Chat/Input/__tests__/ChatForm.approvalMode.spec.tsx
index 76295c54a0..b0d2ba31e9 100644
--- a/client/src/components/Chat/Input/__tests__/ChatForm.approvalMode.spec.tsx
+++ b/client/src/components/Chat/Input/__tests__/ChatForm.approvalMode.spec.tsx
@@ -75,13 +75,7 @@ function Harness() {
return (
<ChatFormProvider {...methods}>
<ChatContext.Provider value={chatHelpers}>
- <ChatForm
- index={0}
- isLandingPage={false}
- showComposerTips={false}
- footerBelow={false}
- centerFormOnLanding={false}
- />
+ <ChatForm index={0} isLandingPage={false} footerBelow={false} centerFormOnLanding={false} />
</ChatContext.Provider>
</ChatFormProvider>
);
diff --git a/client/src/components/Chat/Input/__tests__/ChatForm.attachments.spec.tsx b/client/src/components/Chat/Input/__tests__/ChatForm.attachments.spec.tsx
index 21c9079f1b..f3a0623507 100644
--- a/client/src/components/Chat/Input/__tests__/ChatForm.attachments.spec.tsx
+++ b/client/src/components/Chat/Input/__tests__/ChatForm.attachments.spec.tsx
@@ -142,7 +142,6 @@ function Harness() {
<ChatForm
index={0}
isLandingPage={false}
- showComposerTips={false}
speechSettingsInitialized={speechSettingsInitialized}
footerBelow={false}
centerFormOnLanding={false}
diff --git a/client/src/components/Chat/Input/__tests__/ChatForm.enterToSend.spec.tsx b/client/src/components/Chat/Input/__tests__/ChatForm.enterToSend.spec.tsx
index e4cd6841b9..14eeae5dbf 100644
--- a/client/src/components/Chat/Input/__tests__/ChatForm.enterToSend.spec.tsx
+++ b/client/src/components/Chat/Input/__tests__/ChatForm.enterToSend.spec.tsx
@@ -75,7 +75,6 @@ function Harness({ enterToSend }: { enterToSend: boolean }) {
<ChatForm
index={0}
isLandingPage={false}
- showComposerTips
enterToSend={enterToSend}
footerBelow={false}
centerFormOnLanding={false}
@@ -118,7 +117,7 @@ describe('ChatForm enterToSend prop', () => {
const textarea = await screen.findByTestId('text-input');
await userEvent.type(textarea, 'hi');
- const hint = await screen.findByTestId('composer-hints');
+ const hint = document.getElementById('composer-hint-0') as HTMLElement;
expect(hint).toHaveTextContent('to send');
expect(hint).toHaveTextContent('for newline');
expect(hint).not.toHaveTextContent('Enter to send');
@@ -130,7 +129,7 @@ describe('ChatForm enterToSend prop', () => {
const textarea = await screen.findByTestId('text-input');
await userEvent.type(textarea, 'hi');
- const hint = await screen.findByTestId('composer-hints');
+ const hint = document.getElementById('composer-hint-0') as HTMLElement;
expect(hint).toHaveTextContent('Enter to send');
}, 20000);
});
diff --git a/client/src/components/Chat/Input/__tests__/ChatForm.pasteUpload.spec.tsx b/client/src/components/Chat/Input/__tests__/ChatForm.pasteUpload.spec.tsx
index 94a93470b1..d29222cbda 100644
--- a/client/src/components/Chat/Input/__tests__/ChatForm.pasteUpload.spec.tsx
+++ b/client/src/components/Chat/Input/__tests__/ChatForm.pasteUpload.spec.tsx
@@ -111,7 +111,6 @@ function Harness() {
<ChatForm
index={0}
isLandingPage={false}
- showComposerTips={false}
footerBelow={false}
centerFormOnLanding={false}
/>
diff --git a/client/src/components/Nav/Settings/registry.tsx b/client/src/components/Nav/Settings/registry.tsx
index c7ee1271ae..fe27c36578 100644
--- a/client/src/components/Nav/Settings/registry.tsx
+++ b/client/src/components/Nav/Settings/registry.tsx
@@ -49,7 +49,6 @@ import { RevokeKeys } from '../SettingsTabs/Data/RevokeKeys';
import { ClearChats } from '../SettingsTabs/Data/ClearChats';
import { TokenCredits, AutoRefill } from './BillingControls';
import AdminPanel from '../SettingsTabs/General/AdminPanel';
-import { showComposerTipsAtom } from '~/store/composerTips';
import SharedLinks from '../SettingsTabs/Data/SharedLinks';
import ImageResize from '../SettingsTabs/Chat/ImageResize';
import Passkeys from '../SettingsTabs/Account/Passkeys';
@@ -147,17 +146,6 @@ export const registry: SettingEntry[] = [
switchId: 'centerFormOnLanding',
}),
},
- {
- id: 'showComposerTips',
- tab: GENERAL,
- section: 'layout',
- labelKey: 'com_nav_composer_tips',
- Component: toggleControl({
- stateAtom: showComposerTipsAtom,
- localizationKey: 'com_nav_composer_tips',
- switchId: 'showComposerTips',
- }),
- },
{
id: 'showScrollButton',
tab: GENERAL,
diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.json
index ca5b75f9ce..28e0929954 100644
--- a/client/src/locales/en/translation.json
+++ b/client/src/locales/en/translation.json
@@ -755,7 +755,6 @@
"com_nav_clock_format_system": "System",
"com_nav_collapse_user_messages": "Collapse long user messages",
"com_nav_close_sidebar": "Close sidebar",
- "com_nav_composer_tips": "Show composer tips",
"com_nav_confirm_archive_all": "Confirm Archive",
"com_nav_confirm_clear": "Confirm Clear",
"com_nav_control_panel": "Control Panel",
diff --git a/client/src/store/composerTips.ts b/client/src/store/composerTips.ts
deleted file mode 100644
index a2f9f3a8a6..0000000000
--- a/client/src/store/composerTips.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { createStorageAtom } from './jotai-utils';
-
-/** Whether the composer displays its keyboard shortcut discovery hints. */
-export const showComposerTipsAtom = createStorageAtom<boolean>('showComposerTips', false);
diff --git a/e2e/specs/mock/composer-upload-layout.spec.ts b/e2e/specs/mock/composer-upload-layout.spec.ts
index 2b03bce080..2fe18dd3dd 100644
--- a/e2e/specs/mock/composer-upload-layout.spec.ts
+++ b/e2e/specs/mock/composer-upload-layout.spec.ts
@@ -18,9 +18,6 @@ for (const viewport of [
test('keeps the textarea in place when uploading starts and finishes', async ({
page,
}, testInfo) => {
- await page.addInitScript(() => {
- localStorage.setItem('showComposerTips', 'false');
- });
await page.goto(NEW_CHAT_PATH);
await selectMockEndpoint(page, MOCK_ENDPOINTS[1]);
await sendMessageAndWaitForCompletion(page, 'E2E_REPLY:upload layout');
diff --git a/e2e/specs/mock/scenarios/composer-redesign.spec.ts b/e2e/specs/mock/scenarios/composer-redesign.spec.ts
index 183540aeaa..d95f11c06e 100644
--- a/e2e/specs/mock/scenarios/composer-redesign.spec.ts
+++ b/e2e/specs/mock/scenarios/composer-redesign.spec.ts
@@ -40,7 +40,7 @@ test.describe('composer redesign contracts', () => {
await openComposer(page);
await startRun(page, `interrupt-hint-${Date.now()}`);
await messageInput(page).fill('interrupt hint');
- await expect(page.getByTestId('composer-hints')).toContainText(/interrupt/i);
+ await expect(page.locator('#composer-hint-0')).toContainText(/interrupt/i);
});
test('Staged reasoning relabels steer as a new turn @scenario:staged-reasoning-relabels-steer-as-a-new-turn', async ({