From f1d8d8ae9c8ca5747cfe769ebbf113d29d8247a8 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:19:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AD=20feat:=20Palette=20Show=20All=20C?= =?UTF-8?q?atalogs,=20MCP=20Status=20and=20Composer=20Polish=20(#16422)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Chat/Input/ChatForm.tsx | 13 +- .../components/Chat/Input/Composer/Bar.tsx | 81 +--- .../Chat/Input/Composer/Catalog.tsx | 269 +++++++++++ .../components/Chat/Input/Composer/Effort.tsx | 107 ++++- .../components/Chat/Input/Composer/Files.tsx | 322 +++++++++++++ .../Chat/Input/Composer/Palette.tsx | 153 +++++- .../Chat/Input/Composer/Thinking.tsx | 81 +++- .../Chat/Input/Composer/Waveform.tsx | 102 +++- .../Chat/Input/Composer/__tests__/Bar.spec.ts | 68 +-- .../Input/Composer/__tests__/Files.spec.tsx | 159 +++++++ .../Input/Composer/__tests__/Palette.spec.tsx | 125 ++++- .../Composer/__tests__/Thinking.spec.tsx | 37 ++ .../Chat/Messages/Content/DialogImage.tsx | 177 +++---- .../Messages/Content/FilePreviewDialog.tsx | 32 +- .../Agents/Tools/MarketplaceCatalog.tsx | 14 +- .../SidePanel/Agents/Tools/ToolCard.tsx | 22 +- .../SidePanel/Agents/Tools/items/types.ts | 7 + .../Input/__tests__/useAudioLevels.spec.ts | 27 ++ client/src/hooks/Input/useAudioLevels.ts | 105 ++-- client/src/hooks/Input/usePaletteEntries.tsx | 35 ++ client/src/locales/en/translation.json | 15 + client/src/style.css | 104 +++- .../mock/scenarios/palette-show-all.spec.ts | 448 ++++++++++++++++++ packages/client/src/components/IconButton.tsx | 13 +- 24 files changed, 2154 insertions(+), 362 deletions(-) create mode 100644 client/src/components/Chat/Input/Composer/Catalog.tsx create mode 100644 client/src/components/Chat/Input/Composer/Files.tsx create mode 100644 client/src/components/Chat/Input/Composer/__tests__/Files.spec.tsx create mode 100644 client/src/hooks/Input/__tests__/useAudioLevels.spec.ts create mode 100644 e2e/specs/mock/scenarios/palette-show-all.spec.ts diff --git a/client/src/components/Chat/Input/ChatForm.tsx b/client/src/components/Chat/Input/ChatForm.tsx index bab48e241c..6991216399 100644 --- a/client/src/components/Chat/Input/ChatForm.tsx +++ b/client/src/components/Chat/Input/ChatForm.tsx @@ -554,6 +554,9 @@ const ChatForm = memo(function ChatForm({ speechToText: SpeechToText, index, }); + /** The waveform stands in for the placeholder until words arrive, and is + * then the only thing drawn on that line. */ + const listening = dictation.active && (textValue?.trim() ?? '') === ''; const uploadingCount = useMemo(() => { let count = 0; for (const file of files.values()) { @@ -843,7 +846,11 @@ const ChatForm = memo(function ChatForm({ {endpoint && (
- {dictation.active && (textValue?.trim() ?? '') === '' && ( + {listening && ( /* Stands in for the placeholder: same inset, same line, so it reads as the input listening rather than as a widget bolted on. Once words arrive the transcript takes over. */ diff --git a/client/src/components/Chat/Input/Composer/Bar.tsx b/client/src/components/Chat/Input/Composer/Bar.tsx index 51e8cac378..badf9a6ae7 100644 --- a/client/src/components/Chat/Input/Composer/Bar.tsx +++ b/client/src/components/Chat/Input/Composer/Bar.tsx @@ -1,7 +1,7 @@ import React, { memo, useMemo, useState, useCallback } from 'react'; import * as Ariakit from '@ariakit/react'; import { Mic, Plus, Check, Square, ChevronDown } from 'lucide-react'; -import { MCPIcon, IconButton, TooltipAnchor, SendIcon } from '@librechat/client'; +import { IconButton, TooltipAnchor, SendIcon } from '@librechat/client'; import type { TConversation, EModelEndpoint, EndpointFileConfig } from 'librechat-data-provider'; import type { PaletteEntry, PaletteMode } from '~/hooks/Input/usePaletteEntries'; import type { Dictation } from '~/hooks/Input/useDictation'; @@ -24,14 +24,6 @@ const EMPTY_ENTRIES: PaletteEntry[] = []; /** Matches the rows' `gap-1.5`, which the split arithmetic has to account for. */ const CHIP_GAP = 6; -/** - * Key of the aggregate MCP menu chip. Server rows are keyed `mcp:${serverName}` - * (`usePaletteEntries`), so this cannot live in that namespace: a server named - * `pinned` would produce the same key, and the bar would render two entries - * with one React key and one packing-width slot. - */ -export const PINNED_MCP_KEY = 'aggregate:mcp'; - /** * Whether every chip fits on the button row beside the `+` and the controls. * @@ -78,35 +70,8 @@ export function chipMenuModes(modes?: PaletteMode[]) { } /** Projects palette state into the persistent quick controls in one pass. */ -export function projectBarEntries( - entries: PaletteEntry[], - pinnedMcpEntry?: PaletteEntry, -): PaletteEntry[] { - const projected: PaletteEntry[] = []; - const mcpModes: PaletteMode[] = []; - - for (const entry of entries) { - if (entry.section === 'skill') { - continue; - } - if (entry.section === 'mcp') { - mcpModes.push({ - id: entry.itemId, - label: entry.label, - active: entry.active, - onSelect: entry.onSelect, - }); - } - if (entry.active || entry.pinned) { - projected.push(entry); - } - } - - if (pinnedMcpEntry != null && mcpModes.length > 0) { - projected.push({ ...pinnedMcpEntry, modes: mcpModes }); - } - - return projected; +export function projectBarEntries(entries: PaletteEntry[]): PaletteEntry[] { + return entries.filter((entry) => entry.section !== 'skill' && (entry.active || entry.pinned)); } interface RoundButtonProps { @@ -160,10 +125,9 @@ function RoundButton({ */ interface ChipModesProps { modes: PaletteMode[]; - menuLabel?: string; } -export function ChipModes({ modes, menuLabel }: ChipModesProps) { +export function ChipModes({ modes }: ChipModesProps) { const localize = useLocalize(); const [open, setOpen] = useState(false); const active = modes.find((mode) => mode.active); @@ -174,7 +138,7 @@ export function ChipModes({ modes, menuLabel }: ChipModesProps) { aria-label={ active != null ? localize('com_ui_mode_value', { 0: active.label }) - : (menuLabel ?? localize('com_ui_mode')) + : localize('com_ui_mode') } onClick={(e) => e.stopPropagation()} className="text-text-secondary hover:bg-surface-tertiary hover:text-text-primary focus-visible:ring-border-xheavy -mr-0.5 flex shrink-0 items-center gap-0.5 rounded px-1 text-xs transition-colors focus-visible:ring-2 focus-visible:outline-hidden" @@ -305,33 +269,10 @@ function Bar({ gate lives in one place rather than being re-applied to its result here. */ const entries = allEntries; - const manager = context?.mcpServerManager; - const pinnedMcpEntry = useMemo(() => { - if (manager?.isPinned !== true) { - return undefined; - } - const { placeholderText, setIsPinned } = manager; - return { - key: PINNED_MCP_KEY, - itemType: 'mcp', - itemId: 'mcp', - label: placeholderText || localize('com_ui_mcp_servers'), - icon:
+ {row.showAll != null && ( +
{ + setActiveKey(row.key); + setScrollToActive(false); + }} + className={cn( + 'text-text-secondary flex shrink-0 items-end self-end rounded-md', + index === activeIndex && 'bg-surface-hover', + )} + > + +
+ )}
); } @@ -941,6 +1019,7 @@ function Palette({ const departing = row.type === 'attach' && row.entry.primary !== true && collapsing; const { label, icon } = row.entry; const description = isEntry ? row.entry.description : undefined; + const status = isEntry ? row.entry.status : undefined; const checked = isEntry ? row.entry.active : false; const favorited = isEntry && row.isFavorite; const canFavorite = isEntry && row.entry.favoritable !== false; @@ -989,11 +1068,24 @@ function Palette({ } className="flex h-full min-w-0 flex-1 cursor-pointer items-center gap-2.5 rounded-lg px-2 text-left" > -