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" > -