mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-08 13:40:46 +02:00
@ -125,7 +125,7 @@ def list_llm_providers(
|
|||||||
def put_llm_provider(
|
def put_llm_provider(
|
||||||
llm_provider: LLMProviderUpsertRequest,
|
llm_provider: LLMProviderUpsertRequest,
|
||||||
is_creation: bool = Query(
|
is_creation: bool = Query(
|
||||||
True,
|
False,
|
||||||
description="True if updating an existing provider, False if creating a new one",
|
description="True if updating an existing provider, False if creating a new one",
|
||||||
),
|
),
|
||||||
_: User | None = Depends(current_admin_user),
|
_: User | None = Depends(current_admin_user),
|
||||||
|
@ -104,6 +104,7 @@ import {
|
|||||||
classifyAssistants,
|
classifyAssistants,
|
||||||
orderAssistantsForUser,
|
orderAssistantsForUser,
|
||||||
} from "@/lib/assistants/utils";
|
} from "@/lib/assistants/utils";
|
||||||
|
import BlurBackground from "./shared_chat_search/BlurBackground";
|
||||||
|
|
||||||
const TEMP_USER_MESSAGE_ID = -1;
|
const TEMP_USER_MESSAGE_ID = -1;
|
||||||
const TEMP_ASSISTANT_MESSAGE_ID = -2;
|
const TEMP_ASSISTANT_MESSAGE_ID = -2;
|
||||||
@ -1833,6 +1834,7 @@ export function ChatPage({
|
|||||||
onClose={() => setSharingModalVisible(false)}
|
onClose={() => setSharingModalVisible(false)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="fixed inset-0 flex flex-col text-default">
|
<div className="fixed inset-0 flex flex-col text-default">
|
||||||
<div className="h-[100dvh] overflow-y-hidden">
|
<div className="h-[100dvh] overflow-y-hidden">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
@ -1842,7 +1844,7 @@ export function ChatPage({
|
|||||||
flex-none
|
flex-none
|
||||||
fixed
|
fixed
|
||||||
left-0
|
left-0
|
||||||
z-30
|
z-40
|
||||||
bg-background-100
|
bg-background-100
|
||||||
h-screen
|
h-screen
|
||||||
transition-all
|
transition-all
|
||||||
@ -1876,6 +1878,10 @@ export function ChatPage({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<BlurBackground
|
||||||
|
visible={!untoggled && (showDocSidebar || toggledSidebar)}
|
||||||
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
ref={masterFlexboxRef}
|
ref={masterFlexboxRef}
|
||||||
className="flex h-full w-full overflow-x-hidden"
|
className="flex h-full w-full overflow-x-hidden"
|
||||||
|
@ -382,7 +382,8 @@ export function ChatInputBar({
|
|||||||
border
|
border
|
||||||
border-[#E5E7EB]
|
border-[#E5E7EB]
|
||||||
rounded-lg
|
rounded-lg
|
||||||
bg-background-100
|
text-text-chatbar
|
||||||
|
bg-background-chatbar
|
||||||
[&:has(textarea:focus)]::ring-1
|
[&:has(textarea:focus)]::ring-1
|
||||||
[&:has(textarea:focus)]::ring-black
|
[&:has(textarea:focus)]::ring-black
|
||||||
"
|
"
|
||||||
@ -477,7 +478,8 @@ export function ChatInputBar({
|
|||||||
resize-none
|
resize-none
|
||||||
rounded-lg
|
rounded-lg
|
||||||
border-0
|
border-0
|
||||||
bg-background-100
|
bg-background-chatbar
|
||||||
|
placeholder:text-text-chatbar-subtle
|
||||||
${
|
${
|
||||||
textAreaRef.current &&
|
textAreaRef.current &&
|
||||||
textAreaRef.current.scrollHeight > MAX_INPUT_HEIGHT
|
textAreaRef.current.scrollHeight > MAX_INPUT_HEIGHT
|
||||||
@ -634,7 +636,7 @@ export function ChatInputBar({
|
|||||||
>
|
>
|
||||||
<SendIcon
|
<SendIcon
|
||||||
size={28}
|
size={28}
|
||||||
className={`text-emphasis text-white p-1 rounded-full ${chatState == "input" && message ? "bg-background-800" : "bg-background-400"} `}
|
className={`text-emphasis text-white p-1 rounded-full ${chatState == "input" && message ? "bg-submit-background" : "bg-disabled-submit-background"} `}
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
@ -686,7 +686,9 @@ export const HumanMessage = ({
|
|||||||
onMouseEnter={() => setIsHovered(true)}
|
onMouseEnter={() => setIsHovered(true)}
|
||||||
onMouseLeave={() => setIsHovered(false)}
|
onMouseLeave={() => setIsHovered(false)}
|
||||||
>
|
>
|
||||||
<div className={`mx-auto ${shared ? "w-full" : "w-[90%]"} max-w-[790px]`}>
|
<div
|
||||||
|
className={`text-user-text mx-auto ${shared ? "w-full" : "w-[90%]"} max-w-[790px]`}
|
||||||
|
>
|
||||||
<div className="xl:ml-8">
|
<div className="xl:ml-8">
|
||||||
<div className="flex flex-col mr-4">
|
<div className="flex flex-col mr-4">
|
||||||
<FileDisplay alignBubble files={files || []} />
|
<FileDisplay alignBubble files={files || []} />
|
||||||
|
@ -87,13 +87,12 @@ export const HistorySidebar = forwardRef<HTMLDivElement, HistorySidebarProps>(
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{popup}
|
{popup}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={`
|
className={`
|
||||||
flex
|
flex
|
||||||
flex-none
|
flex-none
|
||||||
bg-background-100
|
bg-background-sidebar
|
||||||
w-full
|
w-full
|
||||||
border-r
|
border-r
|
||||||
border-border
|
border-border
|
||||||
@ -101,7 +100,7 @@ export const HistorySidebar = forwardRef<HTMLDivElement, HistorySidebarProps>(
|
|||||||
flex-col relative
|
flex-col relative
|
||||||
h-screen
|
h-screen
|
||||||
transition-transform
|
transition-transform
|
||||||
mt-2`}
|
pt-2`}
|
||||||
>
|
>
|
||||||
<LogoType
|
<LogoType
|
||||||
showArrow={true}
|
showArrow={true}
|
||||||
|
@ -66,7 +66,7 @@ export function PagesTab({
|
|||||||
const isHistoryEmpty = !existingChats || existingChats.length === 0;
|
const isHistoryEmpty = !existingChats || existingChats.length === 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-1 ml-3 relative miniscroll mobile:pb-40 overflow-y-auto h-full">
|
<div className="mb-1 text-text-sidebar ml-3 relative miniscroll mobile:pb-40 overflow-y-auto h-full">
|
||||||
{folders && folders.length > 0 && (
|
{folders && folders.length > 0 && (
|
||||||
<div className="py-2 border-b border-border">
|
<div className="py-2 border-b border-border">
|
||||||
<div className="text-xs text-subtle flex pb-0.5 mb-1.5 mt-2 font-bold">
|
<div className="text-xs text-subtle flex pb-0.5 mb-1.5 mt-2 font-bold">
|
||||||
@ -92,14 +92,14 @@ export function PagesTab({
|
|||||||
} rounded-md`}
|
} rounded-md`}
|
||||||
>
|
>
|
||||||
{(page == "chat" || page == "search") && (
|
{(page == "chat" || page == "search") && (
|
||||||
<p className="my-2 text-xs text-subtle flex font-bold">
|
<p className="my-2 text-xs text-sidebar-subtle flex font-bold">
|
||||||
{page == "chat" && "Chat "}
|
{page == "chat" && "Chat "}
|
||||||
{page == "search" && "Search "}
|
{page == "search" && "Search "}
|
||||||
History
|
History
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{isHistoryEmpty ? (
|
{isHistoryEmpty ? (
|
||||||
<p className="text-sm text-subtle mt-2 w-[250px]">
|
<p className="text-sm mt-2 w-[250px]">
|
||||||
{page === "search"
|
{page === "search"
|
||||||
? "Try running a search! Your search history will appear here."
|
? "Try running a search! Your search history will appear here."
|
||||||
: "Try sending a message! Your chat history will appear here."}
|
: "Try sending a message! Your chat history will appear here."}
|
||||||
@ -111,7 +111,7 @@ export function PagesTab({
|
|||||||
return (
|
return (
|
||||||
<div key={dateRange}>
|
<div key={dateRange}>
|
||||||
<div
|
<div
|
||||||
className={`text-xs text-subtle ${
|
className={`text-xs text-text-sidebar-subtle ${
|
||||||
ind != 0 && "mt-5"
|
ind != 0 && "mt-5"
|
||||||
} flex pb-0.5 mb-1.5 font-medium`}
|
} flex pb-0.5 mb-1.5 font-medium`}
|
||||||
>
|
>
|
||||||
|
7
web/src/app/chat/shared_chat_search/BlurBackground.tsx
Normal file
7
web/src/app/chat/shared_chat_search/BlurBackground.tsx
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export default function BlurBackground({ visible }: { visible: boolean }) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`desktop:hidden w-full h-full fixed inset-0 bg-black bg-opacity-50 backdrop-blur-sm z-30 transition-opacity duration-300 ease-in-out ${visible ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
@ -75,8 +75,12 @@
|
|||||||
/* blue-700 - Dark blue */
|
/* blue-700 - Dark blue */
|
||||||
--error: #ef4444;
|
--error: #ef4444;
|
||||||
/* red-500 - Bright red */
|
/* red-500 - Bright red */
|
||||||
--success: #059669;
|
--undo: #ef4444;
|
||||||
|
/* red-500 - Bright red */
|
||||||
|
--success: #030706;
|
||||||
/* emerald-600 - Deep green */
|
/* emerald-600 - Deep green */
|
||||||
|
--light-success: #22c55e;
|
||||||
|
/* green-500 */
|
||||||
--alert: #f59e0b;
|
--alert: #f59e0b;
|
||||||
/* amber-600 - Orange */
|
/* amber-600 - Orange */
|
||||||
--accent: #6366f1;
|
--accent: #6366f1;
|
||||||
|
@ -91,7 +91,6 @@ export function BasicSelectable({
|
|||||||
className={`
|
className={`
|
||||||
rounded
|
rounded
|
||||||
font-medium
|
font-medium
|
||||||
text-emphasis
|
|
||||||
text-sm
|
text-sm
|
||||||
${padding == "normal" && "p-1"}
|
${padding == "normal" && "p-1"}
|
||||||
${padding == "extra" && "p-1.5"}
|
${padding == "extra" && "p-1.5"}
|
||||||
|
@ -55,7 +55,7 @@ export function ClientLayout({
|
|||||||
return (
|
return (
|
||||||
<div className="h-screen overflow-y-hidden">
|
<div className="h-screen overflow-y-hidden">
|
||||||
<div className="flex h-full">
|
<div className="flex h-full">
|
||||||
<div className="flex-none w-[250px] z-20 pt-4 pb-8 h-full border-r border-border miniscroll overflow-auto">
|
<div className="flex-none text-text-settings-sidebar bg-background-settings-sidebar w-[250px] z-20 pt-4 pb-8 h-full border-r border-border miniscroll overflow-auto">
|
||||||
<AdminSidebar
|
<AdminSidebar
|
||||||
collections={[
|
collections={[
|
||||||
{
|
{
|
||||||
@ -64,7 +64,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<NotebookIconSkeleton size={18} />
|
<NotebookIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Existing Connectors</div>
|
<div className="ml-1">Existing Connectors</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -73,7 +76,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<ConnectorIconSkeleton size={18} />
|
<ConnectorIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1.5">Add Connector</div>
|
<div className="ml-1.5">Add Connector</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -87,7 +93,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<DocumentSetIconSkeleton size={18} />
|
<DocumentSetIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Document Sets</div>
|
<div className="ml-1">Document Sets</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -96,7 +105,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<ZoomInIconSkeleton size={18} />
|
<ZoomInIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Explorer</div>
|
<div className="ml-1">Explorer</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -105,7 +117,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<ThumbsUpIconSkeleton size={18} />
|
<ThumbsUpIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Feedback</div>
|
<div className="ml-1">Feedback</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -119,7 +134,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<AssistantsIconSkeleton className="my-auto" size={18} />
|
<AssistantsIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Assistants</div>
|
<div className="ml-1">Assistants</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -130,7 +148,7 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<SlackIconSkeleton />
|
<SlackIconSkeleton className="text-icon-settings-sidebar" />
|
||||||
<div className="ml-1">Slack Bots</div>
|
<div className="ml-1">Slack Bots</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -139,7 +157,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<ToolIconSkeleton size={18} />
|
<ToolIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Tools</div>
|
<div className="ml-1">Tools</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -148,7 +169,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<ClosedBookIcon size={18} />
|
<ClosedBookIcon
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Prompt Library</div>
|
<div className="ml-1">Prompt Library</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -161,7 +185,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<ClipboardIcon size={18} />
|
<ClipboardIcon
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Standard Answers</div>
|
<div className="ml-1">Standard Answers</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -179,7 +206,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<GroupsIconSkeleton size={18} />
|
<GroupsIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Groups</div>
|
<div className="ml-1">Groups</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -197,7 +227,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<CpuIconSkeleton size={18} />
|
<CpuIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">LLM</div>
|
<div className="ml-1">LLM</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -207,7 +240,7 @@ export function ClientLayout({
|
|||||||
error: settings?.settings.needs_reindexing,
|
error: settings?.settings.needs_reindexing,
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<SearchIcon />
|
<SearchIcon className="text-icon-settings-sidebar" />
|
||||||
<div className="ml-1">Search Settings</div>
|
<div className="ml-1">Search Settings</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -221,7 +254,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<UsersIconSkeleton size={18} />
|
<UsersIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Users</div>
|
<div className="ml-1">Users</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -232,7 +268,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<GroupsIconSkeleton size={18} />
|
<GroupsIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Groups</div>
|
<div className="ml-1">Groups</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -241,7 +280,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<KeyIconSkeleton size={18} />
|
<KeyIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">API Keys</div>
|
<div className="ml-1">API Keys</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -252,7 +294,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<ShieldIconSkeleton size={18} />
|
<ShieldIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Token Rate Limits</div>
|
<div className="ml-1">Token Rate Limits</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -268,7 +313,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<FiActivity size={18} />
|
<FiActivity
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Usage Statistics</div>
|
<div className="ml-1">Usage Statistics</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -277,7 +325,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<DatabaseIconSkeleton size={18} />
|
<DatabaseIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Query History</div>
|
<div className="ml-1">Query History</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -286,7 +337,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<FiBarChart2 size={18} />
|
<FiBarChart2
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Custom Analytics</div>
|
<div className="ml-1">Custom Analytics</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -302,7 +356,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<SettingsIconSkeleton size={18} />
|
<SettingsIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Workspace Settings</div>
|
<div className="ml-1">Workspace Settings</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -313,7 +370,10 @@ export function ClientLayout({
|
|||||||
{
|
{
|
||||||
name: (
|
name: (
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<PaintingIconSkeleton size={18} />
|
<PaintingIconSkeleton
|
||||||
|
className="text-icon-settings-sidebar"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
<div className="ml-1">Whitelabeling</div>
|
<div className="ml-1">Whitelabeling</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
@ -36,7 +36,7 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
|
|||||||
const enterpriseSettings = combinedSettings.enterpriseSettings;
|
const enterpriseSettings = combinedSettings.enterpriseSettings;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="pl-0">
|
<div className="text-text-settings-sidebar pl-0">
|
||||||
<nav className="space-y-2">
|
<nav className="space-y-2">
|
||||||
<div className="w-full justify-center mb-4 flex">
|
<div className="w-full justify-center mb-4 flex">
|
||||||
<div className="w-52">
|
<div className="w-52">
|
||||||
@ -89,13 +89,13 @@ export function AdminSidebar({ collections }: { collections: Collection[] }) {
|
|||||||
className="flex flex-col items-center justify-center w-full"
|
className="flex flex-col items-center justify-center w-full"
|
||||||
key={collectionInd}
|
key={collectionInd}
|
||||||
>
|
>
|
||||||
<h2 className="text-xs text-strong w-52 font-bold pb-2">
|
<h2 className="text-xs text-text-settings-sidebar-strong w-52 font-bold pb-2">
|
||||||
<div>{collection.name}</div>
|
<div>{collection.name}</div>
|
||||||
</h2>
|
</h2>
|
||||||
{collection.items.map((item) => (
|
{collection.items.map((item) => (
|
||||||
<Link key={item.link} href={item.link}>
|
<Link key={item.link} href={item.link}>
|
||||||
<button
|
<button
|
||||||
className={` text-sm block flex gap-x-2 items-center w-52 py-2.5 px-2 text-left hover:bg-hover rounded`}
|
className={`text-sm block flex gap-x-2 items-center w-52 py-2.5 px-2 text-left hover:bg-background-settings-hover rounded`}
|
||||||
>
|
>
|
||||||
{item.name}
|
{item.name}
|
||||||
{item.error && (
|
{item.error && (
|
||||||
|
@ -42,9 +42,12 @@ export default function LogoType({
|
|||||||
{toggleSidebar && page == "chat" ? (
|
{toggleSidebar && page == "chat" ? (
|
||||||
<button
|
<button
|
||||||
onClick={() => toggleSidebar()}
|
onClick={() => toggleSidebar()}
|
||||||
className="pt-[2px] ml-4 desktop:invisible mb-auto"
|
className="pt-[2px] flex gap-x-2 items-center ml-4 desktop:invisible mb-auto"
|
||||||
>
|
>
|
||||||
<FiSidebar size={20} />
|
<FiSidebar size={20} />
|
||||||
|
{!showArrow && (
|
||||||
|
<Logo className="desktop:hidden -my-2" height={24} width={24} />
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
) : (
|
) : (
|
||||||
<div className="mr-1 invisible mb-auto h-6 w-6">
|
<div className="mr-1 invisible mb-auto h-6 w-6">
|
||||||
|
@ -206,7 +206,7 @@ export const DocumentDisplay = ({
|
|||||||
{!hide && (document.is_relevant || additional_relevance?.relevant) && (
|
{!hide && (document.is_relevant || additional_relevance?.relevant) && (
|
||||||
<FaStar
|
<FaStar
|
||||||
size={16}
|
size={16}
|
||||||
className="h-full text-xs text-accent rounded w-fit my-auto select-none ml-auto mr-2"
|
className="h-full text-xs text-star-indicator rounded w-fit my-auto select-none ml-auto mr-2"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,6 @@ import { MagnifyingGlass } from "@phosphor-icons/react";
|
|||||||
interface FullSearchBarProps {
|
interface FullSearchBarProps {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
query: string;
|
query: string;
|
||||||
setPopup: (popupSpec: PopupSpec | null) => void;
|
|
||||||
setQuery: (query: string) => void;
|
setQuery: (query: string) => void;
|
||||||
onSearch: (fast?: boolean) => void;
|
onSearch: (fast?: boolean) => void;
|
||||||
agentic?: boolean;
|
agentic?: boolean;
|
||||||
@ -16,19 +15,15 @@ interface FullSearchBarProps {
|
|||||||
finalAvailableSources: string[];
|
finalAvailableSources: string[];
|
||||||
tags: Tag[];
|
tags: Tag[];
|
||||||
showingSidebar: boolean;
|
showingSidebar: boolean;
|
||||||
previousSearch: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
import { useState, useEffect, useRef } from "react";
|
import { useRef } from "react";
|
||||||
import { SendIcon } from "../icons/icons";
|
import { SendIcon } from "../icons/icons";
|
||||||
import { Divider } from "@tremor/react";
|
import { Divider } from "@tremor/react";
|
||||||
import { CustomTooltip } from "../tooltip/CustomTooltip";
|
import { CustomTooltip } from "../tooltip/CustomTooltip";
|
||||||
import KeyboardSymbol from "@/lib/browserUtilities";
|
import KeyboardSymbol from "@/lib/browserUtilities";
|
||||||
import { SettingsContext } from "../settings/SettingsProvider";
|
import { HorizontalSourceSelector } from "./filtering/Filters";
|
||||||
import { HorizontalSourceSelector, SourceSelector } from "./filtering/Filters";
|
|
||||||
import { CCPairBasicInfo, DocumentSet, Tag } from "@/lib/types";
|
import { CCPairBasicInfo, DocumentSet, Tag } from "@/lib/types";
|
||||||
import { SourceMetadata } from "@/lib/search/interfaces";
|
|
||||||
import { PopupSpec } from "../admin/connectors/Popup";
|
|
||||||
|
|
||||||
export const AnimatedToggle = ({
|
export const AnimatedToggle = ({
|
||||||
isOn,
|
isOn,
|
||||||
@ -38,24 +33,9 @@ export const AnimatedToggle = ({
|
|||||||
handleToggle: () => void;
|
handleToggle: () => void;
|
||||||
}) => {
|
}) => {
|
||||||
const commandSymbol = KeyboardSymbol();
|
const commandSymbol = KeyboardSymbol();
|
||||||
|
|
||||||
const [width, setWidth] = useState("auto");
|
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
const contentRef = useRef<HTMLDivElement>(null);
|
const contentRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const updateWidth = () => {
|
|
||||||
if (containerRef.current && contentRef.current) {
|
|
||||||
const newWidth = contentRef.current.scrollWidth;
|
|
||||||
setWidth(`${newWidth}px`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
updateWidth();
|
|
||||||
window.addEventListener("resize", updateWidth);
|
|
||||||
return () => window.removeEventListener("resize", updateWidth);
|
|
||||||
}, [isOn]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CustomTooltip
|
<CustomTooltip
|
||||||
light
|
light
|
||||||
@ -81,14 +61,11 @@ export const AnimatedToggle = ({
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
className="my-auto ml-auto flex jusitfy-end items-center cursor-pointer transition-all duration-300 ease-in-out overflow-hidden"
|
className="my-auto ml-auto flex justify-end items-center cursor-pointer"
|
||||||
style={{ width }}
|
|
||||||
onClick={handleToggle}
|
onClick={handleToggle}
|
||||||
>
|
>
|
||||||
<div
|
<div ref={contentRef} className="flex items-center">
|
||||||
ref={contentRef}
|
{/* Toggle switch */}
|
||||||
className={`flex group ml-auto items-center transition-all duration-300 ease-in-out ml-auto`}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
className={`
|
className={`
|
||||||
w-10 h-6 flex items-center rounded-full p-1 transition-all duration-300 ease-in-out
|
w-10 h-6 flex items-center rounded-full p-1 transition-all duration-300 ease-in-out
|
||||||
@ -97,27 +74,12 @@ export const AnimatedToggle = ({
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`
|
className={`
|
||||||
bg-white w-4 h-4 rounded-full group-hover:scale-[.8] shadow-md transform transition-all duration-300 ease-in-out
|
bg-white w-4 h-4 rounded-full shadow-md transform transition-all duration-300 ease-in-out
|
||||||
${!isOn ? "" : "translate-x-4"}
|
${isOn ? "translate-x-4" : ""}
|
||||||
`}
|
`}
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
<p className="flex ml-2 w-[40px]">
|
<p className="ml-2 text-sm">Agentic</p>
|
||||||
<span
|
|
||||||
className={`no-underline text-sm transition-all duration-300 ease-in-out ${
|
|
||||||
isOn ? "opacity-0 translate-y-10 w-0" : "opacity-100"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Fast
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
className={`text-sm transition-all duration-300 ease-in-out ${
|
|
||||||
isOn ? "opacity-100 " : "opacity-0 -translate-y-10 w-0"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Agentic
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
@ -138,10 +100,8 @@ export const FullSearchBar = ({
|
|||||||
documentSets,
|
documentSets,
|
||||||
filterManager,
|
filterManager,
|
||||||
finalAvailableDocumentSets,
|
finalAvailableDocumentSets,
|
||||||
setPopup,
|
|
||||||
finalAvailableSources,
|
finalAvailableSources,
|
||||||
tags,
|
tags,
|
||||||
previousSearch,
|
|
||||||
}: FullSearchBarProps) => {
|
}: FullSearchBarProps) => {
|
||||||
const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {
|
const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {
|
||||||
const target = event.target;
|
const target = event.target;
|
||||||
@ -177,9 +137,10 @@ export const FullSearchBar = ({
|
|||||||
border
|
border
|
||||||
border-border-medium
|
border-border-medium
|
||||||
rounded-lg
|
rounded-lg
|
||||||
bg-background-100
|
bg-background-chatbar
|
||||||
[&:has(textarea:focus)]::ring-1
|
[&:has(textarea:focus)]::ring-1
|
||||||
[&:has(textarea:focus)]::ring-black
|
[&:has(textarea:focus)]::ring-black
|
||||||
|
text-text-chatbar
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<textarea
|
<textarea
|
||||||
@ -191,7 +152,7 @@ export const FullSearchBar = ({
|
|||||||
shrink
|
shrink
|
||||||
resize-none
|
resize-none
|
||||||
border-0
|
border-0
|
||||||
bg-background-100
|
bg-background-chatbar
|
||||||
whitespace-normal
|
whitespace-normal
|
||||||
rounded-lg
|
rounded-lg
|
||||||
break-word
|
break-word
|
||||||
@ -204,6 +165,7 @@ export const FullSearchBar = ({
|
|||||||
max-h-[6em]
|
max-h-[6em]
|
||||||
py-4
|
py-4
|
||||||
h-14
|
h-14
|
||||||
|
placeholder:text-text-chatbar-subtle
|
||||||
`}
|
`}
|
||||||
autoFocus
|
autoFocus
|
||||||
style={{ scrollbarWidth: "thin" }}
|
style={{ scrollbarWidth: "thin" }}
|
||||||
@ -230,7 +192,7 @@ export const FullSearchBar = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex my-auto gap-x-3">
|
<div className="flex my-auto items-center gap-x-3">
|
||||||
{toggleAgentic && (
|
{toggleAgentic && (
|
||||||
<AnimatedToggle isOn={agentic!} handleToggle={toggleAgentic} />
|
<AnimatedToggle isOn={agentic!} handleToggle={toggleAgentic} />
|
||||||
)}
|
)}
|
||||||
@ -244,9 +206,7 @@ export const FullSearchBar = ({
|
|||||||
>
|
>
|
||||||
<SendIcon
|
<SendIcon
|
||||||
size={28}
|
size={28}
|
||||||
className={`text-emphasis ${disabled && "opacity-50"} text-white p-1 rounded-full ${
|
className={`text-emphasis ${disabled || !query ? "bg-disabled-submit-background" : "bg-submit-background"} text-white p-1 rounded-full`}
|
||||||
query ? "bg-background-800" : "bg-[#D7D7D7]"
|
|
||||||
}`}
|
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -286,12 +246,12 @@ export const SearchBar = ({ query, setQuery, onSearch }: SearchBarProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-center">
|
<div className="flex text-text-chatbar justify-center">
|
||||||
<div className="flex items-center w-full opacity-100 border-2 border-border rounded-lg px-4 py-2 focus-within:border-accent bg-background-search">
|
<div className="flex items-center w-full opacity-100 border-2 border-border rounded-lg px-4 py-2 focus-within:border-accent bg-background-search">
|
||||||
<MagnifyingGlass className="text-emphasis" />
|
<MagnifyingGlass className="text-emphasis" />
|
||||||
<textarea
|
<textarea
|
||||||
autoFocus
|
autoFocus
|
||||||
className="flex-grow ml-2 h-6 outline-none placeholder-default overflow-hidden whitespace-normal resize-none"
|
className="flex-grow ml-2 h-6 placeholder:text-text-chatbar-subtle outline-none placeholder-default overflow-hidden whitespace-normal resize-none"
|
||||||
role="textarea"
|
role="textarea"
|
||||||
aria-multiline
|
aria-multiline
|
||||||
placeholder="Search..."
|
placeholder="Search..."
|
||||||
|
@ -182,8 +182,8 @@ export const SearchResultsDisplay = ({
|
|||||||
}}
|
}}
|
||||||
className={`flex items-center justify-center animate-fade-in-up rounded-lg p-1 text-xs transition-all duration-300 w-20 h-8 ${
|
className={`flex items-center justify-center animate-fade-in-up rounded-lg p-1 text-xs transition-all duration-300 w-20 h-8 ${
|
||||||
!sweep
|
!sweep
|
||||||
? "bg-green-500 text-text-800"
|
? "bg-background-agentic-toggled text-text-agentic-toggled"
|
||||||
: "bg-rose-700 text-text-100"
|
: "bg-background-agentic-untoggled text-text-agentic-untoggled"
|
||||||
}`}
|
}`}
|
||||||
style={{
|
style={{
|
||||||
transform: sweep ? "rotateZ(180deg)" : "rotateZ(0deg)",
|
transform: sweep ? "rotateZ(180deg)" : "rotateZ(0deg)",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useContext, useEffect, useRef, useState } from "react";
|
import { useContext, useEffect, useRef, useState } from "react";
|
||||||
import { FullSearchBar, SearchBar } from "./SearchBar";
|
import { FullSearchBar } from "./SearchBar";
|
||||||
import { SearchResultsDisplay } from "./SearchResultsDisplay";
|
import { SearchResultsDisplay } from "./SearchResultsDisplay";
|
||||||
import { SourceSelector } from "./filtering/Filters";
|
import { SourceSelector } from "./filtering/Filters";
|
||||||
import {
|
import {
|
||||||
@ -758,12 +758,10 @@ export const SearchSection = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<FullSearchBar
|
<FullSearchBar
|
||||||
setPopup={setPopup}
|
|
||||||
disabled={previousSearch === query}
|
disabled={previousSearch === query}
|
||||||
toggleAgentic={
|
toggleAgentic={
|
||||||
disabledAgentic ? undefined : toggleAgentic
|
disabledAgentic ? undefined : toggleAgentic
|
||||||
}
|
}
|
||||||
previousSearch={previousSearch}
|
|
||||||
showingSidebar={toggledSidebar}
|
showingSidebar={toggledSidebar}
|
||||||
agentic={agentic}
|
agentic={agentic}
|
||||||
query={query}
|
query={query}
|
||||||
|
@ -41,30 +41,33 @@ export function FilterDropdown({
|
|||||||
flex-col
|
flex-col
|
||||||
${dropdownWidth || width}
|
${dropdownWidth || width}
|
||||||
max-h-96
|
max-h-96
|
||||||
overflow-y-auto
|
overflow-y-scroll
|
||||||
overscroll-contain`}
|
`}
|
||||||
>
|
>
|
||||||
{options.map((option, ind) => {
|
{options.map((option, ind) => {
|
||||||
const isSelected = selected.includes(option.key);
|
const isSelected = selected.includes(option.key);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={option.key}
|
key={`${option.key}-1`}
|
||||||
className={`
|
className={`
|
||||||
${optionClassName}
|
${optionClassName}
|
||||||
flex
|
flex
|
||||||
px-3
|
px-3
|
||||||
text-sm
|
text-sm
|
||||||
py-2.5
|
py-2.5
|
||||||
select-none
|
select-none
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
w-fit
|
flex-none
|
||||||
text-emphasis
|
w-fit
|
||||||
gap-x-1
|
text-emphasis
|
||||||
hover:bg-hover-light
|
gap-x-1
|
||||||
${
|
hover:bg-hover-light
|
||||||
ind === options.length - 1 ? "" : "border-b border-border"
|
${
|
||||||
}
|
ind === options.length - 1
|
||||||
`}
|
? ""
|
||||||
|
: "border-b border-border"
|
||||||
|
}
|
||||||
|
`}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
handleSelect(option);
|
handleSelect(option);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -83,7 +83,7 @@ export function TagFilter({
|
|||||||
/>
|
/>
|
||||||
{selectedTags.length > 0 && (
|
{selectedTags.length > 0 && (
|
||||||
<div className="mt-2">
|
<div className="mt-2">
|
||||||
<div className="mt-1 flex flex-wrap gap-x-1 gap-y-1">
|
<div className="mt-1 flex bg-black flex-wrap gap-x-1 gap-y-1">
|
||||||
{selectedTags.map((tag) => (
|
{selectedTags.map((tag) => (
|
||||||
<div
|
<div
|
||||||
key={tag.tag_key + tag.tag_value}
|
key={tag.tag_key + tag.tag_value}
|
||||||
|
@ -100,6 +100,38 @@ module.exports = {
|
|||||||
"background-emphasis": "var(--background-emphasis)",
|
"background-emphasis": "var(--background-emphasis)",
|
||||||
"background-strong": "var(--background-strong)",
|
"background-strong": "var(--background-strong)",
|
||||||
"background-search": "var(--white)",
|
"background-search": "var(--white)",
|
||||||
|
|
||||||
|
// colors for sidebar in chat, search, and manage settings
|
||||||
|
"background-sidebar": "var(--background-100)",
|
||||||
|
"background-settings-sidebar": "var(--background-100)",
|
||||||
|
"background-chatbar": "var(--background-100)",
|
||||||
|
"text-sidebar": "var(--text-500)",
|
||||||
|
|
||||||
|
// Settings
|
||||||
|
"text-sidebar-subtle": "var(--text-500)",
|
||||||
|
"icon-settings-sidebar": "var(--text-600)",
|
||||||
|
"text-settings-sidebar": "var(--text-600)",
|
||||||
|
"text-settings-sidebar-strong": "var(--text-900)",
|
||||||
|
"background-settings-hover": "var(--background-200)",
|
||||||
|
|
||||||
|
// Background for chat messages (user bubbles)
|
||||||
|
user: "var(--user-bubble)",
|
||||||
|
|
||||||
|
// Colors for the search toggle buttons
|
||||||
|
"background-agentic-toggled": "var(--light-success)",
|
||||||
|
"background-agentic-untoggled": "var(--undo)",
|
||||||
|
"text-agentic-toggled": "var(--text-800)",
|
||||||
|
"text-agentic-untoggled": "var(--white)",
|
||||||
|
"text-chatbar-subtle": "var(--text-500)",
|
||||||
|
"text-chatbar": "var(--text-800)",
|
||||||
|
|
||||||
|
// Color for the star indicator on high quality search results.
|
||||||
|
"star-indicator": "var(--background-100)",
|
||||||
|
|
||||||
|
// Backgrounds for submit buttons on search and chat
|
||||||
|
"submit-background": "var(--background-800)",
|
||||||
|
"disabled-submit-background": "var(--background-400)",
|
||||||
|
|
||||||
input: "var(--white)",
|
input: "var(--white)",
|
||||||
|
|
||||||
"text-50": "var(--text-50)",
|
"text-50": "var(--text-50)",
|
||||||
@ -114,6 +146,8 @@ module.exports = {
|
|||||||
"text-900": "var(--text-900)",
|
"text-900": "var(--text-900)",
|
||||||
"text-950": "var(--text-950)",
|
"text-950": "var(--text-950)",
|
||||||
|
|
||||||
|
"user-text": "var(--text-800)",
|
||||||
|
|
||||||
description: "var(--text-400)",
|
description: "var(--text-400)",
|
||||||
subtle: "var(--text-500)",
|
subtle: "var(--text-500)",
|
||||||
default: "var(--text-600)",
|
default: "var(--text-600)",
|
||||||
@ -163,10 +197,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// bubbles in chat for each "user"
|
|
||||||
user: "var(--user-bubble)",
|
|
||||||
ai: "var(--ai-bubble)",
|
|
||||||
|
|
||||||
// for display documents
|
// for display documents
|
||||||
document: "var(--document-color)",
|
document: "var(--document-color)",
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user