mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-08 11:58:34 +02:00
Rework header a bit + remove assumption of all personas having a prompt
This commit is contained in:
parent
16c8969028
commit
a099f8e296
@ -40,7 +40,6 @@ def upgrade() -> None:
|
||||
# This is irrecoverable, whatever
|
||||
op.execute("DELETE FROM chat_feedback")
|
||||
op.execute("DELETE FROM document_retrieval_feedback")
|
||||
op.execute("DELETE FROM persona")
|
||||
|
||||
op.create_table(
|
||||
"search_doc",
|
||||
|
@ -67,10 +67,10 @@ export function PersonaEditor({
|
||||
const existingPrompt = existingPersona?.prompts[0] ?? null;
|
||||
|
||||
useEffect(() => {
|
||||
if (isUpdate) {
|
||||
if (isUpdate && existingPrompt) {
|
||||
triggerFinalPromptUpdate(
|
||||
existingPrompt!.system_prompt,
|
||||
existingPrompt!.task_prompt,
|
||||
existingPrompt.system_prompt,
|
||||
existingPrompt.task_prompt,
|
||||
existingPersona.num_chunks === 0
|
||||
);
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ import { buildFilters } from "@/lib/search/utils";
|
||||
import { QA, SearchTypeSelector } from "./modifiers/SearchTypeSelector";
|
||||
import { SelectedDocuments } from "./modifiers/SelectedDocuments";
|
||||
import { usePopup } from "@/components/admin/connectors/Popup";
|
||||
import { useSWRConfig } from "swr";
|
||||
|
||||
const MAX_INPUT_HEIGHT = 200;
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
import { User } from "@/lib/types";
|
||||
import { logout } from "@/lib/user";
|
||||
import { UserCircle } from "@phosphor-icons/react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { CustomDropdown, DefaultDropdownElement } from "./Dropdown";
|
||||
import { FiMessageSquare, FiSearch } from "react-icons/fi";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
interface HeaderProps {
|
||||
user: User | null;
|
||||
@ -16,6 +16,7 @@ interface HeaderProps {
|
||||
|
||||
export const Header: React.FC<HeaderProps> = ({ user }) => {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const [dropdownOpen, setDropdownOpen] = useState(false);
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
@ -68,21 +69,21 @@ export const Header: React.FC<HeaderProps> = ({ user }) => {
|
||||
|
||||
<Link
|
||||
href="/search"
|
||||
className="ml-8 h-full flex flex-col hover:bg-hover"
|
||||
className={"ml-6 h-full flex flex-col hover:bg-hover"}
|
||||
>
|
||||
<div className="w-28 flex my-auto">
|
||||
<div className="mx-auto flex text-strong px-2">
|
||||
<div className="w-24 flex my-auto">
|
||||
<div className={"mx-auto flex text-strong px-2"}>
|
||||
<FiSearch className="my-auto mr-1" />
|
||||
<h1 className="flex text-base font-medium my-auto">Search</h1>
|
||||
<h1 className="flex text-sm font-bold my-auto">Search</h1>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<Link href="/chat" className="h-full flex flex-col hover:bg-hover">
|
||||
<div className="w-28 flex my-auto">
|
||||
<div className="w-24 flex my-auto">
|
||||
<div className="mx-auto flex text-strong px-2">
|
||||
<FiMessageSquare className="my-auto mr-1" />
|
||||
<h1 className="flex text-base font-medium my-auto">Chat</h1>
|
||||
<h1 className="flex text-sm font-bold my-auto">Chat</h1>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
|
Loading…
x
Reference in New Issue
Block a user