diff --git a/apps/shinkai-desktop/src/components/chat/conversation-footer.tsx b/apps/shinkai-desktop/src/components/chat/conversation-footer.tsx index b6ae2fe25..6ca0d2fee 100644 --- a/apps/shinkai-desktop/src/components/chat/conversation-footer.tsx +++ b/apps/shinkai-desktop/src/components/chat/conversation-footer.tsx @@ -56,7 +56,7 @@ import { cn } from '@shinkai_network/shinkai-ui/utils'; import { partial } from 'filesize'; import { AnimatePresence, motion } from 'framer-motion'; import { Paperclip, X, XIcon } from 'lucide-react'; -import { useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { useDropzone } from 'react-dropzone'; import { useForm, useWatch } from 'react-hook-form'; import { useLocation, useNavigate, useParams } from 'react-router-dom'; @@ -571,6 +571,7 @@ function ConversationChatFooter({ inboxId }: { inboxId: string }) { (state) => state.setWorkflowSelected, ); + const textareaRef = useRef(null); const auth = useAuth((state) => state.auth); const { captureAnalyticEvent } = useAnalytics(); @@ -732,6 +733,11 @@ function ConversationChatFooter({ inboxId }: { inboxId: string }) { useEffect(() => { if (promptSelected) { chatForm.setValue('message', promptSelected.prompt); + setTimeout(() => { + if (!textareaRef.current) return; + textareaRef.current.scrollTop = textareaRef.current.scrollHeight; + textareaRef.current.focus(); + }, 10); } }, [chatForm, promptSelected]); @@ -744,9 +750,7 @@ function ConversationChatFooter({ inboxId }: { inboxId: string }) {
{workflowSelected && ( diff --git a/apps/shinkai-desktop/src/components/prompt/context/prompt-selection-context.tsx b/apps/shinkai-desktop/src/components/prompt/context/prompt-selection-context.tsx index 8c0dba752..9c84bf804 100644 --- a/apps/shinkai-desktop/src/components/prompt/context/prompt-selection-context.tsx +++ b/apps/shinkai-desktop/src/components/prompt/context/prompt-selection-context.tsx @@ -28,7 +28,6 @@ import { Textarea, TextField, } from '@shinkai_network/shinkai-ui'; -import { formatText } from '@shinkai_network/shinkai-ui/helpers'; import { cn } from '@shinkai_network/shinkai-ui/utils'; import { Edit3Icon, @@ -223,22 +222,47 @@ const PromptSearchDrawer = () => { {searchQuery && isSearchQuerySynced && searchPromptList?.map((prompt) => ( - +
+ + + +
+ {prompt.name} +
))} {searchQuery && isSearchQuerySynced && @@ -333,7 +357,7 @@ export function CreatePromptDrawer({ )} - + Create custom prompt
@@ -359,7 +383,7 @@ export function CreatePromptDrawer({