From 5e3aa163a12e9a3b7ee73e0246a7f06cee9fd203 Mon Sep 17 00:00:00 2001 From: MaheshtheDev Date: Fri, 12 Jul 2024 18:27:18 -0700 Subject: [PATCH 1/5] chore: Refactor spaces fetch call activity --- apps/extension/content/ContentApp.tsx | 55 +++++++++++++++------------ 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/apps/extension/content/ContentApp.tsx b/apps/extension/content/ContentApp.tsx index d82857e2..217f72ff 100644 --- a/apps/extension/content/ContentApp.tsx +++ b/apps/extension/content/ContentApp.tsx @@ -137,35 +137,40 @@ export default function ContentApp({ shadowRoot.appendChild(portalDiv); setPortalContainer(portalDiv); - const getSpaces = async () => { - const response = await fetch(`${BACKEND_URL}/api/spaces`, { - headers: { - Authorization: `Bearer ${token}`, - }, - }); - - if (response.status === 401) { - showLoginToast(); - return; - } - - try { - const data = await response.json(); - setSpacesOptions(data.data); - } catch (e) { - console.error( - `Error in supermemory.ai extension: ${e}. Please contact the developer https://x.com/dhravyashah`, - ); - } - }; - - getSpaces(); - return () => { document.removeEventListener("mousemove", () => {}); }; }, []); + const getSpaces = async () => { + const response = await fetch(`${BACKEND_URL}/api/spaces`, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + + if (response.status === 401) { + showLoginToast(); + return; + } + + try { + const data = await response.json(); + setSpacesOptions(data.data); + } catch (e) { + console.error( + `Error in supermemory.ai extension: ${e}. Please contact the developer https://x.com/dhravyashah`, + ); + } + }; + + async function handlePopoverChange() { + setIsPopoverOpen(!isPopoverOpen); + if (isPopoverOpen) { + await getSpaces(); + } + } + async function sendUrlToAPI(spaces: string[]) { setLoading(true); @@ -243,7 +248,7 @@ export default function ContentApp({
- + From e0cce43511bde23db0cbf90f4dbf9343960ec835 Mon Sep 17 00:00:00 2001 From: MaheshtheDev Date: Thu, 18 Jul 2024 22:20:03 -0700 Subject: [PATCH 2/5] chore: Refactor handlePopoverChange function --- apps/extension/content/ContentApp.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/apps/extension/content/ContentApp.tsx b/apps/extension/content/ContentApp.tsx index 217f72ff..de760407 100644 --- a/apps/extension/content/ContentApp.tsx +++ b/apps/extension/content/ContentApp.tsx @@ -164,13 +164,6 @@ export default function ContentApp({ } }; - async function handlePopoverChange() { - setIsPopoverOpen(!isPopoverOpen); - if (isPopoverOpen) { - await getSpaces(); - } - } - async function sendUrlToAPI(spaces: string[]) { setLoading(true); @@ -248,10 +241,13 @@ export default function ContentApp({
- + setIsPopoverOpen(!isPopoverOpen)} + > - + await getSpaces()} asChild> From db854d374a2b8f83a8b296e66873827f56b2b2a7 Mon Sep 17 00:00:00 2001 From: Samrat Malisetti Date: Thu, 18 Jul 2024 23:06:28 -0700 Subject: [PATCH 3/5] fixed mbile layout --- apps/web/app/(landing)/Features/generating.tsx | 2 +- apps/web/app/(landing)/Features/index.tsx | 4 ++-- apps/web/app/(landing)/Showcase.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/app/(landing)/Features/generating.tsx b/apps/web/app/(landing)/Features/generating.tsx index 6cd9ad73..6dd0b231 100644 --- a/apps/web/app/(landing)/Features/generating.tsx +++ b/apps/web/app/(landing)/Features/generating.tsx @@ -3,7 +3,7 @@ import { Loader, Loader2 } from "lucide-react"; const Generating = ({ className }: { className?: string }) => { return (
diff --git a/apps/web/app/(landing)/Features/index.tsx b/apps/web/app/(landing)/Features/index.tsx index ab29d701..d7c606e1 100644 --- a/apps/web/app/(landing)/Features/index.tsx +++ b/apps/web/app/(landing)/Features/index.tsx @@ -16,7 +16,7 @@ const Services = () => {
-
+
{
-
+
diff --git a/apps/web/app/(landing)/Showcase.tsx b/apps/web/app/(landing)/Showcase.tsx index 577b9266..c0650742 100644 --- a/apps/web/app/(landing)/Showcase.tsx +++ b/apps/web/app/(landing)/Showcase.tsx @@ -155,7 +155,7 @@ function FeaturesMobile() {
-
+
Date: Fri, 19 Jul 2024 18:01:58 -0500 Subject: [PATCH 4/5] change summary to answer --- apps/web/app/(dash)/chat/chatWindow.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/app/(dash)/chat/chatWindow.tsx b/apps/web/app/(dash)/chat/chatWindow.tsx index 3bc9fec6..c2199191 100644 --- a/apps/web/app/(dash)/chat/chatWindow.tsx +++ b/apps/web/app/(dash)/chat/chatWindow.tsx @@ -290,7 +290,7 @@ function ChatWindow({ {/* Summary */}
-
Summary
+
Answer
{/* Loading state */} {(chat.answer.parts.length === 0 || From 78d658e99e62b1abb8ed2421378ed69be4ce512d Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Fri, 19 Jul 2024 18:07:02 -0500 Subject: [PATCH 5/5] added links on bottom of the page --- apps/web/app/(dash)/home/page.tsx | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/apps/web/app/(dash)/home/page.tsx b/apps/web/app/(dash)/home/page.tsx index 7ef8e65d..bb48ef15 100644 --- a/apps/web/app/(dash)/home/page.tsx +++ b/apps/web/app/(dash)/home/page.tsx @@ -8,6 +8,7 @@ import { createChatThread, linkTelegramToUser } from "@/app/actions/doers"; import { toast } from "sonner"; import { motion } from "framer-motion"; import { variants } from "./homeVariants"; +import { ChromeIcon, GithubIcon, TwitterIcon } from "lucide-react"; const slap = { initial: { @@ -129,6 +130,38 @@ function Page({ setInitialSpaces={setSpaces} />
+ +
); }