diff --git a/client/src/components/Agents/Marketplace.tsx b/client/src/components/Agents/Marketplace.tsx index 6d3a4fd40f..727a0c13f6 100644 --- a/client/src/components/Agents/Marketplace.tsx +++ b/client/src/components/Agents/Marketplace.tsx @@ -125,7 +125,9 @@ const AgentMarketplace: React.FC = ({ className = '' }) = } return ( -
+
= ({ value, onSearch, className = '' } } {isSubagentThreadReadOnly ? (
{localize('com_ui_subagent_thread_read_only')} diff --git a/client/src/components/Chat/Header.tsx b/client/src/components/Chat/Header.tsx index 59543e9407..32a48e7763 100644 --- a/client/src/components/Chat/Header.tsx +++ b/client/src/components/Chat/Header.tsx @@ -79,7 +79,7 @@ function Header({ const hiddenBehindNav = navVisible === true && 'max-md:hidden'; return ( -
+
diff --git a/client/src/components/Chat/Input/ConversationStarters.tsx b/client/src/components/Chat/Input/ConversationStarters.tsx index 43640add30..d6d460487e 100644 --- a/client/src/components/Chat/Input/ConversationStarters.tsx +++ b/client/src/components/Chat/Input/ConversationStarters.tsx @@ -80,7 +80,7 @@ const ConversationStarters = () => { key={index} onClick={() => sendConversationStarter(text)} style={{ animationDelay: `${index * 75}ms`, animationFillMode: 'backwards' }} - className="border-border-medium bg-surface-secondary text-text-secondary fade-in hover:border-border-heavy hover:bg-surface-tertiary hover:text-text-primary focus-visible:ring-ring-primary flex max-w-[16rem] cursor-pointer items-center justify-center rounded-2xl border px-4 py-2.5 text-center text-sm shadow-xs transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-hidden" + className="bg-surface-secondary text-text-secondary fade-in hover:bg-surface-hover hover:text-text-primary focus-visible:ring-text-primary flex max-w-[16rem] cursor-pointer items-center justify-center rounded-2xl px-4 py-2.5 text-center text-sm transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-hidden" > {text} diff --git a/client/src/components/Chat/Input/Files/Table/DataTable.tsx b/client/src/components/Chat/Input/Files/Table/DataTable.tsx index 2bd9eae7ab..15d10aee97 100644 --- a/client/src/components/Chat/Input/Files/Table/DataTable.tsx +++ b/client/src/components/Chat/Input/Files/Table/DataTable.tsx @@ -110,7 +110,7 @@ export default function DataTable({ columns, data }: DataTablePro {isDeleting ? ( ) : ( - + )} {!isSmallScreen && {localize('com_ui_delete')}} @@ -119,6 +119,7 @@ export default function DataTable({ columns, data }: DataTablePro label={localize('com_files_filter')} value={(table.getColumn('filename')?.getFilterValue() as string | undefined) ?? ''} onChange={(event) => table.getColumn('filename')?.setFilterValue(event.target.value)} + surface="dialog" containerClassName="flex-1" />
@@ -129,11 +130,11 @@ export default function DataTable({ columns, data }: DataTablePro />
-
+
- + {table.getHeaderGroups().map((headerGroup) => ( - + {headerGroup.headers.map((header, _index) => { const size = header.getSize(); const style: Style = { @@ -143,7 +144,8 @@ export default function DataTable({ columns, data }: DataTablePro return ( {header.isPlaceholder @@ -158,11 +160,7 @@ export default function DataTable({ columns, data }: DataTablePro {table.getRowModel().rows.length ? ( table.getRowModel().rows.map((row) => ( - + {row.getVisibleCells().map((cell, _index) => { const size = cell.column.getSize(); const style: Style = { @@ -196,7 +194,7 @@ export default function DataTable({ columns, data }: DataTablePro
-
+
{localize('com_files_number_selected', { 0: `${table.getFilteredSelectedRowModel().rows.length}`, @@ -209,7 +207,7 @@ export default function DataTable({ columns, data }: DataTablePro }`}
-
+
{localize('com_ui_page')} {table.getState().pagination.pageIndex + 1} / diff --git a/client/src/components/Chat/Messages/SearchButtons.tsx b/client/src/components/Chat/Messages/SearchButtons.tsx index 6991cf9f64..17c55adc1e 100644 --- a/client/src/components/Chat/Messages/SearchButtons.tsx +++ b/client/src/components/Chat/Messages/SearchButtons.tsx @@ -1,11 +1,12 @@ import { Link } from 'lucide-react'; import { useRecoilValue } from 'recoil'; +import { buttonVariants } from '@librechat/client'; import { QueryKeys } from 'librechat-data-provider'; import { useQueryClient } from '@tanstack/react-query'; import type { TMessage, TConversation } from 'librechat-data-provider'; import type { InfiniteData } from '@tanstack/react-query'; import type { ConversationCursorData } from '~/utils'; -import { findConversationInInfinite, setDocumentTitle } from '~/utils'; +import { cn, findConversationInInfinite, setDocumentTitle } from '~/utils'; import { useLocalize, useNavigateToConvo } from '~/hooks'; import store from '~/store'; @@ -53,15 +54,21 @@ export default function SearchButtons({ message }: { message: TMessage }) { } return ( -
+
+ {/* The chat this result came from, and the way back to it: the same quiet chip + the rest of the app uses for a secondary action, holding a title that can + be any length. */}
); diff --git a/client/src/components/Chat/Messages/SearchMessage.tsx b/client/src/components/Chat/Messages/SearchMessage.tsx index 12f57860e7..13f0bbf05a 100644 --- a/client/src/components/Chat/Messages/SearchMessage.tsx +++ b/client/src/components/Chat/Messages/SearchMessage.tsx @@ -2,16 +2,17 @@ import { memo, useMemo } from 'react'; import { useRecoilValue } from 'recoil'; import type { TMessage } from 'librechat-data-provider'; import type { TMessageProps, TMessageIcon } from '~/common'; +import MessageRow, { getMessageRowWidthClass } from '~/components/Chat/Messages/ui/MessageRow'; import AuthorHeader from '~/components/Chat/Messages/Content/Parts/AuthorHeader'; import MinimalHoverButtons from '~/components/Chat/Messages/MinimalHoverButtons'; import { getHeaderModelName } from '~/components/Chat/Messages/ui/HeaderLabel'; import { getHeaderPrefixForScreenReader, getMessageAriaLabel } from '~/utils'; import SearchContent, { rendersMarkdownLite } from './Content/SearchContent'; -import MessageRow from '~/components/Chat/Messages/ui/MessageRow'; import Icon from '~/components/Chat/Messages/MessageIcon'; import { useAuthContext, useLocalize } from '~/hooks'; import SearchButtons from './SearchButtons'; import SubRow from './SubRow'; +import { cn } from '~/utils'; import store from '~/store'; function searchFilesEqual(prev?: TMessage['files'], next?: TMessage['files']) { @@ -112,8 +113,13 @@ function SearchMessage({ message }: Pick) { } return ( -
-
+
+ {/* A hairline where one result ends and the next begins. Results run together + otherwise, and a long answer followed by a short question reads as one + message. Drawn on the column the message occupies, not the window. */} +
} diff --git a/client/src/components/Chat/Presentation.tsx b/client/src/components/Chat/Presentation.tsx index 46a176099f..0628dff715 100644 --- a/client/src/components/Chat/Presentation.tsx +++ b/client/src/components/Chat/Presentation.tsx @@ -141,7 +141,7 @@ export default function Presentation({ children }: { children: React.ReactNode } const panelElement = artifactsElement ?? subagentElement; return ( - +

diff --git a/client/src/components/Conversations/Conversations.tsx b/client/src/components/Conversations/Conversations.tsx index 5b4d870418..33b2fea2d0 100644 --- a/client/src/components/Conversations/Conversations.tsx +++ b/client/src/components/Conversations/Conversations.tsx @@ -128,7 +128,7 @@ const ChatsHeader: FC = memo(({ isExpanded, onToggle, trailing return (
@@ -164,7 +164,7 @@ const DateLabel: FC<{ groupName: string; isFirst?: boolean; isAlphabetical?: boo isAlphabetical ? 'com_a11y_chats_alpha_section' : 'com_a11y_chats_date_section', isAlphabetical ? { letter: displayName } : { date: displayName }, )} - className={cn('text-text-secondary pt-1 pl-1', isFirst === true ? 'mt-0' : 'mt-2')} + className={cn('text-text-secondary pt-0.5 pl-1', isFirst === true ? 'mt-0' : 'mt-1.5')} style={{ fontSize: '0.7rem' }} > {displayName} @@ -603,7 +603,7 @@ const Conversations: FC = ({ return (
({ })); jest.mock('~/utils', () => ({ cn: (...classes: Array) => classes.filter(Boolean).join(' '), + rowActionClasses: () => 'row-action', })); jest.mock('librechat-data-provider', () => ({ QueryKeys: { messages: 'messages' }, diff --git a/client/src/components/Conversations/PinnedSection.tsx b/client/src/components/Conversations/PinnedSection.tsx index f00faaa656..41cfe26c5d 100644 --- a/client/src/components/Conversations/PinnedSection.tsx +++ b/client/src/components/Conversations/PinnedSection.tsx @@ -705,7 +705,7 @@ const PinnedSection = ({ return (
diff --git a/client/src/components/Conversations/ProjectsSection.tsx b/client/src/components/Conversations/ProjectsSection.tsx index b9e3cb5c78..554f949245 100644 --- a/client/src/components/Conversations/ProjectsSection.tsx +++ b/client/src/components/Conversations/ProjectsSection.tsx @@ -43,7 +43,7 @@ import ProjectCreateDialog from '~/components/Projects/ProjectCreateDialog'; import ProjectDeleteDialog from '~/components/Projects/ProjectDeleteDialog'; import ProjectEditDialog from '~/components/Projects/ProjectEditDialog'; import { useLocalize, useLocalStorage, useNewConvo } from '~/hooks'; -import { clearMessagesCache, cn } from '~/utils'; +import { clearMessagesCache, cn, rowActionClasses } from '~/utils'; import { Collapse } from '~/components/ui'; import Convo from './Convo'; import store from '~/store'; @@ -56,17 +56,6 @@ const iconButtonClassName = cn( 'shrink-0', ); -/** The same control on a project row rather than beside the heading. The row - * itself already fills on hover, so the variant's hover surface would leave - * the button reading as a second, weaker hover on top of it. These take the - * active fill instead — the same one the row's own selected state uses — both - * under the pointer and while the menu they own is open. */ -const rowActionClassName = cn( - iconButtonClassName, - 'hover:bg-surface-active hover:text-text-primary', -); -const rowActionOpenClassName = 'bg-surface-active text-text-primary'; - const noop = () => {}; type ProjectChatsInlineProps = { @@ -282,9 +271,9 @@ const ProjectItem = memo(
  • @@ -307,19 +296,10 @@ const ProjectItem = memo( {project.name}
    @@ -346,7 +326,7 @@ const ProjectItem = memo( trigger={ @@ -435,11 +415,15 @@ const ProjectsSection = ({ toggleNav, isAuthenticated }: ProjectsSectionProps) = if (projects.length === 0) { return ( + /* `section-action` owns the quiet-secondary-until-hovered treatment these + * entries share with the section's other controls; only the row shape is + * the caller's. */ @@ -479,8 +464,8 @@ const ProjectsSection = ({ toggleNav, isAuthenticated }: ProjectsSectionProps) = } return ( -
    -
    +
    +
    } @@ -179,7 +179,7 @@ function LoadingStatusIcon({ serverName, onCancel, canCancel }: InitializingStat return (
    @@ -190,7 +190,7 @@ function ConnectingSpinner({ serverName }: { serverName: string }) { return (
    @@ -204,25 +204,25 @@ function ConnectButton({ serverName, onConfigClick }: StatusIconProps) { variant="ghost" size="icon" onClick={onConfigClick} - className="size-6 rounded p-1 hover:bg-surface-secondary" + className="hover:bg-surface-secondary size-6 rounded p-1" aria-label={localize('com_nav_mcp_connect_server', { 0: serverName })} > -
    ); }); diff --git a/client/src/components/Nav/Settings/Content.tsx b/client/src/components/Nav/Settings/Content.tsx index b91dc6dad7..f1746c5255 100644 --- a/client/src/components/Nav/Settings/Content.tsx +++ b/client/src/components/Nav/Settings/Content.tsx @@ -29,18 +29,18 @@ export default function Content({ activeTab, query, ctx }: ContentProps) { return (
    {results.length === 0 ? ( -

    +

    {localize('com_ui_settings_no_results')}

    ) : ( -
    +
    {results.map(({ entry, label }) => { const Cmp = entry.Component; const tabMeta = TABS.find((t) => t.id === entry.tab)!; const sectionMeta = tabMeta.sections.find((s) => s.id === entry.section); return (
    -
    +
    {localize(tabMeta.labelKey)} ›{' '} {sectionMeta ? localize(sectionMeta.labelKey) : label}
    diff --git a/client/src/components/Nav/Settings/Section.tsx b/client/src/components/Nav/Settings/Section.tsx index b5cd894aa6..2669a8be5a 100644 --- a/client/src/components/Nav/Settings/Section.tsx +++ b/client/src/components/Nav/Settings/Section.tsx @@ -13,17 +13,20 @@ export default function Section({ heading, icon, danger, children }: SectionProp

    {icon} {heading}

    + {/* A section is a group, not a card: spacing and the label above carry the + grouping. The destructive section keeps its edge, where the box is the + warning rather than decoration. */}
    {children} diff --git a/client/src/components/Nav/__tests__/SearchBar.remount.spec.tsx b/client/src/components/Nav/__tests__/SearchBar.remount.spec.tsx index 4cca85946a..5766475784 100644 --- a/client/src/components/Nav/__tests__/SearchBar.remount.spec.tsx +++ b/client/src/components/Nav/__tests__/SearchBar.remount.spec.tsx @@ -44,6 +44,8 @@ jest.mock('~/hooks', () => ({ jest.mock('~/hooks/useKeyboardShortcuts', () => ({ useShortcutAriaKey: () => 'Meta+/', + /** The chord the field prints while it is empty. */ + useShortcutDisplay: () => '⌘/', })); jest.mock('~/store', () => ({ @@ -102,6 +104,34 @@ describe('SearchBar across a breakpoint remount', () => { }); }); + describe('what the field offers while it rests', () => { + /** The chord is painted under the pointer only, which is CSS; what is checked + * here is which of the two the trailing slot holds. */ + it('holds the chord until there is something to clear', () => { + render(); + + expect(screen.getByText('⌘/')).toBeInTheDocument(); + expect(screen.queryByLabelText('com_ui_clear_search')).not.toBeInTheDocument(); + + type('mobile nav'); + + expect(screen.queryByText('⌘/')).not.toBeInTheDocument(); + expect(screen.getByLabelText('com_ui_clear_search')).toBeInTheDocument(); + }); + + /** A query left behind keeps the results route mounted, so the key that + * dismisses the search has to dismiss what it found. */ + it('empties itself on Escape', () => { + render(); + type('mobile nav'); + + fireEvent.keyDown(input(), { key: 'Escape' }); + + expect(input().value).toBe(''); + expect(mockSearchState.query).toBe(''); + }); + }); + describe('what the departing instance owes the search state', () => { beforeEach(() => jest.useFakeTimers()); afterEach(() => jest.useRealTimers()); @@ -194,4 +224,18 @@ describe('SearchBar across a breakpoint remount', () => { expect(mockSearchState.debouncedQuery).toBe(''); }); }); + + /** An IME uses Escape to cancel the text it is composing, not the search. */ + describe('Escape while an IME is composing', () => { + it('keeps the query during composition and clears it after', () => { + render(); + type('konnichiwa'); + + fireEvent.keyDown(input(), { key: 'Escape', isComposing: true }); + expect(input().value).toBe('konnichiwa'); + + fireEvent.keyDown(input(), { key: 'Escape' }); + expect(input().value).toBe(''); + }); + }); }); diff --git a/client/src/components/Projects/ProjectsView.tsx b/client/src/components/Projects/ProjectsView.tsx index 75087765c3..464fff5cec 100644 --- a/client/src/components/Projects/ProjectsView.tsx +++ b/client/src/components/Projects/ProjectsView.tsx @@ -252,7 +252,7 @@ export default function ProjectsView() { }; return ( -
    +
    setIsCreating(true)} />
    diff --git a/client/src/components/Prompts/buttons/AutoSendPrompt.tsx b/client/src/components/Prompts/buttons/AutoSendPrompt.tsx index 21194e248e..dcd3b1f519 100644 --- a/client/src/components/Prompts/buttons/AutoSendPrompt.tsx +++ b/client/src/components/Prompts/buttons/AutoSendPrompt.tsx @@ -1,5 +1,5 @@ import { useRecoilState } from 'recoil'; -import { Button, Checkbox } from '@librechat/client'; +import { Button, CheckboxGlyph } from '@librechat/client'; import { useLocalize } from '~/hooks'; import store from '~/store'; @@ -25,15 +25,11 @@ export default function AutoSendPrompt({ onClick={() => handleCheckedChange(!autoSendPrompts)} aria-label={localize('com_nav_auto_send_prompts')} aria-pressed={autoSendPrompts} - className={`relative h-9 w-full gap-2 rounded-lg border-border-light font-medium ${autoSendPrompts ? 'bg-surface-hover hover:bg-surface-hover' : ''}`} + className={`border-border-light relative h-9 w-full gap-2 rounded-lg font-medium ${autoSendPrompts ? 'bg-surface-hover hover:bg-surface-hover' : ''}`} > -
    +
    + {/* Sticky header: title, create, filter */} + + + setCreateOpen(true)} + > + + + } + search={ + setSearchQuery(e.target.value)} + /> + } + /> {/* Only the list scrolls */} ({ columns, data }: DataTablePro onChange={(event) => table.getColumn('filename')?.setFilterValue(event.target.value)} /> -
    +
  • {table.getHeaderGroups().map((headerGroup) => ( - + {headerGroup.headers.map((header, index) => (
    {header.isPlaceholder @@ -274,11 +275,7 @@ export default function DataTable({ columns, data }: DataTablePro {table.getRowModel().rows.length ? ( table.getRowModel().rows.map((row) => ( - + {row.getVisibleCells().map((cell) => { const isFilenameCell = cell.column.id === 'filename'; diff --git a/client/src/components/SidePanel/MCPBuilder/MCPBuilderPanel.tsx b/client/src/components/SidePanel/MCPBuilder/MCPBuilderPanel.tsx index 002855d154..ed7f9f5b3e 100644 --- a/client/src/components/SidePanel/MCPBuilder/MCPBuilderPanel.tsx +++ b/client/src/components/SidePanel/MCPBuilder/MCPBuilderPanel.tsx @@ -1,4 +1,4 @@ -import { useState, useRef, useMemo, useEffect } from 'react'; +import { useState, useRef, useMemo, useEffect, useId } from 'react'; import { Plus } from 'lucide-react'; import { useRecoilValue } from 'recoil'; import { useLocation } from 'react-router-dom'; @@ -11,8 +11,8 @@ import { useAuthContext, activateCatalog, } from '~/hooks'; +import { PanelFooter, PanelContent, PanelHeader } from '~/components/ui'; import MCPConfigDialog from '~/components/MCP/MCPConfigDialog'; -import { PanelFooter, PanelContent } from '~/components/ui'; import MCPServerCardSkeleton from './MCPServerCardSkeleton'; import { useMCPRefresh } from '~/hooks/MCP/useMCPRefresh'; import MCPAdminSettings from './MCPAdminSettings'; @@ -22,6 +22,7 @@ import store from '~/store'; export default function MCPBuilderPanel() { const localize = useLocalize(); + const headingId = useId(); const location = useLocation(); /** The panel stays mounted while the sidebar is hidden (collapsed, mobile * drawer, or the insights route collapsing it), so only a visible panel @@ -63,20 +64,15 @@ export default function MCPBuilderPanel() { return (
    - {/* Sticky header: Search + Add Button */} -
    -
    - setSearchQuery(e.target.value)} - containerClassName="flex-1" - /> - {hasCreateAccess && ( + {/* Sticky header: title, create, search */} + setShowDialog(true)} aria-label={localize('com_ui_add_mcp')} > @@ -101,9 +97,17 @@ export default function MCPBuilderPanel() { /> - )} -
    -
    + ) + } + search={ + setSearchQuery(e.target.value)} + /> + } + /> {/* Only the list scrolls */} ({ })); jest.mock('@librechat/client', () => ({ + Button: jest.requireActual('@librechat/client').Button, + buttonVariants: jest.requireActual('@librechat/client').buttonVariants, Spinner: (props: React.ComponentProps<'span'>) => , TooltipAnchor: ({ children, + render, description: _description, side: _side, ...props - }: React.ComponentProps<'div'> & { description: string; side?: string }) => ( -
    {children}
    - ), + }: React.ComponentProps<'div'> & { + description: string; + side?: string; + render?: React.ReactElement; + }) => render ??
    {children}
    , })); const connectedOAuthStatus = { @@ -44,7 +49,9 @@ describe('MCPCardActions', () => { ); const revokeButton = screen.getByRole('button', { name: 'com_ui_revoke' }); - expect(revokeButton).toHaveClass('hover:text-text-secondary'); + /** The control takes the shared row-action appearance, and the icon states its + * own colour, so hovering the row cannot repaint a destructive action. */ + expect(revokeButton).toHaveClass('hover:bg-surface-hover-alt', 'rounded-md'); expect(revokeButton.querySelector('svg')).toHaveClass('text-text-destructive'); }); diff --git a/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx b/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx index 27f615735f..38998e64fe 100644 --- a/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx +++ b/client/src/components/SidePanel/MCPBuilder/MCPCardActions.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { Spinner, TooltipAnchor } from '@librechat/client'; -import { Pencil, PlugZap, SlidersHorizontal, RefreshCw, X, Trash2 } from 'lucide-react'; +import { Button, Spinner, TooltipAnchor } from '@librechat/client'; +import { KeyRound, Pencil, PlugZap, RefreshCw, Unlink, X } from 'lucide-react'; import type { MCPServerStatus } from 'librechat-data-provider'; +import { cn, rowActionClasses, rowActionSlotClasses } from '~/utils'; import { useLocalize } from '~/hooks'; -import { cn } from '~/utils'; interface MCPCardActionsProps { serverName: string; @@ -21,15 +21,21 @@ interface MCPCardActionsProps { } /** - * Standardized action buttons for MCP server cards. + * The actions on an MCP server row. * - * Unified icon system (each icon has ONE meaning): - * - Pencil: Edit server definition (Settings panel only) - * - PlugZap: Connect/Authenticate (for disconnected/error servers) - * - SlidersHorizontal: Configure custom variables (for connected servers with vars) - * - Trash2: Revoke OAuth access (for connected OAuth servers) - * - RefreshCw: Reconnect/Refresh (for connected servers) - * - Spinner: Loading state (with X on hover for cancel) + * One icon, one meaning, and the meaning is the noun the action acts on rather + * than a generic verb: + * - Pencil: the server definition (Settings panel only) + * - KeyRound: the credentials this server asks each user for, which is also what + * marks a server as needing authentication + * - PlugZap: the connection, made + * - Unlink: the account grant, given up. Revoking is dropping the link between + * this user and the provider, NOT deleting the server, which is what a trash can + * said here before and what it stays reserved for. A broken link rather than a + * pulled plug, because the grant and the transport are different things: revoking + * one does not close the other + * - RefreshCw: reconnecting a server that is already connected + * - Spinner, with X on hover: a connection in flight, and cancelling it */ export default function MCPCardActions({ serverName, @@ -53,52 +59,61 @@ export default function MCPCardActions({ const isDisconnected = connectionState === 'disconnected'; const isError = connectionState === 'error'; - const buttonBaseClass = cn( - 'flex size-7 items-center justify-center rounded-md', - 'transition-colors duration-150', - 'text-text-secondary hover:text-text-secondary', - 'hover:bg-surface-tertiary', - 'focus-visible:ring-2 focus-visible:ring-text-primary', - ); + /** A run in flight is a state of the row, not an action waiting to be found: + * the spinner and the cancel that replaces it stay put without a hover. */ + const loadingClass = rowActionClasses({ visible: true }); // Loading state - show spinner (with cancel option) if (isInitializing || isConnecting) { return ( -
    +
    {/* Edit button stays visible during loading */} {canEdit && ( - + render={ + + } + /> )} {/* Spinner with cancel on hover */} {canCancel ? ( -
    - - -
    -
    + render={ + + } + /> ) : ( -
    +
    +
    {/* Edit button - opens MCPServerDialog to edit server definition */} {canEdit && ( - - + + )} {/* Connect button - for disconnected or error states */} {(isDisconnected || isError) && !serverStatus?.requestScoped && ( - onInitialize()} - > + onInitialize()}> + )} {/* On-demand servers stay idle between requests, so their user variables must remain configurable without a live transport connection. */} {(isConnected || serverStatus?.requestScoped) && hasCustomUserVars && ( - - + + )} {/* Refresh button - for connected servers (allows reconnection) */} {isConnected && !serverStatus?.requestScoped && ( - onInitialize()} - > - + onInitialize()}> + )} {/* Revoke button - for OAuth servers (available regardless of connection state) */} {serverStatus?.requiresOAuth && onRevoke && ( - - + + )}
    ); } + +/** A revealed row action with its tooltip: the label is both the tooltip and the name. */ +const RowAction = React.forwardRef< + HTMLDivElement, + { label: string; onClick: (e: React.MouseEvent) => void; children: React.ReactNode } +>(function RowAction({ label, onClick, children }, ref) { + return ( + + {children} + + } + /> + ); +}); diff --git a/client/src/components/SidePanel/MCPBuilder/MCPServerCard.tsx b/client/src/components/SidePanel/MCPBuilder/MCPServerCard.tsx index 51ceff5101..b2498ef4a9 100644 --- a/client/src/components/SidePanel/MCPBuilder/MCPServerCard.tsx +++ b/client/src/components/SidePanel/MCPBuilder/MCPServerCard.tsx @@ -111,7 +111,8 @@ export default function MCPServerCard({
    diff --git a/client/src/components/SidePanel/MCPBuilder/MCPServerCardSkeleton.tsx b/client/src/components/SidePanel/MCPBuilder/MCPServerCardSkeleton.tsx index a208a97b6e..0fa89b18d7 100644 --- a/client/src/components/SidePanel/MCPBuilder/MCPServerCardSkeleton.tsx +++ b/client/src/components/SidePanel/MCPBuilder/MCPServerCardSkeleton.tsx @@ -5,10 +5,7 @@ export default function MCPServerCardSkeleton({ count = 5 }: { count?: number }) return (
    + TableHeaderProps & React.RefAttributes +> = React.forwardRef( + ({ className, sticky = false, ...props }, ref) => ( + ), ); TableHeader.displayName = 'TableHeader'; @@ -47,14 +57,7 @@ const TableFooter: React.ForwardRefExoticComponent< React.HTMLAttributes & React.RefAttributes > = React.forwardRef>( ({ className, ...props }, ref) => ( - tr]:last:border-b-0', - className, - )} - {...props} - /> + ), ); TableFooter.displayName = 'TableFooter'; @@ -66,7 +69,9 @@ const TableRow: React.ForwardRefExoticComponent< & React.RefAttributes -> = React.forwardRef>( - ({ className, ...props }, ref) => ( -
    - ), -); + React.ThHTMLAttributes & + React.RefAttributes & { size?: 'default' | 'sm' } +> = React.forwardRef< + HTMLTableCellElement, + React.ThHTMLAttributes & { size?: 'default' | 'sm' } +>(({ className, size, ...props }, ref) => ( + +)); TableHead.displayName = 'TableHead'; const TableCell: React.ForwardRefExoticComponent< diff --git a/packages/client/src/components/Tabs.tsx b/packages/client/src/components/Tabs.tsx index 5e1b0c9792..a3f166201b 100644 --- a/packages/client/src/components/Tabs.tsx +++ b/packages/client/src/components/Tabs.tsx @@ -33,7 +33,7 @@ const TabsTrigger: React.ForwardRefExoticComponent< >(({ className = '', ...props }, ref) => ( cn( 'group relative inline-flex items-center justify-center gap-theme-compact', 'h-theme-control rounded-theme-control-round border border-border-medium', - 'bg-transparent text-sm font-medium text-text-primary shadow-xs transition-all', - 'hover:bg-surface-hover hover:shadow-md active:shadow-inner', + 'bg-transparent text-sm font-medium text-text-primary transition-all', + /** No elevation: a row of raised pills inside the composer competes with the + * composer itself. The edge stays, because a fill alone against the composer + * surface is under 1.2:1 and would leave the control with no visible boundary. */ + 'hover:bg-surface-hover', );