diff options
Diffstat (limited to 'apps/web/components/new/chat')
5 files changed, 13 insertions, 8 deletions
diff --git a/apps/web/components/new/chat/index.tsx b/apps/web/components/new/chat/index.tsx index 3460c456..08f4e2ef 100644 --- a/apps/web/components/new/chat/index.tsx +++ b/apps/web/components/new/chat/index.tsx @@ -14,7 +14,7 @@ import { SquarePenIcon, } from "lucide-react" import { cn } from "@lib/utils" -import { dmSansClassName } from "@/utils/fonts" +import { dmSansClassName } from "@/lib/fonts" import ChatInput from "./input" import ChatModelSelector from "./model-selector" import { GradientLogo, LogoBgGradient } from "@ui/assets/Logo" @@ -110,7 +110,6 @@ export function ChatSidebar({ }, }, }), - maxSteps: 10, onFinish: async (result) => { if (result.message.role !== "assistant") return @@ -285,14 +284,20 @@ export function ChatSidebar({ useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { + const activeElement = document.activeElement as HTMLElement | null + const isInEditableContext = + activeElement?.tagName === "INPUT" || + activeElement?.tagName === "TEXTAREA" || + activeElement?.isContentEditable || + activeElement?.closest('[contenteditable="true"]') + if ( e.key.toLowerCase() === "t" && !e.metaKey && !e.ctrlKey && !e.altKey && isChatOpen && - document.activeElement?.tagName !== "INPUT" && - document.activeElement?.tagName !== "TEXTAREA" + !isInEditableContext ) { e.preventDefault() handleNewChat() diff --git a/apps/web/components/new/chat/input/chain-of-thought.tsx b/apps/web/components/new/chat/input/chain-of-thought.tsx index 0371a97e..b1923146 100644 --- a/apps/web/components/new/chat/input/chain-of-thought.tsx +++ b/apps/web/components/new/chat/input/chain-of-thought.tsx @@ -2,7 +2,7 @@ import { useAuth } from "@lib/auth-context" import { Avatar, AvatarFallback, AvatarImage } from "@ui/components/avatar" import type { UIMessage } from "@ai-sdk/react" import { cn } from "@lib/utils" -import { dmSansClassName } from "@/utils/fonts" +import { dmSansClassName } from "@/lib/fonts" interface MemoryResult { documentId?: string diff --git a/apps/web/components/new/chat/input/index.tsx b/apps/web/components/new/chat/input/index.tsx index 4294add5..40c1949d 100644 --- a/apps/web/components/new/chat/input/index.tsx +++ b/apps/web/components/new/chat/input/index.tsx @@ -3,7 +3,7 @@ import { ChevronUpIcon } from "lucide-react" import NovaOrb from "@/components/nova/nova-orb" import { cn } from "@lib/utils" -import { dmSansClassName } from "@/utils/fonts" +import { dmSansClassName } from "@/lib/fonts" import { useRef, useState } from "react" import { motion } from "motion/react" import { SendButton, StopButton } from "./actions" diff --git a/apps/web/components/new/chat/message/related-memories.tsx b/apps/web/components/new/chat/message/related-memories.tsx index f3b406db..ad83d03e 100644 --- a/apps/web/components/new/chat/message/related-memories.tsx +++ b/apps/web/components/new/chat/message/related-memories.tsx @@ -1,6 +1,6 @@ import { ChevronDownIcon, ChevronUpIcon } from "lucide-react" import type { UIMessage } from "@ai-sdk/react" -import { dmSansClassName } from "@/utils/fonts" +import { dmSansClassName } from "@/lib/fonts" import { cn } from "@lib/utils" interface MemoryResult { diff --git a/apps/web/components/new/chat/model-selector.tsx b/apps/web/components/new/chat/model-selector.tsx index 9cecafc2..c1952bea 100644 --- a/apps/web/components/new/chat/model-selector.tsx +++ b/apps/web/components/new/chat/model-selector.tsx @@ -3,7 +3,7 @@ import { useState } from "react" import { cn } from "@lib/utils" import { Button } from "@ui/components/button" -import { dmSansClassName } from "@/utils/fonts" +import { dmSansClassName } from "@/lib/fonts" import { ChevronDownIcon } from "lucide-react" import { models, type ModelId, modelNames } from "@/lib/models" |