From 87863660482c698aebc6a97e48df438d61d06477 Mon Sep 17 00:00:00 2001 From: Bran18 Date: Fri, 20 Dec 2024 10:47:05 -0600 Subject: [PATCH 01/13] refactor: replicate tooltip effect in desktop bot chatbot details --- .../chat/onboarding-chatbot-details.tsx | 101 ++++++++---------- .../routes/thread/user-thread-panel.tsx | 8 +- 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx index 95c79744..4f19b25a 100644 --- a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx +++ b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx @@ -1,24 +1,30 @@ import { Button } from '@/components/ui/button' import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card' -import { cn, numberShortener } from '@/lib/utils' +import { cn } from '@/lib/utils' import type { ChatbotDetailsProps } from '@/types/types' -import { Bot, MessageSquarePlus, Users } from 'lucide-react' +import { PanelLeft, MessageSquarePlus } from 'lucide-react' import Image from 'next/image' export function OnboardingChatbotDetails({ - botName = 'BuildBot', + botName, avatar = '', description, - threadCount = 0, - followersCount = 3200, isWelcomeView = true, - categoryName, - onNewChat, - onFollow + onNewChat }: ChatbotDetailsProps) { return ( -
- +
+ {/* Background tooltip effect */} + +
+ +

{isWelcomeView ? 'Welcome to Masterbots!' : botName} @@ -53,60 +59,41 @@ export function OnboardingChatbotDetails({

{isWelcomeView && ( -
+

- Your Journey Begins Here! + Pick a Bot and Start Chatting

-

- Try and start with: {botName} -

+
+ +

+ Find Your Favorite Bot in the Sidebar +

+
)} - -
-
- - - Threads: {numberShortener(threadCount)} - -
-
- - - Followers:{' '} - {numberShortener(followersCount)} - + {!isWelcomeView && ( + +
+
- -
- -
- -
- + + )}
) diff --git a/apps/masterbots.ai/components/routes/thread/user-thread-panel.tsx b/apps/masterbots.ai/components/routes/thread/user-thread-panel.tsx index b62a1432..de5de32e 100755 --- a/apps/masterbots.ai/components/routes/thread/user-thread-panel.tsx +++ b/apps/masterbots.ai/components/routes/thread/user-thread-panel.tsx @@ -214,9 +214,11 @@ export default function UserThreadPanel({ return ( <> -
- -
+ {threads.length > 0 && ( +
+ +
+ )} {loading ? ( From e5daf70b9c579e2dd09fb9ed0033ae376a7d49d5 Mon Sep 17 00:00:00 2001 From: Bran18 Date: Fri, 20 Dec 2024 11:46:41 -0600 Subject: [PATCH 02/13] fix: add guard and removed re-render --- .../routes/chat/chat-chatbot-details.tsx | 2 +- .../chat/onboarding-chatbot-details.tsx | 33 +++++++++++------- apps/masterbots.ai/components/ui/tooltip.tsx | 10 +++--- apps/masterbots.ai/package.json | 2 +- bun.lockb | Bin 408776 -> 409416 bytes 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/apps/masterbots.ai/components/routes/chat/chat-chatbot-details.tsx b/apps/masterbots.ai/components/routes/chat/chat-chatbot-details.tsx index 8db54a2f..fa241616 100644 --- a/apps/masterbots.ai/components/routes/chat/chat-chatbot-details.tsx +++ b/apps/masterbots.ai/components/routes/chat/chat-chatbot-details.tsx @@ -59,7 +59,7 @@ export default function ChatChatbotDetails() { } fetchData() - }, [activeCategory, activeChatbot, session?.user]) + }, [activeCategory, activeChatbot]) if (isLoading || !session?.user) return diff --git a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx index 4f19b25a..36a156d3 100644 --- a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx +++ b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx @@ -2,7 +2,7 @@ import { Button } from '@/components/ui/button' import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card' import { cn } from '@/lib/utils' import type { ChatbotDetailsProps } from '@/types/types' -import { PanelLeft, MessageSquarePlus } from 'lucide-react' +import { PanelLeft, MessageSquarePlus, Bot } from 'lucide-react' import Image from 'next/image' export function OnboardingChatbotDetails({ @@ -16,20 +16,27 @@ export function OnboardingChatbotDetails({
{/* Background tooltip effect */} -
+ {isWelcomeView && ( +
+ )}

{isWelcomeView ? 'Welcome to Masterbots!' : botName}

- + {!isWelcomeView && ( +
+ + bio: +
+ )}

- Pick a Bot and Start Chatting + Pick a Bot and Start Chatting

-

- Find Your Favorite Bot in the Sidebar +

+ Find Your Favorite Bot in the Sidebar

@@ -88,7 +95,7 @@ export function OnboardingChatbotDetails({ > - New Chat With {botName} + Chat With {botName} Now
diff --git a/apps/masterbots.ai/components/ui/tooltip.tsx b/apps/masterbots.ai/components/ui/tooltip.tsx index af1d48be..30fc44d9 100644 --- a/apps/masterbots.ai/components/ui/tooltip.tsx +++ b/apps/masterbots.ai/components/ui/tooltip.tsx @@ -1,9 +1,9 @@ -'use client' +"use client" -import * as React from 'react' -import * as TooltipPrimitive from '@radix-ui/react-tooltip' +import * as React from "react" +import * as TooltipPrimitive from "@radix-ui/react-tooltip" -import { cn } from '@/lib/utils' +import { cn } from "@/lib/utils" const TooltipProvider = TooltipPrimitive.Provider @@ -19,7 +19,7 @@ const TooltipContent = React.forwardRef< ref={ref} sideOffset={sideOffset} className={cn( - 'z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1', + "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className )} {...props} diff --git a/apps/masterbots.ai/package.json b/apps/masterbots.ai/package.json index acb030e7..400af47f 100644 --- a/apps/masterbots.ai/package.json +++ b/apps/masterbots.ai/package.json @@ -33,7 +33,7 @@ "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-switch": "^1.1.1", - "@radix-ui/react-tooltip": "^1.1.3", + "@radix-ui/react-tooltip": "^1.1.6", "@stripe/react-stripe-js": "^2.8.1", "@stripe/stripe-js": "^3.5.0", "@vercel/analytics": "^1.3.2", diff --git a/bun.lockb b/bun.lockb index 6efc9fddce3813767b8ee661ef1b1e27f597cfd9..be4a19e31188375274adc1de937d5c02f64719f3 100755 GIT binary patch delta 17881 zcmeI4cX$=m+P7!+o*lAj2{jcdB2r8sw4D$FhK_WRrh)_r0s_<5|zW)~r5j&7R4ab2~ie z&+v({m6lYUS+8u@)F}&QU#mB1T8l=d-yhv>_TBdi^*gm`+@V<^30d`m3^~qC>Qvg5 z^TYCCp%F#4?lp|EhLKU`EyE~@9qXSI5mtTEABGWuHxC<$os12|?ig+uVc4bG_PT2r z(fDoe`oE8;U8LfD!-&GYo@N-uuqXXxBg4#Z{Rxr2l%{UeKDFnNA*n-p8b(cgNpsO< z8eVK#%7Fe-x$cGCe(~OSVAL)NBs%d)P5Yz6kI-yRg7_5|33M=&mAgCCCH zn)K2qy;6I;{xa>Wg)d!OhCUM8znE#1$Hri#T_vz`-k;cl*fPZpyMJ2Zmobd=jMIgk z1beYE7MWNXx$`BRjQwFw#mYrGjU9;%A-?ykgJV)tdiKc+cj7~_a^CbP(;nkuI$f`5 z(XP$@nJE6pp7m9Z;~l~P7gZQ*ktHx0TbV>Hbbp2+!9 z>f=~Re*r7$vPdt@IIR6_tkmKQtW50*So%9XV>kgRxGz>RY>$=x`SMA}Z-OraZE1dk zjHUVKurg5lu+mT2SV^}8D-D{0m3#*4`0iM#KntvtSKGGfMn(k!lHpBSBr_%tD>EU7 z0gw~cV;H4o)4f`5Rd2p*c*T z;^_poRdY^g8|SpBDOS3!-;h@a)?(_e(eZPzl3}k`dk!7kcVOy&@Jr#pjg=NpBtwa> zQ`0G+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j2OjR%+xZ0KRg*e`>T>KkMF3$xOJw-yYBo(3%jXy-LzV&61S|6&E{(JEk?4r zIt(?;_wsi&WOm?@7Z>(eRylGfHh&?IHLm<4CH^d1_t5v)Vc4HH=-0K$sD|G+z3F7x zvO#XcKdq-Pne}oPU-WEst7&6ALAkrHc&rv7Sq*~hpN4B2s6)v?kKSW6bnMQ_L8|a3 pKkE843L0UCWF>32WO1viZlnY?y2pMcMr!^iEVi%e(>UnV{{TSycjEv6 From 09c210039eceb8ca8a59833b8c0925000889f925 Mon Sep 17 00:00:00 2001 From: Bran18 Date: Fri, 20 Dec 2024 13:15:34 -0600 Subject: [PATCH 03/13] fix: refactor mobile bot chatbot details --- .../routes/chat/chat-chatbot-details.tsx | 14 +- .../chat/chat-onboarding-chatbot-mobile.tsx | 39 +++++ .../chat/chat-selected-chatbot-mobile.tsx | 88 +++++++++++ .../onboarding-chatbot-mobile-details.tsx | 147 ------------------ 4 files changed, 139 insertions(+), 149 deletions(-) create mode 100644 apps/masterbots.ai/components/routes/chat/chat-onboarding-chatbot-mobile.tsx create mode 100644 apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx delete mode 100644 apps/masterbots.ai/components/routes/chat/onboarding-chatbot-mobile-details.tsx diff --git a/apps/masterbots.ai/components/routes/chat/chat-chatbot-details.tsx b/apps/masterbots.ai/components/routes/chat/chat-chatbot-details.tsx index fa241616..44a3fb82 100644 --- a/apps/masterbots.ai/components/routes/chat/chat-chatbot-details.tsx +++ b/apps/masterbots.ai/components/routes/chat/chat-chatbot-details.tsx @@ -6,7 +6,8 @@ import { useSession } from 'next-auth/react' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' import { OnboardingChatbotDetails } from '@/components/routes/chat/onboarding-chatbot-details' -import { OnboardingMobileChatbotDetails } from '@/components/routes/chat/onboarding-chatbot-mobile-details' +import { OnboardingMobileView } from '@/components/routes/chat/chat-onboarding-chatbot-mobile' +import { SelectedBotMobileView } from '@/components/routes/chat/chat-selected-chatbot-mobile' export default function ChatChatbotDetails() { const { data: session } = useSession() @@ -94,7 +95,16 @@ export default function ChatChatbotDetails() { return ( <> - + {isWelcomeView ? ( + + ) : ( + + )}{' '} ) } diff --git a/apps/masterbots.ai/components/routes/chat/chat-onboarding-chatbot-mobile.tsx b/apps/masterbots.ai/components/routes/chat/chat-onboarding-chatbot-mobile.tsx new file mode 100644 index 00000000..d399db31 --- /dev/null +++ b/apps/masterbots.ai/components/routes/chat/chat-onboarding-chatbot-mobile.tsx @@ -0,0 +1,39 @@ +import { Card, CardHeader } from '@/components/ui/card' +import { PanelLeft } from 'lucide-react' + +export function OnboardingMobileView() { + return ( +
+ + +
+
+

+ Welcome to Masterbots! +

+
+
+ +
+

+ Here you can create new threads and share them to your network! + Navigate with the sidebar and pick any bot of your interest. +

+
+
+

+ Select a Bot To Chat with +

+
+ +

+ Go to sidebar and select +

+
+
+
+ + +
+ ) +} diff --git a/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx b/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx new file mode 100644 index 00000000..817af686 --- /dev/null +++ b/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx @@ -0,0 +1,88 @@ +import { Button } from '@/components/ui/button' +import { Card, CardFooter, CardHeader } from '@/components/ui/card' +import { cn } from '@/lib/utils' +import { Bot, MessageSquarePlus } from 'lucide-react' +import Image from 'next/image' + +interface SelectedBotMobileViewProps { + botName: string + description: string + avatar: string + onNewChat: () => void +} + +export function SelectedBotMobileView({ + botName, + description, + avatar, + onNewChat +}: SelectedBotMobileViewProps) { + return ( +
+ + +
+
+

+ {botName} +

+
+ +
+ + bio: +
+ +
+ {/* Avatar container positioned absolutely */} +
+
+ {`${botName} +
+
+ + {/* Separator line */} +
+
+ +
+

+ {description} +

+
+
+ + + + + + +
+ ) +} + +export default SelectedBotMobileView diff --git a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-mobile-details.tsx b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-mobile-details.tsx deleted file mode 100644 index 93ed7512..00000000 --- a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-mobile-details.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import { Button } from '@/components/ui/button' -import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card' -import { cn, numberShortener } from '@/lib/utils' -import type { ChatbotDetailsProps } from '@/types/types' -import { Bot, MessageSquarePlus, Users } from 'lucide-react' -import Image from 'next/image' - -export function OnboardingMobileChatbotDetails({ - botName = 'BuildBot', - avatar = '', - description, - threadCount = 0, - followersCount = 3200, - isWelcomeView = true, - categoryName, - onNewChat, - onFollow -}: ChatbotDetailsProps) { - return ( -
- - -
- {isWelcomeView ? ( - //* Onboarding View Layout - <> - -
-

- Welcome to Masterbots! -

-

- Here you can create new threads and share them to your - network! Navigate with the sidebar and pick any bot of your - interest. -

-
- -
- -
-
-

- Your Journey -
- Begins Here! -

-

- Try and start with:
- {botName} -

-
- -
- {`${botName} -
-
- - ) : ( - //* Selected Bot View Layout - <> -

- {botName} -

-
-
-

- {description} -

- -
- {`${botName} -
-
- - )} -
- - - -
- - - Threads: {numberShortener(threadCount)} - -
- -
-
- - - Followers: {numberShortener(followersCount)} - -
- -
-
- - - - - -
- ) -} From 3d9c7b244be26fd110970d0ce0f14ffa5505ddd4 Mon Sep 17 00:00:00 2001 From: Bran18 Date: Fri, 20 Dec 2024 13:53:33 -0600 Subject: [PATCH 04/13] refactor: make chatPannel bigger --- .../components/routes/chat/chat-combobox.tsx | 60 +++++++++++++------ .../components/routes/chat/prompt-form.tsx | 6 +- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/apps/masterbots.ai/components/routes/chat/chat-combobox.tsx b/apps/masterbots.ai/components/routes/chat/chat-combobox.tsx index f42d0b2e..112ef3b7 100644 --- a/apps/masterbots.ai/components/routes/chat/chat-combobox.tsx +++ b/apps/masterbots.ai/components/routes/chat/chat-combobox.tsx @@ -31,7 +31,7 @@ import { usePowerUp } from '@/lib/hooks/use-power-up' //* Model options available in the combobox, each with label, value, and logo icon. const models = [ - { label: 'GPT-4o', value: AIModels.Default, logo: "MB" }, + { label: 'GPT-4o', value: AIModels.Default, logo: 'MB' }, { label: 'GPT-4', value: AIModels.GPT4, logo: }, { label: 'Claude3', value: AIModels.Claude3, logo: }, { label: 'llama3_8', value: AIModels.llama3_8b, logo: }, @@ -45,6 +45,7 @@ export function ChatCombobox() { const [open, setOpen] = React.useState(false) const [value, setValue] = React.useState(selectedModel as string) const { isPowerUp } = usePowerUp() + const isDevEnv = process.env.NEXT_PUBLIC_APP_ENV !== 'prod' return ( @@ -54,8 +55,11 @@ export function ChatCombobox() { role="combobox" aria-expanded={open} className={cn( - buttonVariants({ size: 'sm', variant: isPowerUp ? 'powerUp' : 'outline' }), - 'absolute left-0 top-4 size-8 rounded-full p-0 sm:left-4' + buttonVariants({ + size: 'sm', + variant: isPowerUp ? 'powerUp' : 'outline' + }), + 'absolute left-0 top-5 size-8 rounded-full p-0 sm:left-4' )} > {/* Renders the selected model's logo or default icon */} @@ -74,32 +78,52 @@ export function ChatCombobox() { No model found. - {/* Iterates over models to create selectable items */} - {models.map(model => ( - { + {/* Render models only in dev or local environments, otherwise show default */} + {isDevEnv ? ( + models.map(model => ( + { process.env.NEXT_PUBLIC_APP_ENV !== 'prod' - ? (setValue(currentValue === value ? '' : currentValue), changeModel(currentValue as AIModels)) - : '' - setOpen(false) // Closes the popover after selection. + ? (setValue(currentValue === value ? '' : currentValue), + changeModel(currentValue as AIModels)) + : '' + setOpen(false) // Closes the popover after selection. + }} + > + {model.label} + + + )) + ) : ( + { + setValue(AIModels.Default) + changeModel(AIModels.Default) + setOpen(false) }} > - {model.label} - {/* Visual checkmark icon for the selected model */} + Masterbot's Model - ))} + )} ) -} \ No newline at end of file +} diff --git a/apps/masterbots.ai/components/routes/chat/prompt-form.tsx b/apps/masterbots.ai/components/routes/chat/prompt-form.tsx index 664be586..4490bccc 100644 --- a/apps/masterbots.ai/components/routes/chat/prompt-form.tsx +++ b/apps/masterbots.ai/components/routes/chat/prompt-form.tsx @@ -90,7 +90,7 @@ export function PromptForm({
@@ -108,9 +108,9 @@ export function PromptForm({ spellCheck={false} disabled={disabled} className={cn( - "w-full resize-none bg-transparent px-4 focus-within:outline-none sm:text-sm", + "w-full resize-none bg-transparent px-4 py-1 my-1 focus-within:outline-none sm:text-sm", "min-h-[80px] md:min-h-[60px]", //? Smaller height on mobile - "py-2 md:py-[1.3rem]" //? Adjusted padding for mobile + "md:py-[1.3rem]" //? Adjusted padding for mobile )} />
From 9ee3c5fa6be01aea383d2034d7e93d272ee4a2eb Mon Sep 17 00:00:00 2001 From: Bran18 Date: Tue, 24 Dec 2024 11:29:31 -0600 Subject: [PATCH 05/13] chore:add new bot card design + sidebar hover color --- apps/masterbots.ai/app/globals.css | 26 ++ .../layout/sidebar/sidebar-link.tsx | 310 ++++++++++-------- .../chat/chat-onboarding-chatbot-mobile.tsx | 7 +- .../chat/chat-selected-chatbot-mobile.tsx | 50 ++- .../chat/onboarding-chatbot-details.tsx | 39 +-- 5 files changed, 238 insertions(+), 194 deletions(-) diff --git a/apps/masterbots.ai/app/globals.css b/apps/masterbots.ai/app/globals.css index fcaa5bb6..39a6add9 100644 --- a/apps/masterbots.ai/app/globals.css +++ b/apps/masterbots.ai/app/globals.css @@ -49,6 +49,9 @@ --tertiary: 288, 82%, 50%; --tertiary-foreground: 0 0% 98%; --font-size-base: 1rem; + + --background-sidebar-gradient: linear-gradient(180deg, rgba(190, 22, 232, 0.2) 0%, rgba(190, 22, 232, 0.4) 100%); + --background-sidebar-hover-gradient: linear-gradient(180deg, rgba(190, 22, 232, 0.1) 0%, rgba(190, 22, 232, 0.3) 100%); } .dark { @@ -94,6 +97,9 @@ --tertiary: 120, 100%, 65%; --tertiary-foreground: 0 0% 98%; + + --background-sidebar-gradient: linear-gradient(180deg, rgba(130, 228, 110, 0.2) 0%, rgba(130, 228, 110, 0.4) 100%); + --background-sidebar-hover-gradient: linear-gradient(180deg, rgba(130, 228, 110, 0.1) 0%, rgba(130, 228, 110, 0.3) 100%); } } @@ -305,3 +311,23 @@ .lucide { stroke-width: 1.25px; } + +/* Sidebar gradient styles */ +.sidebar-gradient { + transition: background-image 0.3s ease; +} + +/* Hover state */ +.sidebar-gradient:hover:not(.selected) { + background-image: var(--background-sidebar-hover-gradient); +} + +/* Selected state */ +.sidebar-gradient.selected { + background-image: var(--background-sidebar-gradient); +} + +/* Selected + hover state */ +.sidebar-gradient.selected:hover { + background-image: var(--background-sidebar-gradient); +} diff --git a/apps/masterbots.ai/components/layout/sidebar/sidebar-link.tsx b/apps/masterbots.ai/components/layout/sidebar/sidebar-link.tsx index 57b5595e..81166b01 100755 --- a/apps/masterbots.ai/components/layout/sidebar/sidebar-link.tsx +++ b/apps/masterbots.ai/components/layout/sidebar/sidebar-link.tsx @@ -1,11 +1,11 @@ 'use client' -import { Checkbox } from "@/components/ui/checkbox" +import { Checkbox } from '@/components/ui/checkbox' import { IconCaretRight } from '@/components/ui/icons' import { useSidebar } from '@/lib/hooks/use-sidebar' import { urlBuilders } from '@/lib/url' import { cn } from '@/lib/utils' -import { Category, Chatbot } from 'mb-genql' +import type { Category, Chatbot } from 'mb-genql' import { toSlug } from 'mb-lib' import Image from 'next/image' import Link from 'next/link' @@ -18,7 +18,11 @@ interface SidebarLinkProps { page?: string } -export default function SidebarLink({ category, isFilterMode, page }: SidebarLinkProps) { +export default function SidebarLink({ + category, + isFilterMode, + page +}: SidebarLinkProps) { const router = useRouter() const pathname = usePathname() const isBrowse = !/^\/(?:c|u)(?:\/|$)/.test(pathname) @@ -39,51 +43,73 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin } = useSidebar() const isExpanded = expandedCategories.includes(category.categoryId) - const handleClickCategory = useCallback((e: React.MouseEvent) => { - e.stopPropagation() - if (!isFilterMode) { - setExpandedCategories(prev => - prev.includes(category.categoryId) - ? [] - : [category.categoryId] - ) - setActiveCategory(prev => { - const newCategory = prev === category.categoryId ? null : category.categoryId - if (newCategory) { - setActiveChatbot(null) - navigateTo({ - page, - slug: typeof slug === 'string' ? slug : undefined, - categoryName: toSlug(category.name.toLowerCase()), - isBrowse - }) - - } - else { - setActiveChatbot(null) - navigateTo({ - page, - slug: typeof slug === 'string' ? slug : undefined, - isBrowse - }) - } - return newCategory - }) - } - }, [category.categoryId, category.name, setActiveCategory, setExpandedCategories, setActiveChatbot, router, isFilterMode, isBrowse]) + // biome-ignore lint/correctness/useExhaustiveDependencies: + const handleClickCategory = useCallback( + (e: React.MouseEvent) => { + e.stopPropagation() + if (!isFilterMode) { + setExpandedCategories(prev => + prev.includes(category.categoryId) ? [] : [category.categoryId] + ) + setActiveCategory(prev => { + const newCategory = + prev === category.categoryId ? null : category.categoryId + if (newCategory) { + setActiveChatbot(null) + navigateTo({ + page, + slug: typeof slug === 'string' ? slug : undefined, + categoryName: toSlug(category.name.toLowerCase()), + isBrowse + }) + } else { + setActiveChatbot(null) + navigateTo({ + page, + slug: typeof slug === 'string' ? slug : undefined, + isBrowse + }) + } + return newCategory + }) + } + }, + [ + category.categoryId, + category.name, + setActiveCategory, + setExpandedCategories, + setActiveChatbot, + router, + isFilterMode, + isBrowse + ] + ) - const handleCheckboxChange = useCallback((checked: boolean) => { - setSelectedCategories(prev => - checked - ? [...prev, category.categoryId] - : prev.filter(id => id !== category.categoryId) - ) - setSelectedChatbots(prev => - checked - ? [...prev, ...category.chatbots.map(chatbot => chatbot.chatbot.chatbotId)] - : prev.filter(id => !category.chatbots.some(chatbot => chatbot.chatbot.chatbotId === id)) - ) - }, [category.categoryId, category.chatbots]) + // biome-ignore lint/correctness/useExhaustiveDependencies: + const handleCheckboxChange = useCallback( + (checked: boolean) => { + setSelectedCategories(prev => + checked + ? [...prev, category.categoryId] + : prev.filter(id => id !== category.categoryId) + ) + setSelectedChatbots(prev => + checked + ? [ + ...prev, + ...category.chatbots.map(chatbot => chatbot.chatbot.chatbotId) + ] + : prev.filter( + id => + !category.chatbots.some( + chatbot => chatbot.chatbot.chatbotId === id + ) + ) + ) + }, + [category.categoryId, category.chatbots] + ) const isActive = activeCategory === category.categoryId const isSelected = selectedCategories.includes(category.categoryId) @@ -94,7 +120,7 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin e.stopPropagation()} + onClick={e => e.stopPropagation()} className="mr-2" /> )} @@ -110,12 +136,14 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin const childrenContent = (isExpanded || isFilterMode) && (
- {category.chatbots.map((chatbotCategory) => ( + {category.chatbots.map(chatbotCategory => ( + {/* biome-ignore lint/a11y/useKeyWithClickEvents: */}
@@ -143,18 +172,19 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin return (
+ {/* biome-ignore lint/a11y/useButtonType: */}
-

- Select a Bot To Chat with -

-

- Go to sidebar and select +

+ Go To Sidebar And Select One Bot

diff --git a/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx b/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx index 817af686..da28a282 100644 --- a/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx +++ b/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx @@ -1,7 +1,6 @@ -import { Button } from '@/components/ui/button' import { Card, CardFooter, CardHeader } from '@/components/ui/card' import { cn } from '@/lib/utils' -import { Bot, MessageSquarePlus } from 'lucide-react' +import { Bot, ArrowBigDown } from 'lucide-react' import Image from 'next/image' interface SelectedBotMobileViewProps { @@ -36,20 +35,20 @@ export function SelectedBotMobileView({
{/* Avatar container positioned absolutely */}
-
- {`${botName} +
+ {`${botName}
@@ -65,20 +64,11 @@ export function SelectedBotMobileView({
- - + +

+ + Start Chatting Below +

diff --git a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx index 36a156d3..edd230e9 100644 --- a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx +++ b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx @@ -1,8 +1,7 @@ -import { Button } from '@/components/ui/button' import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card' import { cn } from '@/lib/utils' import type { ChatbotDetailsProps } from '@/types/types' -import { PanelLeft, MessageSquarePlus, Bot } from 'lucide-react' +import { ArrowBigLeft, ArrowBigDown, Bot } from 'lucide-react' import Image from 'next/image' export function OnboardingChatbotDetails({ @@ -16,7 +15,7 @@ export function OnboardingChatbotDetails({
{/* Background tooltip effect */} - {isWelcomeView && ( + {/* {isWelcomeView && (
- )} + )} */} @@ -67,15 +66,10 @@ export function OnboardingChatbotDetails({ {isWelcomeView && (
-

- Pick a Bot and Start Chatting +

+ + Go To Sidebar And Select One Bot

-
- -

- Find Your Favorite Bot in the Sidebar -

-
)} @@ -83,21 +77,12 @@ export function OnboardingChatbotDetails({ {!isWelcomeView && (
- +
+

+ + Start Chatting Below +

+
)} From fed4c2bf68a0a2073b2bbc7c74dd19f35ec6ab64 Mon Sep 17 00:00:00 2001 From: Bran18 Date: Tue, 24 Dec 2024 11:40:01 -0600 Subject: [PATCH 06/13] chore: delete public and private sw + icons --- .../components/routes/chat/chat-options.tsx | 9 +-------- .../components/routes/thread/thread-popup.tsx | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/masterbots.ai/components/routes/chat/chat-options.tsx b/apps/masterbots.ai/components/routes/chat/chat-options.tsx index 06c9f68a..8ddaa8d5 100644 --- a/apps/masterbots.ai/components/routes/chat/chat-options.tsx +++ b/apps/masterbots.ai/components/routes/chat/chat-options.tsx @@ -19,7 +19,7 @@ import { } from '@/components/ui/dropdown-menu' import { IconSpinner } from '@/components/ui/icons' import { useThreadVisibility } from '@/lib/hooks/use-thread-visibility' -import { BadgeCheck, Eye, EyeOff, MoreVertical, Trash } from 'lucide-react' +import { Eye, EyeOff, MoreVertical, Trash } from 'lucide-react' import type { Thread } from 'mb-genql' import { toSlug } from 'mb-lib' import type React from 'react' @@ -100,13 +100,6 @@ export function ChatOptions({ threadId, thread, isBrowse }: ChatOptionsProps) { {!isBrowse && (
-
- {thread?.isApproved ? ( - - ) : ( - - )} -
{thread?.isPublic ? 'Public' : 'Private'} diff --git a/apps/masterbots.ai/components/routes/thread/thread-popup.tsx b/apps/masterbots.ai/components/routes/thread/thread-popup.tsx index 28606385..eee649e4 100644 --- a/apps/masterbots.ai/components/routes/thread/thread-popup.tsx +++ b/apps/masterbots.ai/components/routes/thread/thread-popup.tsx @@ -169,7 +169,6 @@ export function ThreadPopUpCardHeader({ messages }: { messages: AiMessage[] }) {
- From 5120cf37eb955c648dac356e1215618c8b25b1b2 Mon Sep 17 00:00:00 2001 From: Bran18 Date: Fri, 27 Dec 2024 11:47:17 -0600 Subject: [PATCH 07/13] chore: include public + delete extra actions --- apps/masterbots.ai/app/globals.css | 8 +- .../components/layout/header/header.tsx | 8 +- .../layout/sidebar/profile-sidebar.tsx | 57 ++++---- .../components/layout/sidebar/sidebar.tsx | 25 ++-- .../components/routes/chat/chat-options.tsx | 8 -- .../chat/onboarding-chatbot-details.tsx | 132 ++++++++---------- .../components/routes/chat/prompt-form.tsx | 3 +- 7 files changed, 109 insertions(+), 132 deletions(-) diff --git a/apps/masterbots.ai/app/globals.css b/apps/masterbots.ai/app/globals.css index 39a6add9..9f7460e2 100644 --- a/apps/masterbots.ai/app/globals.css +++ b/apps/masterbots.ai/app/globals.css @@ -50,8 +50,8 @@ --tertiary-foreground: 0 0% 98%; --font-size-base: 1rem; - --background-sidebar-gradient: linear-gradient(180deg, rgba(190, 22, 232, 0.2) 0%, rgba(190, 22, 232, 0.4) 100%); - --background-sidebar-hover-gradient: linear-gradient(180deg, rgba(190, 22, 232, 0.1) 0%, rgba(190, 22, 232, 0.3) 100%); + --background-sidebar-gradient: linear-gradient(180deg, rgba(155, 22, 232, 0.2) 0%, rgba(190, 22, 232, 0.53) 100%); + --background-sidebar-hover-gradient: linear-gradient(-180deg, rgba(166, 22, 232, 0.1) 0%, rgba(190, 22, 232, 0.3) 100%); } .dark { @@ -98,8 +98,8 @@ --tertiary: 120, 100%, 65%; --tertiary-foreground: 0 0% 98%; - --background-sidebar-gradient: linear-gradient(180deg, rgba(130, 228, 110, 0.2) 0%, rgba(130, 228, 110, 0.4) 100%); - --background-sidebar-hover-gradient: linear-gradient(180deg, rgba(130, 228, 110, 0.1) 0%, rgba(130, 228, 110, 0.3) 100%); + --background-sidebar-gradient: linear-gradient(180deg, rgba(115, 201, 97, 0.2) 0%, rgba(122, 214, 104, 0.4) 100%); + --background-sidebar-hover-gradient: linear-gradient(-180deg, rgba(113, 199, 96, 0.1) 0%, rgba(117, 205, 99, 0.3) 100%); } } diff --git a/apps/masterbots.ai/components/layout/header/header.tsx b/apps/masterbots.ai/components/layout/header/header.tsx index 7e926359..bc58e012 100644 --- a/apps/masterbots.ai/components/layout/header/header.tsx +++ b/apps/masterbots.ai/components/layout/header/header.tsx @@ -20,12 +20,8 @@ export function Header() {
- {appConfig.features.devMode && ( - <> - - - - )} + + {appConfig.features.devMode && }
diff --git a/apps/masterbots.ai/components/layout/sidebar/profile-sidebar.tsx b/apps/masterbots.ai/components/layout/sidebar/profile-sidebar.tsx index 7707d1e3..6eb1cd62 100644 --- a/apps/masterbots.ai/components/layout/sidebar/profile-sidebar.tsx +++ b/apps/masterbots.ai/components/layout/sidebar/profile-sidebar.tsx @@ -43,16 +43,18 @@ export function ProfileSidebar({ user }: ProfileSidebarProps) { } }, []) - const goToProfile = useCallback((e: React.MouseEvent) => { - e.preventDefault() - e.stopPropagation() - const userSlug = toSlugWithUnderScore(user.name || '') - if (userSlug) { - setIsOpen(false) - router.push(`/u/${userSlug}/t`) - } - }, [router, user.name]) - + const goToProfile = useCallback( + (e: React.MouseEvent) => { + e.preventDefault() + e.stopPropagation() + const userSlug = toSlugWithUnderScore(user.name || '') + if (userSlug) { + setIsOpen(false) + router.push(`/u/${userSlug}/t`) + } + }, + [router, user.name] + ) return ( @@ -115,32 +117,31 @@ export function ProfileSidebar({ user }: ProfileSidebarProps) { Chat - {appConfig.features.devMode && ( - - )} - {appConfig.features.devMode && ( - + <> + + + )} diff --git a/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx b/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx index 308ff070..ab0b441a 100644 --- a/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx +++ b/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx @@ -10,34 +10,31 @@ import { useThread } from '@/lib/hooks/use-thread' export function Sidebar({ className }: React.ComponentProps<'div'>) { const { isSidebarOpen, isLoading } = useSidebar() - const prevPathRef = React.useRef(usePathname()); - const pathname = usePathname(); - const { setActiveThread, setIsOpenPopup } = useThread() - const rootAndChatRegex = /^\/(?:c)?$/; + const prevPathRef = React.useRef(usePathname()) + const pathname = usePathname() + const { setActiveThread, setIsOpenPopup } = useThread() + const rootAndChatRegex = /^\/(?:c)?$/ + // biome-ignore lint/correctness/useExhaustiveDependencies: React.useEffect(() => { if (rootAndChatRegex.test(pathname)) { - setActiveThread(null); - setIsOpenPopup(false); + setActiveThread(null) + setIsOpenPopup(false) } - prevPathRef.current = pathname; - }, [pathname]); + prevPathRef.current = pathname + }, [pathname]) - if (isLoading) return null return ( <>

- + Threads: {chatbot.threads.length} @@ -65,7 +65,7 @@ export function BrowseChatbotMobileDetails({ alt={`${chatbot.name} avatar`} width={74} height={74} - className="object-cover size-full p-0 m-0" + className="object-cover p-0 m-0 size-full" />
From e2b35c45d50e2590df09b5721099fbad9aee5a8b Mon Sep 17 00:00:00 2001 From: Bran18 Date: Tue, 21 Jan 2025 20:57:27 -0600 Subject: [PATCH 13/13] chore:add latest --- apps/masterbots.ai/components/layout/sidebar/sidebar.tsx | 2 +- apps/masterbots.ai/next-env.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx b/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx index 8ce92887..753dc718 100644 --- a/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx +++ b/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx @@ -35,7 +35,7 @@ export function Sidebar({ className }: React.ComponentProps<'div'>) { className, 'h-full flex flex-col z-40', isChatRoute - ? 'bg-[#fae8ff] dark:bg-[#17021D]' // For /c routes + ? 'bg-[#fae8ff] dark:bg-[#17021D]' // For /c routes only : 'bg-[#eeffea] dark:bg-[#0B1608]' // For other routes )} > diff --git a/apps/masterbots.ai/next-env.d.ts b/apps/masterbots.ai/next-env.d.ts index 40c3d680..1b3be084 100644 --- a/apps/masterbots.ai/next-env.d.ts +++ b/apps/masterbots.ai/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.