From 6a982ee29140ef0d5066ebf7ce53bd068217ec49 Mon Sep 17 00:00:00 2001 From: Hamed Mohammadpour Date: Thu, 25 Apr 2024 15:51:49 +0200 Subject: [PATCH 1/2] Make Follow-up questions as a bubble. Remove scrollbars. --- components/Session.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Session.tsx b/components/Session.tsx index 6e42776..e0694fd 100644 --- a/components/Session.tsx +++ b/components/Session.tsx @@ -201,7 +201,7 @@ const FollowupForm: FC<{ >
{suggestions?.map?.((suggestion: string) => ( { posthog.capture("followup_clicked", { sessionId, From 9dbab18881a5c022889c7f02c72418a977144e75 Mon Sep 17 00:00:00 2001 From: Hamed Mohammadpour Date: Thu, 25 Apr 2024 17:07:36 +0200 Subject: [PATCH 2/2] Hide Feedback buttons when answer is being generated (loading) --- components/Feedback.tsx | 11 ++++++----- components/Session.tsx | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/components/Feedback.tsx b/components/Feedback.tsx index feda3b8..6475769 100644 --- a/components/Feedback.tsx +++ b/components/Feedback.tsx @@ -30,24 +30,25 @@ import { ChatBubbleIcon } from "@radix-ui/react-icons"; import { Textarea } from "./ui/textarea"; export const Feedback: FC<{ - isVisible: boolean; + isLoading: boolean; recordFeedback: (feedback: "positive" | "negative") => void; sessionId: string; -}> = ({ isVisible, recordFeedback, sessionId }) => { +}> = ({ isLoading: isLoading, recordFeedback, sessionId }) => { const [isFeedbackRecorded, setIsFeedbackRecorded] = useState(false); + const isComponentVisible = isLoading ? "hidden" : "opacity-100"; // hide the component when the answer is loading. TODO: fix scroll to bottom when it reappears. const feedbackButtonVisibility = [ - isVisible ? "opacity-100" : "hidden", isFeedbackRecorded && "hidden duration-300 ease-in", ]; return (
-
+
diff --git a/components/Session.tsx b/components/Session.tsx index e0694fd..87967e9 100644 --- a/components/Session.tsx +++ b/components/Session.tsx @@ -114,7 +114,7 @@ export const Session: FC<{ sessionData: Step[] }> = ({ @@ -201,7 +201,7 @@ const FollowupForm: FC<{ >