diff --git a/backend/onyx/db/persona.py b/backend/onyx/db/persona.py index 40667e02dcad..e37cde55ddf1 100644 --- a/backend/onyx/db/persona.py +++ b/backend/onyx/db/persona.py @@ -228,6 +228,7 @@ def create_update_persona( num_chunks=create_persona_request.num_chunks, llm_relevance_filter=create_persona_request.llm_relevance_filter, llm_filter_extraction=create_persona_request.llm_filter_extraction, + is_default_persona=create_persona_request.is_default_persona, ) versioned_make_persona_private = fetch_versioned_implementation( diff --git a/web/src/app/assistants/mine/AssistantCard.tsx b/web/src/app/assistants/mine/AssistantCard.tsx index be5d26320f92..30abd4d30fc7 100644 --- a/web/src/app/assistants/mine/AssistantCard.tsx +++ b/web/src/app/assistants/mine/AssistantCard.tsx @@ -15,8 +15,6 @@ import { PopoverContent, } from "@/components/ui/popover"; import { AssistantIcon } from "@/components/assistants/AssistantIcon"; -import { AssistantVisibilityPopover } from "./AssistantVisibilityPopover"; -import { DeleteAssistantPopover } from "./DeleteAssistantPopover"; import { Persona } from "@/app/admin/assistants/interfaces"; import { useUser } from "@/components/user/UserProvider"; import { useAssistants } from "@/components/context/AssistantsContext"; @@ -149,14 +147,9 @@ const AssistantCard: React.FC<{ )} {isOwnedByUser && ( -
- - open ? setActivePopover(null) : setActivePopover(undefined) - } - > - +
+ + + {isPaidEnterpriseFeaturesEnabled && isOwnedByUser && ( - {isPaidEnterpriseFeaturesEnabled && isOwnedByUser && ( - - )} - -
- )} - {activePopover === "visibility" && ( - { - await togglePersonaPublicStatus(persona.id, isPublic); - await refreshAssistants(); - }} - /> - )} - {activePopover === "delete" && ( - { - const success = await deletePersona(persona.id); - if (success) { - await refreshAssistants(); - } - closePopover(); - }} - /> - )} + )} + +
diff --git a/web/src/app/assistants/mine/AssistantModal.tsx b/web/src/app/assistants/mine/AssistantModal.tsx index aa28ebbfced0..41bad9b25d34 100644 --- a/web/src/app/assistants/mine/AssistantModal.tsx +++ b/web/src/app/assistants/mine/AssistantModal.tsx @@ -118,7 +118,7 @@ export function AssistantModal({ return ( !open && hideModal()}> -
+
@@ -205,7 +205,7 @@ export function AssistantModal({ Featured Assistants -
+
{featuredAssistants.length > 0 ? ( featuredAssistants.map((assistant, index) => (
diff --git a/web/src/app/assistants/mine/AssistantVisibilityPopover.tsx b/web/src/app/assistants/mine/AssistantVisibilityPopover.tsx deleted file mode 100644 index 5b924c475a2b..000000000000 --- a/web/src/app/assistants/mine/AssistantVisibilityPopover.tsx +++ /dev/null @@ -1,198 +0,0 @@ -import React, { useState } from "react"; -import { MinimalUserSnapshot, User } from "@/lib/types"; -import { Button } from "@/components/ui/button"; -import { FiPlus, FiX, FiEye, FiEyeOff } from "react-icons/fi"; -import { SearchMultiSelectDropdown } from "@/components/Dropdown"; -import { UsersIcon } from "@/components/icons/icons"; -import { AssistantSharedStatusDisplay } from "../AssistantSharedStatus"; -import { - addUsersToAssistantSharedList, - removeUsersFromAssistantSharedList, -} from "@/lib/assistants/shareAssistant"; -import { usePopup } from "@/components/admin/connectors/Popup"; -import { Bubble } from "@/components/Bubble"; -import { AssistantIcon } from "@/components/assistants/AssistantIcon"; -import { Spinner } from "@/components/Spinner"; -import { useAssistants } from "@/components/context/AssistantsContext"; -import { Separator } from "@/components/ui/separator"; -import { Persona } from "@/app/admin/assistants/interfaces"; -import { ThreeDotsLoader } from "@/components/Loading"; - -interface AssistantVisibilityPopoverProps { - assistant: Persona; - user: User | null; - allUsers: MinimalUserSnapshot[]; - onClose: () => void; - onTogglePublic: (isPublic: boolean) => Promise; -} - -export function AssistantVisibilityPopover({ - assistant, - user, - allUsers, - onClose, - onTogglePublic, -}: AssistantVisibilityPopoverProps) { - const { refreshAssistants } = useAssistants(); - const { popup, setPopup } = usePopup(); - const [isUpdating, setIsUpdating] = useState(false); - const [selectedUsers, setSelectedUsers] = useState([]); - - const assistantName = assistant.name; - const sharedUsersWithoutOwner = (assistant.users || [])?.filter( - (u: MinimalUserSnapshot) => u.id !== assistant.owner?.id - ); - - const handleShare = async () => { - setIsUpdating(true); - const startTime = Date.now(); - - const error = await addUsersToAssistantSharedList( - assistant, - selectedUsers.map((user) => user.id) - ); - await refreshAssistants(); - - const elapsedTime = Date.now() - startTime; - const remainingTime = Math.max(0, 1000 - elapsedTime); - - setTimeout(() => { - setIsUpdating(false); - if (error) { - setPopup({ - message: `Failed to share assistant - ${error}`, - type: "error", - }); - } - }, remainingTime); - }; - - const handleTogglePublic = async () => { - setIsUpdating(true); - await onTogglePublic(!assistant.is_public); - setIsUpdating(false); - }; - - return ( - <> - {popup} -
-
-

Visibility

- -
- - - -
-

Share

- - !selectedUsers.map((u2) => u2.id).includes(u1.id) && - !sharedUsersWithoutOwner - .map((u2: MinimalUserSnapshot) => u2.id) - .includes(u1.id) && - u1.id !== user?.id - ) - .map((user) => ({ - name: user.email, - value: user.id, - }))} - onSelect={(option) => { - setSelectedUsers([ - ...Array.from( - new Set([ - ...selectedUsers, - { id: option.value as string, email: option.name }, - ]) - ), - ]); - }} - itemComponent={({ option }) => ( -
- - {option.name} - -
- )} - /> -
- - {selectedUsers.length > 0 && ( -
-

- Selected Users: -

-
- {selectedUsers.map((selectedUser) => ( -
{ - setSelectedUsers( - selectedUsers.filter( - (user) => user.id !== selectedUser.id - ) - ); - }} - className="flex items-center bg-blue-50 text-blue-700 rounded-full px-3 py-1 text-xs hover:bg-blue-100 transition-colors duration-200 cursor-pointer" - > - {selectedUser.email} - -
- ))} -
-
- )} - - {selectedUsers.length > 0 && ( - - )} - -
-

Currently Shared With

-
- -
-
-
- - ); -} diff --git a/web/src/app/assistants/mine/DeleteAssistantPopover.tsx b/web/src/app/assistants/mine/DeleteAssistantPopover.tsx deleted file mode 100644 index b85b337e5720..000000000000 --- a/web/src/app/assistants/mine/DeleteAssistantPopover.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from "react"; -import { FiTrash } from "react-icons/fi"; -import { Button } from "@/components/ui/button"; - -interface DeleteAssistantPopoverProps { - entityName: string; - onClose: () => void; - onSubmit: () => void; -} - -export function DeleteAssistantPopover({ - entityName, - onClose, - onSubmit, -}: DeleteAssistantPopoverProps) { - return ( -
-

- Are you sure you want to delete assistant {entityName}? -

-
- - -
-
- ); -} diff --git a/web/src/app/chat/folders/FolderDropdown.tsx b/web/src/app/chat/folders/FolderDropdown.tsx index 830020d04b3a..a729fb0c15fd 100644 --- a/web/src/app/chat/folders/FolderDropdown.tsx +++ b/web/src/app/chat/folders/FolderDropdown.tsx @@ -162,12 +162,12 @@ export const FolderDropdown = forwardRef( onDrop={handleDrop} >
setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} diff --git a/web/src/app/chat/input/LLMPopover.tsx b/web/src/app/chat/input/LLMPopover.tsx index eface23004a6..86d7697a4719 100644 --- a/web/src/app/chat/input/LLMPopover.tsx +++ b/web/src/app/chat/input/LLMPopover.tsx @@ -161,7 +161,6 @@ export default function LLMPopover({ size: 16, className: "flex-none my-auto text-black", })} - asdfasdf {getDisplayNameForModel(name)} diff --git a/web/src/app/chat/sessionSidebar/HistorySidebar.tsx b/web/src/app/chat/sessionSidebar/HistorySidebar.tsx index 7685072e6af4..b2cdaecde1d0 100644 --- a/web/src/app/chat/sessionSidebar/HistorySidebar.tsx +++ b/web/src/app/chat/sessionSidebar/HistorySidebar.tsx @@ -273,6 +273,7 @@ export const HistorySidebar = forwardRef( border-r dark:border-none dark:text-[#D4D4D4] + dark:bg-[#000] border-sidebar-border flex flex-col relative diff --git a/web/src/app/chat/sessionSidebar/PagesTab.tsx b/web/src/app/chat/sessionSidebar/PagesTab.tsx index 9a85f3693c64..973f846baf45 100644 --- a/web/src/app/chat/sessionSidebar/PagesTab.tsx +++ b/web/src/app/chat/sessionSidebar/PagesTab.tsx @@ -317,7 +317,7 @@ export function PagesTab({ return (
{popup} -
+

Chats

- {!hideDividerForTitle && } + {!hideDividerForTitle ? :
} )}
diff --git a/web/src/components/Spinner.tsx b/web/src/components/Spinner.tsx index 4d5bc9907ae6..c4034465b7c0 100644 --- a/web/src/components/Spinner.tsx +++ b/web/src/components/Spinner.tsx @@ -2,7 +2,7 @@ import "./spinner.css"; export const Spinner = () => { return ( -
+
); diff --git a/web/src/components/admin/ClientLayout.tsx b/web/src/components/admin/ClientLayout.tsx index 254413d26fa8..63efa45dc74f 100644 --- a/web/src/components/admin/ClientLayout.tsx +++ b/web/src/components/admin/ClientLayout.tsx @@ -75,7 +75,7 @@ export function ClientLayout({ /> )} -
+