mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 20:24:32 +02:00
Proper popover behavior, no showing queries with no docs, + bubbles (#2330)
This commit is contained in:
@@ -94,7 +94,9 @@ export default function AddConnector({
|
||||
is_public: true,
|
||||
...configuration.values.reduce(
|
||||
(acc, field) => {
|
||||
if (field.type === "list") {
|
||||
if (field.type === "select") {
|
||||
acc[field.name] = field.default || "";
|
||||
} else if (field.type === "list") {
|
||||
acc[field.name] = field.default || [];
|
||||
} else if (field.type === "checkbox") {
|
||||
acc[field.name] = field.default || false;
|
||||
@@ -491,7 +493,6 @@ export default function AddConnector({
|
||||
}}
|
||||
>
|
||||
{(formikProps) => {
|
||||
console.log(formikProps.values);
|
||||
setFormValues(formikProps.values);
|
||||
handleFormStatusChange(
|
||||
formikProps.isValid && isFormSubmittable(formikProps.values)
|
||||
|
@@ -5,11 +5,9 @@ import { Field } from "formik";
|
||||
export default function SelectInput({
|
||||
field,
|
||||
value,
|
||||
onChange,
|
||||
}: {
|
||||
field: SelectOption;
|
||||
value: any;
|
||||
onChange?: (e: Event) => void;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
@@ -27,7 +25,6 @@ export default function SelectInput({
|
||||
)}
|
||||
|
||||
<Field
|
||||
onChange={onChange}
|
||||
as="select"
|
||||
value={value}
|
||||
name={field.name}
|
||||
|
@@ -71,7 +71,7 @@ export function AssistantTools({
|
||||
w-fit
|
||||
flex
|
||||
items-center
|
||||
${hovered ? "bg-background-300" : list ? "bg-background-125" : "bg-background-100"}`}
|
||||
${list ? "bg-background-125" : "bg-background-100"}`}
|
||||
>
|
||||
<div className="flex gap-x-1">
|
||||
<FiSearch key={ind} className="ml-1 h-3 w-3 my-auto" />
|
||||
@@ -91,7 +91,7 @@ export function AssistantTools({
|
||||
border-border
|
||||
w-fit
|
||||
flex
|
||||
${hovered ? "bg-background-300" : list ? "bg-background-125" : "bg-background-100"}`}
|
||||
${list ? "bg-background-125" : "bg-background-100"}`}
|
||||
>
|
||||
<div className="flex items-center gap-x-1">
|
||||
<FiImage
|
||||
|
@@ -194,7 +194,10 @@ export function ChatSessionDisplay({
|
||||
{search ? (
|
||||
showDeleteModal && (
|
||||
<div
|
||||
onClick={() => showDeleteModal(chatSession)}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
showDeleteModal(chatSession);
|
||||
}}
|
||||
className={`p-1 -m-1 rounded ml-1`}
|
||||
>
|
||||
<FiTrash size={16} />
|
||||
@@ -202,7 +205,9 @@ export function ChatSessionDisplay({
|
||||
)
|
||||
) : (
|
||||
<div
|
||||
onClick={() => {
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
// e.stopPropagation();
|
||||
setIsMoreOptionsDropdownOpen(
|
||||
!isMoreOptionsDropdownOpen
|
||||
);
|
||||
|
@@ -78,13 +78,13 @@ export default function SearchAnswer({
|
||||
|
||||
{searchState == "generating" && (
|
||||
<div key={"generating"} className="relative inline-block">
|
||||
<span className="loading-text">Generating response...</span>
|
||||
<span className="loading-text">Generating Response...</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{searchState == "citing" && (
|
||||
<div key={"citing"} className="relative inline-block">
|
||||
<span className="loading-text">Creating citations...</span>
|
||||
<span className="loading-text">Extracting Quotes...</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
@@ -268,7 +268,7 @@ export const SearchSection = ({
|
||||
...(prevState || initialSearchResponse),
|
||||
quotes,
|
||||
}));
|
||||
setSearchState((searchState) => "input");
|
||||
setSearchState((searchState) => "citing");
|
||||
};
|
||||
|
||||
const updateDocs = (documents: SearchDanswerDocument[]) => {
|
||||
@@ -295,7 +295,7 @@ export const SearchSection = ({
|
||||
}));
|
||||
if (disabledAgentic) {
|
||||
setIsFetching(false);
|
||||
setSearchState("input");
|
||||
setSearchState((searchState) => "citing");
|
||||
}
|
||||
if (documents.length == 0) {
|
||||
setSearchState("input");
|
||||
@@ -333,11 +333,8 @@ export const SearchSection = ({
|
||||
messageId,
|
||||
}));
|
||||
router.refresh();
|
||||
// setSearchState("input");
|
||||
setIsFetching(false);
|
||||
setSearchState((searchState) => "input");
|
||||
|
||||
// router.replace(`/search?searchId=${chat_session_id}`);
|
||||
};
|
||||
|
||||
const updateDocumentRelevance = (relevance: Relevance) => {
|
||||
|
Reference in New Issue
Block a user