From a7e2d66e75f13846cd509ed8a6ad4e0a363f6de6 Mon Sep 17 00:00:00 2001
From: Marco Beretta <81851188+berry-13@users.noreply.github.com>
Date: Wed, 7 Oct 2026 18:23:53 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20refactor:=20Clear=20Chat=20Input?=
=?UTF-8?q?=20Design=20Suppressions=20Through=20Existing=20Variants=20(#16?=
=?UTF-8?q?863)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* refactor: Clear Chat Input Design Suppressions Through Existing Variants
* test: Cover the Chat Composer Send Path After the Suppression Cleanup
* refactor: Keep the FileUpload Action on Its Ghost Pressed Fill
---
client/src/components/Chat/Footer.tsx | 5 +-
.../components/Chat/Input/Files/FileRow.tsx | 25 ++---
.../components/Chat/Input/HeaderOptions.tsx | 96 -------------------
client/src/components/Chat/Input/Mention.tsx | 2 +-
.../components/Chat/Input/OptionsPopover.tsx | 93 ------------------
.../components/Chat/Input/PopoverButtons.tsx | 50 +---------
.../components/Chat/Input/PromptsCommand.tsx | 2 +-
.../components/Chat/Input/SkillsCommand.tsx | 2 +-
.../src/components/Chat/Input/StreamAudio.tsx | 8 +-
.../Chat/Input/TokenUsage/Breakdown.tsx | 6 +-
.../Chat/Input/TokenUsage/index.tsx | 2 +-
.../src/components/Chat/Trace/Inspector.tsx | 2 +-
client/src/components/Chat/Trace/Ledger.tsx | 4 +-
client/src/components/Chat/Trace/Timeline.tsx | 2 +-
client/src/components/Chat/Trace/Viewer.tsx | 2 +-
.../src/components/Chat/approval/Review.tsx | 8 +-
client/src/components/Chat/ask/options.tsx | 2 +-
.../mock/scenarios/composer-surfaces.spec.ts | 26 +++++
eslint-suppressions.json | 64 ++-----------
19 files changed, 63 insertions(+), 338 deletions(-)
delete mode 100644 client/src/components/Chat/Input/HeaderOptions.tsx
delete mode 100644 client/src/components/Chat/Input/OptionsPopover.tsx
create mode 100644 e2e/specs/mock/scenarios/composer-surfaces.spec.ts
diff --git a/client/src/components/Chat/Footer.tsx b/client/src/components/Chat/Footer.tsx
index 30bd1cc20c..f92aeed314 100644
--- a/client/src/components/Chat/Footer.tsx
+++ b/client/src/components/Chat/Footer.tsx
@@ -155,10 +155,7 @@ function Footer({ className, startupConfig, configuredOnly = false }: FooterProp
{contentRender}
{!isLastElement && (
-
+
)}
);
diff --git a/client/src/components/Chat/Input/Files/FileRow.tsx b/client/src/components/Chat/Input/Files/FileRow.tsx
index 95d43b2ac9..d21342662c 100644
--- a/client/src/components/Chat/Input/Files/FileRow.tsx
+++ b/client/src/components/Chat/Input/Files/FileRow.tsx
@@ -111,27 +111,16 @@ export default function FileRow({
}
const renderFiles = () => {
- const rowStyle = isRTL
- ? {
- display: 'flex',
- flexDirection: 'row-reverse',
- flexWrap: 'wrap',
- gap: '6px',
- width: '100%',
- maxWidth: '100%',
- }
- : {
- display: 'flex',
- flexWrap: 'wrap',
- gap: '6px',
- width: '100%',
- maxWidth: '100%',
- };
-
return (
/* `items-center` so a card and a thumbnail of different heights share
one baseline instead of hanging from the top of the tallest row. */
-
+
{files
.reduce(
(acc, current) => {
diff --git a/client/src/components/Chat/Input/HeaderOptions.tsx b/client/src/components/Chat/Input/HeaderOptions.tsx
deleted file mode 100644
index 063ca27d23..0000000000
--- a/client/src/components/Chat/Input/HeaderOptions.tsx
+++ /dev/null
@@ -1,96 +0,0 @@
-import { useState } from 'react';
-import { Settings2 } from 'lucide-react';
-import { TooltipAnchor } from '@librechat/client';
-import { Root, Anchor } from '@radix-ui/react-popover';
-import { isParamEndpoint, getEndpointField, tConvoUpdateSchema } from 'librechat-data-provider';
-import type { TPreset, TInterfaceConfig } from 'librechat-data-provider';
-import { EndpointSettings, SaveAsPresetDialog, AlternativeSettings } from '~/components/Endpoints';
-import { useSetIndexOptions, useLocalize } from '~/hooks';
-import { useGetEndpointsQuery } from '~/data-provider';
-import OptionsPopover from './OptionsPopover';
-import PopoverButtons from './PopoverButtons';
-import { useChatContext } from '~/Providers';
-
-export default function HeaderOptions({
- interfaceConfig,
-}: {
- interfaceConfig?: Partial
;
-}) {
- const { data: endpointsConfig } = useGetEndpointsQuery();
-
- const [saveAsDialogShow, setSaveAsDialogShow] = useState(false);
- const localize = useLocalize();
-
- const { showPopover, conversation, setShowPopover } = useChatContext();
- const { setOption } = useSetIndexOptions();
- const { endpoint } = conversation ?? {};
-
- const saveAsPreset = () => {
- setSaveAsDialogShow(true);
- };
-
- if (!endpoint) {
- return null;
- }
-
- const triggerAdvancedMode = () => setShowPopover((prev) => !prev);
-
- const endpointType = getEndpointField(endpointsConfig, endpoint, 'type');
- const paramEndpoint = isParamEndpoint(endpoint, endpointType);
-
- return (
-
-
-
-
-
- {interfaceConfig?.parameters === true && paramEndpoint === false && (
-
-
-
- )}
-
- {interfaceConfig?.parameters === true && paramEndpoint === false && (
- }
- closePopover={() => setShowPopover(false)}
- >
-
-
- )}
- {interfaceConfig?.presets === true && (
-
- )}
-
-
-
-
- );
-}
diff --git a/client/src/components/Chat/Input/Mention.tsx b/client/src/components/Chat/Input/Mention.tsx
index 1685a47f35..3f1ccf8afe 100644
--- a/client/src/components/Chat/Input/Mention.tsx
+++ b/client/src/components/Chat/Input/Mention.tsx
@@ -186,7 +186,7 @@ function MentionContent({
{
diff --git a/client/src/components/Chat/Input/OptionsPopover.tsx b/client/src/components/Chat/Input/OptionsPopover.tsx
deleted file mode 100644
index 8aac76f3f2..0000000000
--- a/client/src/components/Chat/Input/OptionsPopover.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-import { useRef } from 'react';
-import { Save } from 'lucide-react';
-import { Portal, Content } from '@radix-ui/react-popover';
-import { Button, CrossIcon, useOnClickOutside } from '@librechat/client';
-import type { ReactNode } from 'react';
-import { useLocalize } from '~/hooks';
-import { cn } from '~/utils';
-
-type TOptionsPopoverProps = {
- children: ReactNode;
- visible: boolean;
- saveAsPreset: () => void;
- closePopover: () => void;
- PopoverButtons: ReactNode;
- presetsDisabled: boolean;
-};
-
-export default function OptionsPopover({
- children,
- // endpoint,
- visible,
- saveAsPreset,
- closePopover,
- PopoverButtons,
- presetsDisabled,
-}: TOptionsPopoverProps) {
- const popoverRef = useRef(null);
- useOnClickOutside(
- popoverRef,
- () => closePopover(),
- ['dialog-template-content', 'shadcn-button', 'advanced-settings'],
- (_target) => {
- const target = _target as Element;
- if (
- target.id === 'presets-button' ||
- (target.parentNode instanceof Element && target.parentNode.id === 'presets-button')
- ) {
- return false;
- }
- const tagName = target.tagName;
- return tagName === 'path' || tagName === 'svg' || tagName === 'circle';
- },
- );
-
- const localize = useLocalize();
- const cardStyle =
- 'shadow-xl rounded-md min-w-[4.6875rem] font-normal bg-surface-secondary border-border-light border text-text-primary';
-
- if (!visible) {
- return null;
- }
-
- return (
-
-
-
-
-
- {presetsDisabled ? null : (
-
- )}
- {PopoverButtons}
-
-
-
{children}
-
-
-
-
- );
-}
diff --git a/client/src/components/Chat/Input/PopoverButtons.tsx b/client/src/components/Chat/Input/PopoverButtons.tsx
index 2059603982..e2e4677565 100644
--- a/client/src/components/Chat/Input/PopoverButtons.tsx
+++ b/client/src/components/Chat/Input/PopoverButtons.tsx
@@ -1,6 +1,6 @@
-import { useRecoilState } from 'recoil';
+import { useSetRecoilState } from 'recoil';
+import { Button, MessagesSquared } from '@librechat/client';
import { EModelEndpoint, SettingsViews } from 'librechat-data-provider';
-import { Button, MessagesSquared, AssistantIcon, DataIcon } from '@librechat/client';
import type { ReactNode } from 'react';
import { useChatContext } from '~/Providers';
import { useLocalize } from '~/hooks';
@@ -11,7 +11,6 @@ type TPopoverButton = {
label: string;
buttonClass: string;
handler: () => void;
- type?: 'alternative';
icon: ReactNode;
};
@@ -30,7 +29,7 @@ export default function PopoverButtons({
}) {
const localize = useLocalize();
const { conversation, optionSettings, setOptionSettings } = useChatContext();
- const [settingsView, setSettingsView] = useRecoilState(store.currentSettingsView);
+ const setSettingsView = useSetRecoilState(store.currentSettingsView);
const { model: _model, endpoint: _endpoint, endpointType } = conversation ?? {};
const overrideEndpoint = overrideEndpointType ?? _overrideEndpoint;
@@ -68,31 +67,8 @@ export default function PopoverButtons({
return null;
}
- const additionalButtons: { [key: string]: TPopoverButton[] } = {
- [SettingsViews.default]: [
- {
- label: 'Context Settings',
- buttonClass: '',
- type: 'alternative',
- handler: () => setSettingsView(SettingsViews.advanced),
- icon: ,
- },
- ],
- [SettingsViews.advanced]: [
- {
- label: 'Model Settings',
- buttonClass: '',
- type: 'alternative',
- handler: () => setSettingsView(SettingsViews.default),
- icon: ,
- },
- ],
- };
-
const endpointButtons = (endpointSpecificbuttons[endpoint] as TPopoverButton[] | null) ?? [];
- const disabled = true;
-
return (
@@ -113,26 +89,6 @@ export default function PopoverButtons({
))}
- {disabled ? null : (
-
- {additionalButtons[settingsView].map((button, index) => (
-
- ))}
-
- )}
);
}
diff --git a/client/src/components/Chat/Input/PromptsCommand.tsx b/client/src/components/Chat/Input/PromptsCommand.tsx
index 576333a6cb..48db1c6a28 100644
--- a/client/src/components/Chat/Input/PromptsCommand.tsx
+++ b/client/src/components/Chat/Input/PromptsCommand.tsx
@@ -221,7 +221,7 @@ function PromptsCommand({
{
diff --git a/client/src/components/Chat/Input/SkillsCommand.tsx b/client/src/components/Chat/Input/SkillsCommand.tsx
index 54c77c74c1..0d8d60ac37 100644
--- a/client/src/components/Chat/Input/SkillsCommand.tsx
+++ b/client/src/components/Chat/Input/SkillsCommand.tsx
@@ -290,7 +290,7 @@ function SkillsCommandContent({
{
diff --git a/client/src/components/Chat/Input/StreamAudio.tsx b/client/src/components/Chat/Input/StreamAudio.tsx
index 5db4b9c767..a35a839183 100644
--- a/client/src/components/Chat/Input/StreamAudio.tsx
+++ b/client/src/components/Chat/Input/StreamAudio.tsx
@@ -208,13 +208,7 @@ export default function StreamAudio({ index = 0 }) {
ref={audioRef}
controls
controlsList="nodownload nofullscreen noremoteplayback"
- style={{
- position: 'absolute',
- overflow: 'hidden',
- display: 'none',
- height: '0px',
- width: '0px',
- }}
+ className="absolute hidden size-0 overflow-hidden"
src={globalAudioURL ?? undefined}
id={globalAudioId}
autoPlay
diff --git a/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx b/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx
index 70b5752398..e7281ff6d9 100644
--- a/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx
+++ b/client/src/components/Chat/Input/TokenUsage/Breakdown.tsx
@@ -414,13 +414,13 @@ export default function Breakdown({
{TICKS.map((fraction) => (
diff --git a/client/src/components/Chat/Trace/Viewer.tsx b/client/src/components/Chat/Trace/Viewer.tsx
index 580ea6086b..84162078d3 100644
--- a/client/src/components/Chat/Trace/Viewer.tsx
+++ b/client/src/components/Chat/Trace/Viewer.tsx
@@ -370,7 +370,7 @@ export default function Viewer({
if (recordsQuery.isLoading) {
return (
-
+
{localize('com_ui_trace_loading')}
);
diff --git a/client/src/components/Chat/approval/Review.tsx b/client/src/components/Chat/approval/Review.tsx
index d6f648c623..9cb84e6785 100644
--- a/client/src/components/Chat/approval/Review.tsx
+++ b/client/src/components/Chat/approval/Review.tsx
@@ -116,10 +116,10 @@ export const PendingToolApprovalPanel = memo(function PendingToolApprovalPanel({
render={
setOpen(false)}
>
@@ -226,12 +226,12 @@ export const PendingToolApprovalButton = memo(function PendingToolApprovalButton
return (
setOpen((current) => !current)}
- className="text-text-secondary h-8 gap-1.5 rounded-full px-2"
+ className="h-8 gap-1.5 rounded-full px-2"
data-testid="pending-tool-approval-button"
>
diff --git a/client/src/components/Chat/ask/options.tsx b/client/src/components/Chat/ask/options.tsx
index 9af98b07fe..1e7d0180c6 100644
--- a/client/src/components/Chat/ask/options.tsx
+++ b/client/src/components/Chat/ask/options.tsx
@@ -69,7 +69,7 @@ export default function AskOptions({
>
{
+ test('sends a message and renders the reply with the composer intact @scenario:composer-send-and-reply', async ({
+ page,
+ }) => {
+ await page.goto(NEW_CHAT_PATH, { timeout: 15000 });
+ await selectMockEndpoint(page, MOCK_ENDPOINTS[0]);
+ await sendMessage(page, 'composer surfaces');
+ await expect(mockReply(page)).toBeVisible({ timeout: 30000 });
+ await expect(page.getByRole('textbox', { name: 'Message input' })).toBeVisible();
+ });
+});
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
index 8cee455aad..7cb967a91d 100644
--- a/eslint-suppressions.json
+++ b/eslint-suppressions.json
@@ -98,11 +98,6 @@
"count": 1
}
},
- "client/src/components/Chat/Footer.tsx": {
- "shadcn/no-arbitrary-values": {
- "count": 1
- }
- },
"client/src/components/Chat/Input/AskUserQuestionPopover.tsx": {
"shadcn/no-restyle": {
"count": 6
@@ -132,11 +127,6 @@
"count": 3
}
},
- "client/src/components/Chat/Input/Files/FileRow.tsx": {
- "shadcn/no-inline-styles": {
- "count": 7
- }
- },
"client/src/components/Chat/Input/Files/FileUpload.tsx": {
"shadcn/no-restyle": {
"count": 11
@@ -183,11 +173,6 @@
"count": 13
}
},
- "client/src/components/Chat/Input/HeaderOptions.tsx": {
- "shadcn/no-restyle": {
- "count": 9
- }
- },
"client/src/components/Chat/Input/MCPConfigDialog.tsx": {
"shadcn/no-restyle": {
"count": 17
@@ -195,25 +180,20 @@
},
"client/src/components/Chat/Input/Mention.tsx": {
"shadcn/no-restyle": {
- "count": 6
- }
- },
- "client/src/components/Chat/Input/OptionsPopover.tsx": {
- "shadcn/no-restyle": {
- "count": 5
+ "count": 4
}
},
"client/src/components/Chat/Input/PopoverButtons.tsx": {
"shadcn/no-restyle": {
- "count": 22
+ "count": 11
},
"shadcn/require-static-classes": {
- "count": 7
+ "count": 3
}
},
"client/src/components/Chat/Input/PromptsCommand.tsx": {
"shadcn/no-restyle": {
- "count": 6
+ "count": 4
}
},
"client/src/components/Chat/Input/QuoteButton.tsx": {
@@ -223,22 +203,12 @@
},
"client/src/components/Chat/Input/SkillsCommand.tsx": {
"shadcn/no-restyle": {
- "count": 6
- }
- },
- "client/src/components/Chat/Input/StreamAudio.tsx": {
- "shadcn/no-inline-styles": {
- "count": 3
+ "count": 4
}
},
"client/src/components/Chat/Input/TokenUsage/Breakdown.tsx": {
"shadcn/no-restyle": {
- "count": 12
- }
- },
- "client/src/components/Chat/Input/TokenUsage/index.tsx": {
- "shadcn/no-restyle": {
- "count": 1
+ "count": 10
}
},
"client/src/components/Chat/Landing.tsx": {
@@ -629,37 +599,19 @@
"count": 3
}
},
- "client/src/components/Chat/Trace/Inspector.tsx": {
- "shadcn/no-restyle": {
- "count": 1
- }
- },
"client/src/components/Chat/Trace/Ledger.tsx": {
- "shadcn/no-arbitrary-values": {
- "count": 2
- },
"shadcn/no-inline-styles": {
"count": 4
}
},
- "client/src/components/Chat/Trace/Timeline.tsx": {
- "shadcn/no-arbitrary-values": {
- "count": 1
- }
- },
"client/src/components/Chat/Trace/Viewer.tsx": {
"shadcn/no-restyle": {
- "count": 3
+ "count": 2
}
},
"client/src/components/Chat/approval/Review.tsx": {
"shadcn/no-restyle": {
- "count": 7
- }
- },
- "client/src/components/Chat/ask/options.tsx": {
- "shadcn/no-arbitrary-values": {
- "count": 1
+ "count": 5
}
},
"client/src/components/Conversations/Convo.tsx": {