From b8158a613ea59f176e07e3f971945deeda37bbdf Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Thu, 9 Apr 2026 06:02:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=8E=A8=20refactor:?= =?UTF-8?q?=20Prompts/Sidebar=20styles=20for=20improved=20UI=20Consistency?= =?UTF-8?q?=20(#12426)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * style(sidebar): polish button styles, icon sizes, and nav separator - Match new chat button style to sidebar toggle - Unify icon sizes and stroke weights across sidebar icons - Add separator between new chat and nav links feat(prompts): inline prompt editing with route-based navigation - Show prompts dashboard inline when editing/creating from chat - Use route-based navigation instead of state-driven view switching - Strip inline view to form-only without duplicate sidebar style(prompts): unify borders, backgrounds, and admin controls - Unify borders to border-medium and remove opaque backgrounds - Add admin/advanced controls to sidebar - Match chat background, move advanced toggle to versions panel refactor(prompts): consolidate list actions into dropdown with compact layout - Unify prompt list to single ChatGroupItem with all actions - Consolidate actions into dropdown menu - Distinct dropdown icons with status icon tooltips - Remove rename action, use Trash icon matching convo items refactor(prompts): inline-edit title with click-to-edit and save indicator - Click title text to enter edit mode with pencil icon on hover - Clean title input with inline save status indicator - Uniform h-9 header height, smaller title, icon-only save status - Remove separate edit icon button and confirm/cancel controls style(prompts): sticky click-to-edit pill with surface-primary background fix: preserve AuthContext identity across Vite HMR updates createContext() was re-executed on every HMR module replacement, creating a new context object that disconnected the existing provider from its consumers. useAuthContext() would throw because useContext(newContext) returned undefined while the provider was still on the old context. Stash the context object in import.meta.hot.data so it survives HMR re-execution. Dead-code-eliminated in production builds. feat: add advanced prompts editor toggle to Chat settings - Add AdvancedPrompts switch in Settings > Chat that maps the promptsEditorMode enum (simple/advanced) to a boolean toggle - Preserve existing behavior: switching to simple forces alwaysMakeProd - Add focus styling to PromptName input (border-medium on focus, outline on focus-visible, no ring) - Add localization keys: com_nav_advanced_prompts, com_nav_advanced_prompts_desc - Various Prompts UI refinements style(sidebar): update nav icons and reorder links for clarity - Prompts: MessageSquareQuote → NotebookPen (distinct from chat bubble) - Agent Builder: Blocks → Bot (no longer identical to Assistants) - Memories: Database → BrainCircuit (brain + AI circuit) - Parameters: Settings2 → SlidersHorizontal (tuning-specific) - Reorder: Chat → Prompts → Agents → Assistants → Memories → Bookmarks → Files → Parameters → MCP (frequency and grouping) refactor(prompts): remove AdvancedSwitch component The simple/advanced toggle is now in Settings > Chat, making the standalone AdvancedSwitch redundant. Remove the component, its barrel exports, and all render sites (PromptForm, DashBreadcrumb, PromptsView). style(prompts): tighten panel layout and spacing to match sidebar conventions - Remove top margin from form wrapper, add mt-2 to header row - Reduce header gaps and remove flex-wrap for tighter alignment - Shrink prompt title from text-lg/h-9 to text-base/h-8 - Add pl-2 inner padding to PromptName input and static button - Compact versions panel and deploy button container padding - Reduce editor header and content spacing - Compact mobile versions panel header fix(prompts): rebuild mobile versions panel with proper transitions - Add background (bg-surface-primary-alt) and border-l so content doesn't bleed through - Replace conditional render with CSS opacity/translate so both overlay fade-out and panel slide-out animate on close - Use inert attribute to disable focus when panel is hidden - Replace raw × character with X icon from lucide-react - Use size-icon button variant for close instead of text sm - Use Tailwind classes (w-80, translate-x-full) instead of inline style object for width and transform - Remove unused sidePanelWidth constant - Overlay stays in DOM with pointer-events-none when hidden chore: remove stale tooling artifacts Remove .bg-shell/manifest.json and .gsd symlink that were accidentally committed — these are local dev tooling files. fix: resolve review issues in PromptName and ChatGroupItem - Fix Escape/onBlur race in PromptName via cancelledRef guard - Clear existing timer before creating new one to prevent status flicker - Guard delete mutation against empty group id - Attach menuButtonRef to MenuButton for proper focus restoration after preview dialog closes fix: address review findings across prompts UI and sidebar PromptName: - Fix Enter key double-save: set skipBlurRef before inline save to prevent onBlur from re-firing saveName on input unmount - Add isError prop to distinguish mutation failure from success, preventing false 'saved' checkmark on error - Remove dead cn ternary that always evaluated to opacity-100 - Remove unused cn import PromptForm: - Pass isError from updateGroupMutation to PromptName - Remove dead default arg (= {}) on function component ChatGroupItem: - Stabilize handleDelete via ref pattern to prevent memo-defeating recreation on every render (deleteGroup is a new ref each render) - Disable delete button during mutation to prevent double-fire ExpandedPanel: - Restore element for NewChatButton to fix middle-click (open in new tab) regression caused by anchor-to-button migration DashGroupItem: - Delete dead file (no longer exported or imported anywhere) fix: address review findings across prompts UI and sidebar - PromptName: render error state (red X) when save fails, extract shared commitName helper to deduplicate blur/Enter save paths - ChatGroupItem: navigate away after deleting the active prompt in sidebar view; use context-aware route prefix (/prompts vs /d/prompts) for edit and card-click navigation - InlinePromptsView: redirect to /c/new when user lacks prompts access instead of rendering a blank screen - Remove dead ManagePrompts component and its barrel exports (no remaining consumers after GroupSidePanel cleanup) fix: remove duplicate showThinking Recoil atom key The 'showThinking' key was defined in both store/settings.ts (Recoil) and store/showThinking.ts (Jotai). Only the Jotai atom is consumed; the stale Recoil duplicate causes 'A key option with a unique string value must be provided' at startup. refactor: remove /d/prompts dashboard route and dead code The prompts UI now lives at /prompts/* inline under the chat layout. The old /d/prompts/* dashboard route, its layout (PromptsView), and its breadcrumb (DashBreadcrumb) are no longer used. - Delete PromptsView and DashBreadcrumb (zero consumers) - Delete BackToChat button (zero consumers) - Replace /d/prompts/* child routes with a redirect to /prompts/new - Add /prompts index route that redirects to /prompts/new - Update all /d/prompts navigation to /prompts: - ChatGroupItem: always use /prompts prefix - NoPromptGroup: navigate to /prompts - CreatePromptForm: fallback navigate to /prompts/:id - CreatePromptButton: simplified to /prompts/new (no dual-path) - Strip GroupSidePanel of dashboard-only breadcrumb nav, recoil state clearing, and useDashboardContext dependency refactor: remove dead Dashboard code and unused translation keys - Delete DashboardContext provider (zero remaining consumers) - Simplify DashboardRoute layout to a plain Outlet - Remove commented-out file/vector-store route blocks - Change catch-all redirect from /d/files to /c/new - Remove 7 unused translation keys (com_nav_toggle_sidebar, com_ui_back_to_chat, com_ui_dashboard, com_ui_delete_prompt_name, com_ui_global_group, com_ui_prompt_renamed, com_ui_rename_prompt, com_ui_rename_prompt_name) fix: add Babel plugin to transform import.meta.hot for Jest `babel-plugin-transform-import-meta` handles standard properties (url, filename, dirname, resolve) but not Vite's `hot` property. Jest runs in CommonJS where `import.meta` is unavailable, so `import.meta.hot` in AuthContext.tsx (added for HMR preservation) causes a SyntaxError that breaks 27 test suites. Add a small Babel plugin that replaces `import.meta.hot` with `undefined` during Jest transforms, making the HMR guard blocks dead-code in tests. fix: address review findings — inert typing, accessibility, and cleanup - Add React type augmentation for `inert` attribute (React 18 compat) - Replace spread hack `{...{ inert: }}` with direct prop in all 3 files - Add `aria-hidden` to mobile overlay in PromptForm for screen readers - Simplify deleteGroupRef pattern to direct mutation call - Remove unused `useEffect` import and stale useMemo dependency - Add clarifying comment for skipBlurRef mechanism in PromptName fix: mobile UX for marketplace and prompts views - Remove mobile new chat button from chat history section - Add OpenSidebar entry points to marketplace and prompts views on mobile - Move marketplace admin settings to a compact mobile top row - Restructure prompt forms to surface category selector beside sidebar toggle - Make versions panel slide content like the main sidebar and drop redundant borders - Collapse versions button to icon-only on mobile - Remove theme selector from prompt panel navigation * fix: address PR review findings for prompts refactor - Preserve prompt ID in /d/prompts/:id → /prompts/:id redirect - Gate PreviewPrompt and VariableDialog behind isChatRoute to avoid mounting dead dialogs in dashboard mode - Add onError handler to useDeletePromptGroup and close dialog on success - Use useId() instead of hardcoded labelId in AdvancedPrompts - Extract shared lazy loader for InlinePromptsView routes * fix: complete review fixes for prompts refactor - Move OGDialog (delete) inside isChatRoute gate with other dialogs - Use useId() for both Switch id and label id in AdvancedPrompts - Add com_ui_prompt_delete_error i18n key for actionable error context - Drop no-op useCallback on handleDelete (unstable deleteGroup dep) * refactor: hoist promptPath to module-scope constant Eliminates stale-closure lint concern in dropdownItems useMemo and removes the unnecessary dep array entry from onCardClick. * refactor(sidebar): update icons and reorder links for clarity - Replace Blocks icon with OpenAIMinimalIcon for the Assistant Builder link. - Update Memories icon from BrainCircuit to Brain. - Reintroduce Prompts link conditionally based on access permissions. - Change Conversations icon from MessageSquare to MessagesSquare for consistency. * refactor(sidebar): update icons and improve file attachment link - Replace NewChatIcon with SquarePen in the NewChatButton for better visual consistency. - Change AttachmentIcon to Paperclip in the file attachment link for clarity. * refactor(sidebar): update file attachment icon for consistency - Replace Paperclip icon with AttachmentIcon in the file attachment link for improved clarity and visual consistency. * refactor(admin-settings): remove unused button and streamline dialog integration - Eliminate the Admin button and its associated icon from the AdminSettings component for a cleaner interface. - Simplify the confirm dialog integration by directly using the OGDialog without the button trigger. * fix: context HMR issue * style(prompts): enhance component structure and accessibility - Update AutoSendPrompt button class for improved styling. - Refactor List component to streamline loading and empty states. - Ensure FilterPrompts handles context gracefully with null checks. - Modify GroupSidePanel to prevent rendering without context. - Simplify PromptsAccordion layout for better readability. - Adjust CategoryIcon fallback behavior for undefined categories. * refactor(useMCPServerManager): clean up import statements - Remove duplicate import of MCPServerInitState for better clarity and organization. - Adjust import order to maintain consistency with project structure. * refactor(GroupSidePanel): restructure layout for improved readability and accessibility - Adjust the structure of the GroupSidePanel component to enhance layout clarity. - Move the PanelNavigation component into a more appropriate position within the hierarchy. - Ensure consistent styling and behavior based on the isChatRoute condition. * style(GroupSidePanel): adjust padding for improved layout consistency - Update padding in the GroupSidePanel component to enhance visual alignment and readability. - Ensure consistent styling across the component for a better user experience. * fix(Conversations): add cache clearing and row height recomputation on search query change - Implement useEffect to clear cache and recompute row heights when the search query changes. - Enhance performance and responsiveness of the Conversations component during search operations. * refactor(GroupSidePanel, PromptsAccordion): simplify layout and improve styling * chore: import order * fix: redirect users without CREATE permission from /prompts/new Users with USE but not CREATE permission were seeing a blank page at /prompts/new because InlinePromptsView only checked USE access. CreatePromptForm's internal redirect was bypassed by the onSuccess prop always being passed. Add CREATE check in InlinePromptsView so the redirect happens before CreatePromptForm mounts. * fix: restore dropdown actions for all routes and handle non-creator landing - Remove isChatRoute gate on dropdown menu so preview, edit, and delete actions are available on the prompts management route - Un-gate PreviewPrompt and OGDialog (delete) since both are triggered from the now-always-visible dropdown - Keep VariableDialog gated behind isChatRoute (chat submission only) - Show EmptyPromptPreview for non-creators at /prompts/new instead of redirecting to /c/new, so they stay in the prompts section with sidebar access to browse existing prompts * fix: add isPublic to TPromptGroup type The database schema (IPromptGroup in data-schemas) has isPublic but the shared TPromptGroup type in data-provider was missing it, causing a TS2339 error in ChatGroupItem. * fix: prevent duplicate rename and restore name on error in PromptName - Block re-entry to edit mode while a save is in flight by guarding the click handler with isLoading/saveStatus checks - Reset newName to the prop value when mutation fails so the UI doesn't display the unsaved name after the error icon clears * fix: address review findings across prompts refactor - Consolidate duplicate usePromptGroupsContext() calls in PromptForm - Remove invalid aria-labelledby (text string, not ID) from AutoSendPrompt checkbox that is already aria-hidden - Remove useMemo wrapping trivial `disabled ?? false` in ToolsDropdown - Remove dead context spread in PromptsAccordion (GroupSidePanel reads context internally) - Wrap search cache-clear effect in requestAnimationFrame to match favorites effect pattern in Conversations - Use Set for O(1) lookups in MCPSelect server filtering - Fix unnecessary JSX expression wrapper on string literal in CreatePromptButton Link * style(PromptTextCard): update icon classes for improved accessibility - Add 'text-text-secondary' class to Check and Copy icons for better visibility and consistency in the PromptTextCard component. --------- Co-authored-by: Danny Avila --- client/babel.config.cjs | 1 + client/src/Providers/BadgeRowContext.tsx | 6 +- client/src/Providers/DashboardContext.tsx | 7 - client/src/Providers/DragDropContext.tsx | 14 +- client/src/Providers/PromptGroupsContext.tsx | 6 +- client/src/Providers/index.ts | 1 - client/src/components/Agents/Marketplace.tsx | 14 +- .../Agents/MarketplaceAdminSettings.tsx | 13 +- .../src/components/Chat/Input/Artifacts.tsx | 7 +- .../components/Chat/Input/CodeInterpreter.tsx | 6 +- .../src/components/Chat/Input/FileSearch.tsx | 4 +- .../src/components/Chat/Input/MCPSelect.tsx | 56 ++-- .../src/components/Chat/Input/MCPSubMenu.tsx | 32 +- .../components/Chat/Input/PromptsCommand.tsx | 5 +- .../src/components/Chat/Input/ToolDialogs.tsx | 22 +- .../components/Chat/Input/ToolsDropdown.tsx | 109 +++---- .../src/components/Chat/Input/WebSearch.tsx | 12 +- .../Conversations/Conversations.tsx | 10 + .../Nav/SettingsTabs/Chat/AdvancedPrompts.tsx | 46 +++ .../components/Nav/SettingsTabs/Chat/Chat.tsx | 4 + .../Prompts/buttons/AdminSettings.tsx | 16 +- .../Prompts/buttons/AdvancedSwitch.tsx | 52 --- .../Prompts/buttons/AutoSendPrompt.tsx | 4 +- .../components/Prompts/buttons/BackToChat.tsx | 33 -- .../Prompts/buttons/CreatePromptButton.tsx | 2 +- .../Prompts/buttons/ManagePrompts.tsx | 32 -- .../src/components/Prompts/buttons/index.ts | 3 - .../Prompts/dialogs/DeletePrompt.tsx | 3 +- .../Prompts/dialogs/SharePrompt.tsx | 3 +- .../Prompts/display/PromptDetails.tsx | 2 +- .../Prompts/display/PromptTextCard.tsx | 8 +- .../Prompts/display/PromptVariables.tsx | 12 +- .../Prompts/display/PromptVersions.tsx | 6 +- .../Prompts/editor/PromptEditor.tsx | 14 +- .../Prompts/fields/CategorySelector.tsx | 4 +- .../src/components/Prompts/fields/Command.tsx | 4 +- .../components/Prompts/fields/Description.tsx | 4 +- .../components/Prompts/fields/PromptName.tsx | 196 ++++++----- .../Prompts/forms/CreatePromptForm.tsx | 32 +- .../components/Prompts/forms/PromptForm.tsx | 160 ++++----- .../Prompts/forms/PromptLabelsForm.tsx | 4 +- client/src/components/Prompts/index.ts | 20 +- .../Prompts/layouts/InlinePromptsView.tsx | 48 +++ .../Prompts/layouts/PromptsView.tsx | 140 -------- .../src/components/Prompts/layouts/index.ts | 2 +- .../Prompts/lists/ChatGroupItem.tsx | 303 ++++++++++++------ .../Prompts/lists/DashGroupItem.tsx | 223 ------------- client/src/components/Prompts/lists/List.tsx | 71 ++-- .../Prompts/lists/NoPromptGroup.tsx | 2 +- client/src/components/Prompts/lists/index.ts | 1 - .../Prompts/sidebar/FilterPrompts.tsx | 5 +- .../Prompts/sidebar/GroupSidePanel.tsx | 98 ++---- .../Prompts/sidebar/PanelNavigation.tsx | 8 +- .../Prompts/sidebar/PromptsAccordion.tsx | 22 +- .../components/Prompts/utils/CategoryIcon.tsx | 15 +- .../UnifiedSidebar/ConversationsSection.tsx | 36 +-- .../UnifiedSidebar/ExpandedPanel.tsx | 21 +- .../UnifiedSidebar/UnifiedSidebar.tsx | 2 +- client/src/hooks/AuthContext.tsx | 6 +- client/src/hooks/MCP/useMCPServerManager.ts | 2 +- client/src/hooks/Nav/useSideNavLinks.ts | 78 +++-- .../src/hooks/Nav/useUnifiedSidebarLinks.ts | 4 +- client/src/locales/en/translation.json | 11 +- client/src/routes/Dashboard.tsx | 75 +---- client/src/routes/Layouts/DashBreadcrumb.tsx | 104 ------ client/src/routes/Layouts/Dashboard.tsx | 28 +- client/src/routes/Root.tsx | 2 +- client/src/routes/index.tsx | 17 + client/src/store/settings.ts | 1 - ...babel-plugin-transform-import-meta-hot.cjs | 31 ++ packages/client/src/svgs/MCPIcon.tsx | 6 +- packages/data-provider/src/types.ts | 1 + 72 files changed, 936 insertions(+), 1416 deletions(-) delete mode 100644 client/src/Providers/DashboardContext.tsx create mode 100644 client/src/components/Nav/SettingsTabs/Chat/AdvancedPrompts.tsx delete mode 100644 client/src/components/Prompts/buttons/AdvancedSwitch.tsx delete mode 100644 client/src/components/Prompts/buttons/BackToChat.tsx delete mode 100644 client/src/components/Prompts/buttons/ManagePrompts.tsx create mode 100644 client/src/components/Prompts/layouts/InlinePromptsView.tsx delete mode 100644 client/src/components/Prompts/layouts/PromptsView.tsx delete mode 100644 client/src/components/Prompts/lists/DashGroupItem.tsx delete mode 100644 client/src/routes/Layouts/DashBreadcrumb.tsx create mode 100644 client/test/babel-plugin-transform-import-meta-hot.cjs diff --git a/client/babel.config.cjs b/client/babel.config.cjs index 44b0501a61..270f18f1a0 100644 --- a/client/babel.config.cjs +++ b/client/babel.config.cjs @@ -14,6 +14,7 @@ module.exports = { */ plugins: [ '@babel/plugin-transform-runtime', + './test/babel-plugin-transform-import-meta-hot.cjs', 'babel-plugin-transform-import-meta', 'babel-plugin-transform-vite-meta-env', 'babel-plugin-replace-ts-export-assignment', diff --git a/client/src/Providers/BadgeRowContext.tsx b/client/src/Providers/BadgeRowContext.tsx index dce1c38a78..1bedcec66f 100644 --- a/client/src/Providers/BadgeRowContext.tsx +++ b/client/src/Providers/BadgeRowContext.tsx @@ -29,11 +29,7 @@ interface BadgeRowContextType { const BadgeRowContext = createContext(undefined); export function useBadgeRowContext() { - const context = useContext(BadgeRowContext); - if (context === undefined) { - throw new Error('useBadgeRowContext must be used within a BadgeRowProvider'); - } - return context; + return useContext(BadgeRowContext); } interface BadgeRowProviderProps { diff --git a/client/src/Providers/DashboardContext.tsx b/client/src/Providers/DashboardContext.tsx deleted file mode 100644 index f33a240d00..0000000000 --- a/client/src/Providers/DashboardContext.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { createContext, useContext } from 'react'; -type TDashboardContext = { - prevLocationPath: string; -}; - -export const DashboardContext = createContext({} as TDashboardContext); -export const useDashboardContext = () => useContext(DashboardContext); diff --git a/client/src/Providers/DragDropContext.tsx b/client/src/Providers/DragDropContext.tsx index b519c0171f..ed4dddb58f 100644 --- a/client/src/Providers/DragDropContext.tsx +++ b/client/src/Providers/DragDropContext.tsx @@ -83,10 +83,14 @@ export function DragDropProvider({ children }: { children: React.ReactNode }) { return {children}; } +const defaultDragDropValue: DragDropContextValue = { + conversationId: undefined, + agentId: undefined, + endpoint: undefined, + endpointType: undefined, + useResponsesApi: undefined, +}; + export function useDragDropContext() { - const context = useContext(DragDropContext); - if (!context) { - throw new Error('useDragDropContext must be used within DragDropProvider'); - } - return context; + return useContext(DragDropContext) ?? defaultDragDropValue; } diff --git a/client/src/Providers/PromptGroupsContext.tsx b/client/src/Providers/PromptGroupsContext.tsx index 3df373b165..147d2bc336 100644 --- a/client/src/Providers/PromptGroupsContext.tsx +++ b/client/src/Providers/PromptGroupsContext.tsx @@ -77,9 +77,5 @@ export const PromptGroupsProvider = ({ children }: { children: ReactNode }) => { }; export const usePromptGroupsContext = () => { - const context = useContext(PromptGroupsContext); - if (!context) { - throw new Error('usePromptGroupsContext must be used within a PromptGroupsProvider'); - } - return context; + return useContext(PromptGroupsContext); }; diff --git a/client/src/Providers/index.ts b/client/src/Providers/index.ts index 3ae90e189c..aac5fccc21 100644 --- a/client/src/Providers/index.ts +++ b/client/src/Providers/index.ts @@ -10,7 +10,6 @@ export * from './EditorContext'; export * from './ChatFormContext'; export * from './BookmarkContext'; export * from './MessageContext'; -export * from './DashboardContext'; export * from './AssistantsContext'; export * from './AgentsContext'; export * from './AssistantsMapContext'; diff --git a/client/src/components/Agents/Marketplace.tsx b/client/src/components/Agents/Marketplace.tsx index 816705a0db..adf406f7b0 100644 --- a/client/src/components/Agents/Marketplace.tsx +++ b/client/src/components/Agents/Marketplace.tsx @@ -1,11 +1,12 @@ import React, { useState, useEffect, useMemo, useRef, useCallback } from 'react'; -import { useSearchParams, useParams, useNavigate } from 'react-router-dom'; import { useMediaQuery } from '@librechat/client'; import { PermissionTypes, Permissions } from 'librechat-data-provider'; +import { useSearchParams, useParams, useNavigate } from 'react-router-dom'; import type t from 'librechat-data-provider'; import { useDocumentTitle, useHasAccess, useLocalize, TranslationKeys } from '~/hooks'; import { useGetEndpointsQuery, useGetAgentCategoriesQuery } from '~/data-provider'; import MarketplaceAdminSettings from './MarketplaceAdminSettings'; +import OpenSidebar from '~/components/Chat/Menus/OpenSidebar'; import { SidePanelGroup } from '~/components/SidePanel'; import CategoryTabs from './CategoryTabs'; import SearchBar from './SearchBar'; @@ -215,14 +216,19 @@ const AgentMarketplace: React.FC = ({ className = '' }) = )} {/* Sticky wrapper for search bar and categories */} -
+
+
+ + +
{/* Search bar */}
{/* TODO: Remove this once we have a better way to handle admin settings */} - {/* Admin Settings */} - +
+ +
{/* Category tabs */} diff --git a/client/src/components/Agents/MarketplaceAdminSettings.tsx b/client/src/components/Agents/MarketplaceAdminSettings.tsx index c3d7dedda3..be62064aaf 100644 --- a/client/src/components/Agents/MarketplaceAdminSettings.tsx +++ b/client/src/components/Agents/MarketplaceAdminSettings.tsx @@ -10,7 +10,7 @@ const permissions: PermissionConfig[] = [ { permission: Permissions.USE, labelKey: 'com_ui_marketplace_allow_use' }, ]; -const MarketplaceAdminSettings = () => { +const MarketplaceAdminSettings = ({ compact = false }: { compact?: boolean }) => { const localize = useLocalize(); const { showToast } = useToastContext(); @@ -23,7 +23,16 @@ const MarketplaceAdminSettings = () => { }, }); - const trigger = ( + const trigger = compact ? ( + + ) : (
))} +
+ +
); diff --git a/client/src/components/Prompts/buttons/AdminSettings.tsx b/client/src/components/Prompts/buttons/AdminSettings.tsx index 25e6df05a8..7168217694 100644 --- a/client/src/components/Prompts/buttons/AdminSettings.tsx +++ b/client/src/components/Prompts/buttons/AdminSettings.tsx @@ -1,7 +1,6 @@ import { useState } from 'react'; -import { ShieldEllipsis } from 'lucide-react'; import { Permissions, PermissionTypes } from 'librechat-data-provider'; -import { OGDialog, OGDialogTemplate, Button, useToastContext } from '@librechat/client'; +import { OGDialog, OGDialogTemplate, useToastContext } from '@librechat/client'; import type { PermissionConfig } from '~/components/ui'; import { useUpdatePromptPermissionsMutation } from '~/data-provider'; import { AdminSettingsDialog } from '~/components/ui'; @@ -39,18 +38,6 @@ const AdminSettings = () => { setConfirmAdminUseChange({ newValue, callback: onChange }); }; - const trigger = ( - - ); - const confirmDialog = ( { permissions={permissions} menuId="prompt-role-dropdown" mutation={mutation} - trigger={trigger} onPermissionConfirm={handlePermissionConfirm} confirmPermissions={[Permissions.USE]} extraContent={confirmDialog} diff --git a/client/src/components/Prompts/buttons/AdvancedSwitch.tsx b/client/src/components/Prompts/buttons/AdvancedSwitch.tsx deleted file mode 100644 index 9941c78e66..0000000000 --- a/client/src/components/Prompts/buttons/AdvancedSwitch.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { useCallback, useMemo } from 'react'; -import { Sparkles, Layers } from 'lucide-react'; -import { useRecoilState, useSetRecoilState } from 'recoil'; -import { PromptsEditorMode } from '~/common'; -import { Radio } from '@librechat/client'; -import { useLocalize } from '~/hooks'; -import store from '~/store'; - -const { promptsEditorMode, alwaysMakeProd } = store; - -const AdvancedSwitch = () => { - const localize = useLocalize(); - const [mode, setMode] = useRecoilState(promptsEditorMode); - const setAlwaysMakeProd = useSetRecoilState(alwaysMakeProd); - - const options = useMemo( - () => [ - { - value: PromptsEditorMode.SIMPLE, - label: localize('com_ui_simple'), - icon: , - }, - { - value: PromptsEditorMode.ADVANCED, - label: localize('com_ui_advanced'), - icon: , - }, - ], - [localize], - ); - - const handleChange = useCallback( - (value: string) => { - if (value === PromptsEditorMode.SIMPLE) { - setAlwaysMakeProd(true); - } - setMode(value as PromptsEditorMode); - }, - [setMode, setAlwaysMakeProd], - ); - - return ( - - ); -}; - -export default AdvancedSwitch; diff --git a/client/src/components/Prompts/buttons/AutoSendPrompt.tsx b/client/src/components/Prompts/buttons/AutoSendPrompt.tsx index c2ebee70c5..759c33739e 100644 --- a/client/src/components/Prompts/buttons/AutoSendPrompt.tsx +++ b/client/src/components/Prompts/buttons/AutoSendPrompt.tsx @@ -25,13 +25,13 @@ export default function AutoSendPrompt({ onClick={() => handleCheckedChange(!autoSendPrompts)} aria-label={localize('com_nav_auto_send_prompts')} aria-pressed={autoSendPrompts} - className={autoSendPrompts ? 'bg-surface-hover hover:bg-surface-hover' : ''} + className={`relative h-9 w-full gap-2 rounded-lg border-border-light font-medium ${autoSendPrompts ? 'bg-surface-hover hover:bg-surface-hover' : ''}`} >
- - ); -} diff --git a/client/src/components/Prompts/buttons/CreatePromptButton.tsx b/client/src/components/Prompts/buttons/CreatePromptButton.tsx index 016721d509..13dd20b11f 100644 --- a/client/src/components/Prompts/buttons/CreatePromptButton.tsx +++ b/client/src/components/Prompts/buttons/CreatePromptButton.tsx @@ -27,7 +27,7 @@ export default function CreatePromptButton() { className="size-9 shrink-0 bg-transparent" aria-label={localize('com_ui_create_prompt')} > - +