Skip to content

Commit

Permalink
🔧 fix: Streamline Builder Links and Enhance UI Consistency (#5229)
Browse files Browse the repository at this point in the history
* fix: Include iconURL in Bedrock client initialization

* fix: unnecessary filtering for agent file_search files

* chore: use theme bg colors

* refactor: rely on endpoint config for enabling builder links in side navigation instead of parameters

* fix: remove unnecessary keyProvided check for agent builder link
  • Loading branch information
danny-avila authored Jan 9, 2025
1 parent dd92758 commit 687ab32
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
1 change: 1 addition & 0 deletions api/server/services/Endpoints/bedrock/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const initializeClient = async ({ req, res, endpointOption }) => {
eventHandlers,
collectedUsage,
spec: endpointOption.spec,
iconURL: endpointOption.iconURL,
endpoint: EModelEndpoint.bedrock,
resendFiles: endpointOption.resendFiles,
maxContextTokens:
Expand Down
22 changes: 9 additions & 13 deletions client/src/components/SidePanel/Agents/FileSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
EToolResources,
mergeFileConfig,
AgentCapabilities,
retrievalMimeTypes,
fileConfig as defaultFileConfig,
} from 'librechat-data-provider';
import type { ExtendedFile, AgentForm } from '~/common';
Expand Down Expand Up @@ -77,6 +76,15 @@ export default function FileSearch({
</div>
<FileSearchCheckbox />
<div className="flex flex-col gap-3">
{/* File Search (RAG API) Files */}
<FileRow
files={files}
setFiles={setFiles}
setFilesLoading={setFilesLoading}
agent_id={agent_id}
tool_resource={EToolResources.file_search}
Wrapper={({ children }) => <div className="flex flex-wrap gap-2">{children}</div>}
/>
<div>
<button
type="button"
Expand Down Expand Up @@ -105,18 +113,6 @@ export default function FileSearch({
{localize('com_agents_file_search_disabled')}
</div>
)}
{/* Knowledge Files */}
<FileRow
files={files}
setFiles={setFiles}
setFilesLoading={setFilesLoading}
agent_id={agent_id}
tool_resource={EToolResources.file_search}
fileFilter={(file: ExtendedFile) =>
retrievalMimeTypes.some((regex) => regex.test(file.type ?? ''))
}
Wrapper={({ children }) => <div className="flex flex-wrap gap-2">{children}</div>}
/>
</div>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/SidePanel/SidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const SidePanel = ({
<ResizablePanelGroup
direction="horizontal"
onLayout={(sizes) => throttledSaveLayout(sizes)}
className="transition-width relative h-full w-full flex-1 overflow-auto bg-white dark:bg-gray-800"
className="transition-width relative h-full w-full flex-1 overflow-auto bg-presentation"
>
<ResizablePanel
defaultSize={currentLayout[0]}
Expand All @@ -195,7 +195,7 @@ const SidePanel = ({
</ResizablePanel>
{artifacts != null && (
<>
<ResizableHandleAlt withHandle className="ml-3 bg-border-medium dark:text-white" />
<ResizableHandleAlt withHandle className="ml-3 bg-border-medium text-text-primary" />
<ResizablePanel
defaultSize={currentLayout[1]}
minSize={minSizeMain}
Expand Down Expand Up @@ -227,7 +227,7 @@ const SidePanel = ({
/>
</div>
{(!isCollapsed || minSize > 0) && !isSmallScreen && !fullCollapse && (
<ResizableHandleAlt withHandle className="bg-transparent dark:text-white" />
<ResizableHandleAlt withHandle className="bg-transparent text-text-primary" />
)}
<ResizablePanel
tagName="nav"
Expand Down
7 changes: 2 additions & 5 deletions client/src/hooks/Nav/useSideNavLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ export default function useSideNavLinks({
isAssistantsEndpoint(endpoint) &&
assistants &&
assistants.disableBuilder !== true &&
keyProvided &&
interfaceConfig.parameters === true
keyProvided
) {
links.push({
title: 'com_sidepanel_assistant_builder',
Expand All @@ -76,9 +75,7 @@ export default function useSideNavLinks({
hasAccessToCreateAgents &&
isAgentsEndpoint(endpoint) &&
agents &&
agents.disableBuilder !== true &&
keyProvided &&
interfaceConfig.parameters === true
agents.disableBuilder !== true
) {
links.push({
title: 'com_sidepanel_agent_builder',
Expand Down

0 comments on commit 687ab32

Please sign in to comment.