From 1dc4e0d27863b6ff29af19a7af86af50461bbb84 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Fri, 25 Sep 2026 11:46:09 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=B6=20style:=20Quieter=20Primitives,?= =?UTF-8?q?=20Shared=20Panel=20Headers,=20and=20Flat=20Management=20Lists?= =?UTF-8?q?=20(#16244)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * style: Quieten the shared primitives and the dark borders The primitives carried the weight the screens then inherited: boxed empty states, outlined table shells, raised composer pills. Softening them here means a screen gets the quieter treatment by composing what it already composes rather than by overriding it. Dark moves its border roles one step off the page instead of two, so an edge separates a surface from the one behind it without reading as a seam. The values live in style.css for the pre-hydration paint and in dark.ts for the runtime theme, so both change together. Checkbox gains CheckboxGlyph, the presentational half of the control, for rows that are already a button and must not nest a second one inside it. * feat(client): Panel header and scroll fade for the side panels Every management panel was building its own title row, so the title, the search field and the create button sat at a different size and spacing in each one. PanelHeader is that row, and the panels adopt it next. PanelContent gains a fade at its foot, fed by useScrollFade, which watches the viewport and its content and reports whether anything sits below the fold. A list that is exactly as tall as its box shows no fade, and the gradient is dropped under prefers-reduced-motion. The sidebar keeps a right edge in every theme now that it shares a surface with the content beside it, rather than only in high contrast. * style: Apply the quieter layout to the panels and management pages The main content now sits on the same surface as the sidebar, so the app reads as one plane instead of a page floating on a backdrop. With the fill gone the containers had nothing left to justify them: cards, outlines and double borders come off the MCP, Skills, Bookmarks, Memory, Prompts and Scheduled Chats lists, and spacing and weight carry the hierarchy instead. The management screens adopt PanelHeader, so title, search and create sit at one size and one rhythm across all of them, and Schedules gains the search its siblings already had. Secondary row actions appear on hover and focus rather than resting in the row. Two rows also stop nesting interactive controls: the skills row splits into sibling buttons under a focus-within ring, and the memory and prompt toggles render CheckboxGlyph inside their button rather than a second control. * fix(client): Keep the schedules quota and skeleton honest under filtering The footer counted the filtered list while the create limit is enforced against all schedules, so filtering made a full account look under quota. The skeleton reserved a switch, a menu and three text rows the flattened row no longer has, so the panel visibly collapsed on load; it now mirrors the healthy row. The skill file expander announced "Show files" even while expanded, so its label is now a neutral toggle. * fix(client): Restore schedule row actions and settle the panels' design debt A schedule row's actions sat in the hover-revealing slot other lists use, but this panel's rows end at the sidebar's resize handle and a slot collapsed to zero width put the switch's clickable point outside the panel, under the handle, where no hover could ever reveal it; the slot now keeps its width and the menu trigger fades in on row hover alone. The design-rule violations this branch had suppressed are paid instead: the tables drop restatements the Table primitives own and take a compact header size, FilterInput gains the dialog surface instead of a caller-side color, the projects entries move to the section-action variant, the MCP cancel cross fades via a wrapper the caller owns, and the panel group's backdrop moves to its host. The counts this branch had raised come back down with the entries pruned. * fix(client): Preserve Shared Row Actions and Verify Panel States * fix(client): Match Schedule Skeleton Action Height * fix(client): Preserve Panel Overflow and Schedule History Actions * refactor(client): Derive Row Action Classes From the Reveal Variant The reveal recipe was spelled out both in the row-action-reveal Button variant and in rowActionClasses. The helper now starts from the variant and only adds the open and always-visible states, and the MCP card spec asserts classes the real recipe renders instead of a mocked string. * fix(client): Announce Panel Filter Results and Usage Changes The schedule filter now reports its match count through a polite live region, as the prompt filter does. The memory usage badge keeps a status region beside its toggle so a changed usage is announced while focus is elsewhere, and the search count reads as a floor while more pages remain. * fix(client): Keep Row Focus Visible and Warn on Balance-Skipped Runs The row action slot clipped its overflow even while focus was inside it, cutting off the focused action's ring. It now clips only while collapsed. Skill rows drew one focus ring around the whole row, so moving between the open and disclosure buttons changed nothing on screen. Each button now draws its own ring. A run skipped for balance keeps its schedule enabled only until the skip count disables it, so the row now shows it as a warning instead of reading as healthy. * test(e2e): Match the always-applied skill row's full button name * refactor(client): Render MCP Row Actions Through the Button Primitive The MCP row actions passed a computed class string to TooltipAnchor, which the design rules cannot check, and the file carried a new static-classes suppression for it. They now render the shared Button with the row-action variants, like the bookmark and memory rows, and the suppression is gone. * fix(client): Paint Field Notches With the Page Surface and Respect IME Escape The marketplace, skills and prompts pages moved to the primary-alt surface, but the floating labels on their fields still painted the presentation surface, leaving a patch across each field's border in both themes. The labels now paint the surface they sit on. The create-skill name label is a plain label like the edit form's, since the Label primitive owns its color and a notch has to paint its own backdrop. Escape in the sidebar search cleared the query even while an IME was composing, where Escape only cancels the composition. * fix(client): Keep the Chat Column Within the Viewport Beside the Sidebar Moving the surface off ResizablePanelGroup put a new flex item around it with the default auto minimum width, so a reply with a wide table grew the chat column past the viewport and cut its right edge off. The host now allows itself to shrink, as the group did. Also covers the sidebar search's IME Escape guard with a unit test, since the search field is not mounted without a search backend. (cherry picked from commit 7d4a3f00fee59144ff79bbf04b06f63a96e1849b) Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16244 --- client/src/components/Agents/Marketplace.tsx | 4 +- client/src/components/Agents/SearchBar.tsx | 1 - client/src/components/Chat/ChatView.tsx | 4 +- client/src/components/Chat/Header.tsx | 2 +- .../Chat/Input/ConversationStarters.tsx | 2 +- .../Chat/Input/Files/Table/DataTable.tsx | 22 +- .../Chat/Messages/SearchButtons.tsx | 17 +- .../Chat/Messages/SearchMessage.tsx | 12 +- client/src/components/Chat/Presentation.tsx | 2 +- client/src/components/Chat/Trace/Viewer.tsx | 2 +- .../Conversations/Conversations.tsx | 6 +- .../ConvoOptions/ConvoOptions.tsx | 23 +- .../__tests__/ConvoOptions.archive.test.tsx | 1 + .../Conversations/PinnedSection.tsx | 4 +- .../Conversations/ProjectsSection.tsx | 55 +- .../__tests__/DateLabel.test.tsx | 11 +- .../src/components/Insights/InsightsView.tsx | 6 +- .../components/MCP/MCPServerStatusIcon.tsx | 34 +- client/src/components/Nav/SearchBar.tsx | 87 ++- .../src/components/Nav/Settings/Content.tsx | 6 +- .../src/components/Nav/Settings/Section.tsx | 9 +- .../Nav/__tests__/SearchBar.remount.spec.tsx | 44 ++ .../src/components/Projects/ProjectsView.tsx | 2 +- .../Prompts/buttons/AutoSendPrompt.tsx | 14 +- .../Prompts/buttons/CreatePromptButton.tsx | 4 +- .../src/components/Prompts/fields/Command.tsx | 12 +- .../components/Prompts/fields/Description.tsx | 12 +- .../Prompts/forms/CreatePromptForm.tsx | 2 +- .../Prompts/layouts/InlinePromptsView.tsx | 2 +- .../Prompts/lists/ChatGroupItem.tsx | 61 ++- .../src/components/Prompts/lists/ListCard.tsx | 2 +- .../Prompts/sidebar/FilterPrompts.tsx | 66 ++- .../Prompts/sidebar/GroupSidePanel.tsx | 8 +- .../Prompts/sidebar/PromptsAccordion.tsx | 5 +- .../SidePanel/Bookmarks/BookmarkCard.tsx | 30 +- .../Bookmarks/BookmarkCardActions.tsx | 26 +- .../Bookmarks/BookmarkCardSkeleton.tsx | 8 +- .../SidePanel/Bookmarks/BookmarkTable.tsx | 74 +-- .../components/SidePanel/Files/PanelTable.tsx | 13 +- .../SidePanel/MCPBuilder/MCPBuilderPanel.tsx | 42 +- .../MCPBuilder/MCPCardActions.spec.tsx | 15 +- .../SidePanel/MCPBuilder/MCPCardActions.tsx | 189 ++++--- .../SidePanel/MCPBuilder/MCPServerCard.tsx | 3 +- .../MCPBuilder/MCPServerCardSkeleton.tsx | 5 +- .../MCPServerDialog/sections/AuthSection.tsx | 18 +- .../MCPServerDialog/sections/TrustSection.tsx | 14 +- .../SidePanel/MCPBuilder/MCPServerList.tsx | 27 +- .../SidePanel/MCPBuilder/MCPStatusBadge.tsx | 7 +- .../SidePanel/Memories/MemoryCard.tsx | 23 +- .../SidePanel/Memories/MemoryCardActions.tsx | 38 +- .../SidePanel/Memories/MemoryCardSkeleton.tsx | 4 +- .../SidePanel/Memories/MemoryCreateDialog.tsx | 6 +- .../SidePanel/Memories/MemoryEditDialog.tsx | 34 +- .../SidePanel/Memories/MemoryPanel.tsx | 59 +-- .../SidePanel/Memories/MemoryUsageBadge.tsx | 59 ++- .../__tests__/MemoryUsageBadge.spec.tsx | 19 + .../SidePanel/Schedules/ScheduleCard.tsx | 282 ++++++---- .../Schedules/ScheduleCardSkeleton.tsx | 29 +- .../Schedules/ScheduleEmptyState.tsx | 6 + .../SidePanel/Schedules/SchedulePanel.tsx | 72 ++- .../Schedules/__tests__/state.spec.ts | 100 ++++ .../components/SidePanel/Schedules/state.ts | 54 ++ .../components/SidePanel/SidePanelGroup.tsx | 40 +- .../Skills/buttons/CreateSkillMenu.tsx | 2 +- .../Skills/forms/CreateSkillForm.tsx | 6 +- .../src/components/Skills/forms/SkillForm.tsx | 2 +- .../components/Skills/layouts/SkillsView.tsx | 16 +- .../components/Skills/lists/SkillListItem.tsx | 61 ++- .../Skills/sidebar/FilterSkills.tsx | 33 +- .../Skills/sidebar/SkillsSidePanel.tsx | 8 +- .../src/components/UnifiedSidebar/Sidebar.tsx | 11 +- client/src/components/ui/PanelContent.tsx | 39 +- client/src/components/ui/PanelHeader.tsx | 48 ++ .../ui/__tests__/PanelContent.spec.tsx | 90 +++- client/src/components/ui/index.ts | 1 + client/src/hooks/index.ts | 1 + client/src/hooks/useScrollFade.ts | 82 +++ client/src/locales/en/translation.json | 60 +-- client/src/routes/Search.tsx | 43 +- client/src/routes/__tests__/Search.spec.tsx | 42 +- client/src/style.css | 11 +- client/src/utils/index.ts | 1 + client/src/utils/row.ts | 52 ++ .../scenarios/empty-prompts-panel.spec.ts | 6 +- .../mock/scenarios/page-surfaces.spec.ts | 73 +++ e2e/specs/mock/scenarios/panels.ts | 19 + .../mock/scenarios/quieter-panels.spec.ts | 501 ++++++++++++++++++ eslint-suppressions.json | 46 +- packages/client/src/components/Accordion.tsx | 6 +- packages/client/src/components/Button.tsx | 14 +- packages/client/src/components/Checkbox.tsx | 26 +- packages/client/src/components/Dialog.tsx | 8 +- packages/client/src/components/EmptyState.tsx | 26 +- .../client/src/components/FilterInput.tsx | 21 +- packages/client/src/components/Table.tsx | 81 +-- packages/client/src/components/Tabs.tsx | 2 +- packages/client/src/theme/themes/dark.ts | 6 +- packages/client/src/utils/composer.ts | 7 +- 98 files changed, 2302 insertions(+), 989 deletions(-) create mode 100644 client/src/components/SidePanel/Memories/__tests__/MemoryUsageBadge.spec.tsx create mode 100644 client/src/components/SidePanel/Schedules/__tests__/state.spec.ts create mode 100644 client/src/components/SidePanel/Schedules/state.ts create mode 100644 client/src/components/ui/PanelHeader.tsx create mode 100644 client/src/hooks/useScrollFade.ts create mode 100644 client/src/utils/row.ts create mode 100644 e2e/specs/mock/scenarios/page-surfaces.spec.ts create mode 100644 e2e/specs/mock/scenarios/panels.ts create mode 100644 e2e/specs/mock/scenarios/quieter-panels.spec.ts 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', );