From 2ac840e3f2b1dbcc93f027a6930ba6d8f296f3be Mon Sep 17 00:00:00 2001 From: Debanjum Date: Mon, 28 Oct 2024 16:26:23 -0700 Subject: [PATCH 01/33] Make cursor in chat input take on selected agent color --- src/interface/web/app/common/colorUtils.ts | 7 +++++++ .../web/app/components/chatInputArea/chatInputArea.tsx | 10 +++++++--- src/interface/web/tailwind.config.ts | 5 +++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/interface/web/app/common/colorUtils.ts b/src/interface/web/app/common/colorUtils.ts index 6cd57a64..a7eabb03 100644 --- a/src/interface/web/app/common/colorUtils.ts +++ b/src/interface/web/app/common/colorUtils.ts @@ -42,6 +42,13 @@ export function converColorToBgGradient(color: string) { return `${convertToBGGradientClass(color)} dark:border dark:border-neutral-700`; } +export function convertColorToCaretClass(color: string | undefined) { + if (color && tailwindColors.includes(color)) { + return `caret-${color}-500`; + } + return `caret-orange-500`; +} + export function convertColorToRingClass(color: string | undefined) { if (color && tailwindColors.includes(color)) { return `focus-visible:ring-${color}-500`; diff --git a/src/interface/web/app/components/chatInputArea/chatInputArea.tsx b/src/interface/web/app/components/chatInputArea/chatInputArea.tsx index b60228df..7d349081 100644 --- a/src/interface/web/app/components/chatInputArea/chatInputArea.tsx +++ b/src/interface/web/app/components/chatInputArea/chatInputArea.tsx @@ -37,7 +37,11 @@ import { Popover, PopoverContent } from "@/components/ui/popover"; import { PopoverTrigger } from "@radix-ui/react-popover"; import { Textarea } from "@/components/ui/textarea"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; -import { convertColorToTextClass, convertToBGClass } from "@/app/common/colorUtils"; +import { + convertColorToCaretClass, + convertColorToTextClass, + convertToBGClass, +} from "@/app/common/colorUtils"; import LoginPrompt from "../loginPrompt/loginPrompt"; import { uploadDataForIndexing } from "../../common/chatFunctions"; @@ -494,8 +498,8 @@ export const ChatInputArea = forwardRef((pr