From 50fbc0dab2fdabab6b27f0fd24c9390408806f29 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 20 Dec 2024 23:07:23 +0530 Subject: [PATCH] fix: tweak styles (#645) --- app/(chat)/api/chat/route.ts | 5 +++-- app/(chat)/chat/[id]/page.tsx | 18 +++++++++++------- components/app-sidebar.tsx | 2 -- components/document-preview.tsx | 12 ++++++++---- components/message.tsx | 4 +++- components/multimodal-input.tsx | 6 +++--- components/sidebar-history.tsx | 10 ++++------ components/suggested-actions.tsx | 8 ++++---- components/toolbar.tsx | 4 ++-- lib/ai/prompts.ts | 5 +++++ 10 files changed, 43 insertions(+), 31 deletions(-) diff --git a/app/(chat)/api/chat/route.ts b/app/(chat)/api/chat/route.ts index 94157d0..db8a0cd 100644 --- a/app/(chat)/api/chat/route.ts +++ b/app/(chat)/api/chat/route.ts @@ -123,7 +123,8 @@ export async function POST(request: Request) { }, }, createDocument: { - description: 'Create a document for a writing activity.', + description: + 'Create a document for a writing activity. This tool will call other functions that will generate the contents of the document based on the title and kind.', parameters: z.object({ title: z.string(), kind: z.enum(['text', 'code']), @@ -226,7 +227,7 @@ export async function POST(request: Request) { }, }, updateDocument: { - description: 'Update a document with the given description', + description: 'Update a document with the given description.', parameters: z.object({ id: z.string().describe('The ID of the document to update'), description: z diff --git a/app/(chat)/chat/[id]/page.tsx b/app/(chat)/chat/[id]/page.tsx index c76cd96..3a83db2 100644 --- a/app/(chat)/chat/[id]/page.tsx +++ b/app/(chat)/chat/[id]/page.tsx @@ -6,6 +6,7 @@ import { Chat } from '@/components/chat'; import { DEFAULT_MODEL_NAME, models } from '@/lib/ai/models'; import { getChatById, getMessagesByChatId } from '@/lib/db/queries'; import { convertToUIMessages } from '@/lib/utils'; +import { DataStreamHandler } from '@/components/data-stream-handler'; export default async function Page(props: { params: Promise<{ id: string }> }) { const params = await props.params; @@ -39,12 +40,15 @@ export default async function Page(props: { params: Promise<{ id: string }> }) { DEFAULT_MODEL_NAME; return ( - + <> + + + ); } diff --git a/components/app-sidebar.tsx b/components/app-sidebar.tsx index 9926a7f..5b08bb5 100644 --- a/components/app-sidebar.tsx +++ b/components/app-sidebar.tsx @@ -11,8 +11,6 @@ import { Sidebar, SidebarContent, SidebarFooter, - SidebarGroup, - SidebarGroupContent, SidebarHeader, SidebarMenu, useSidebar, diff --git a/components/document-preview.tsx b/components/document-preview.tsx index fa1d90b..29d6411 100644 --- a/components/document-preview.tsx +++ b/components/document-preview.tsx @@ -167,7 +167,13 @@ const PureHitboxLayer = ({ onClick={handleClick} role="presentation" aria-hidden="true" - /> + > +
+
+ +
+
+ ); }; @@ -196,9 +202,7 @@ const PureDocumentHeader = ({
{title}
-
- -
+
); diff --git a/components/message.tsx b/components/message.tsx index e604761..daea57f 100644 --- a/components/message.tsx +++ b/components/message.tsx @@ -62,7 +62,9 @@ const PurePreviewMessage = ({ > {message.role === 'assistant' && (
- +
+ +
)} diff --git a/components/multimodal-input.tsx b/components/multimodal-input.tsx index 8b9faf6..b0d9863 100644 --- a/components/multimodal-input.tsx +++ b/components/multimodal-input.tsx @@ -23,7 +23,7 @@ import { useLocalStorage, useWindowSize } from 'usehooks-ts'; import { sanitizeUIMessages } from '@/lib/utils'; -import { ArrowUpIcon, ImageIcon, PaperclipIcon, StopIcon } from './icons'; +import { ArrowUpIcon, PaperclipIcon, StopIcon } from './icons'; import { PreviewAttachment } from './preview-attachment'; import { Button } from './ui/button'; import { Textarea } from './ui/textarea'; @@ -293,7 +293,7 @@ function PureAttachmentsButton({ disabled={isLoading} variant="ghost" > - + ); } @@ -349,6 +349,6 @@ function PureSendButton({ const SendButton = memo(PureSendButton, (prevProps, nextProps) => { if (prevProps.uploadQueue.length !== nextProps.uploadQueue.length) return false; - if (!prevProps.input !== !nextProps.input) return false; + if (prevProps.input !== nextProps.input) return false; return true; }); diff --git a/components/sidebar-history.tsx b/components/sidebar-history.tsx index 4f41a0b..6aa18c0 100644 --- a/components/sidebar-history.tsx +++ b/components/sidebar-history.tsx @@ -197,8 +197,8 @@ export function SidebarHistory({ user }: { user: User | undefined }) { return ( -
-
Login to save and revisit previous chats!
+
+ Login to save and revisit previous chats!
@@ -238,10 +238,8 @@ export function SidebarHistory({ user }: { user: User | undefined }) { return ( -
-
- Your conversations will appear here once you start chatting! -
+
+ Your conversations will appear here once you start chatting!
diff --git a/components/suggested-actions.tsx b/components/suggested-actions.tsx index 6e07b43..65f713f 100644 --- a/components/suggested-actions.tsx +++ b/components/suggested-actions.tsx @@ -22,13 +22,13 @@ function PureSuggestedActions({ chatId, append }: SuggestedActionsProps) { }, { title: 'Write code that', - label: `demonstrates djikstra's algorithm!`, - action: `Write code that demonstrates djikstra's algorithm!`, + label: `demonstrates djikstra's algorithm`, + action: `Write code that demonstrates djikstra's algorithm`, }, { title: 'Help me write an essay', - label: `about silicon valley!`, - action: `Help me write an essay about silicon valley!`, + label: `about silicon valley`, + action: `Help me write an essay about silicon valley`, }, { title: 'What is the weather', diff --git a/components/toolbar.tsx b/components/toolbar.tsx index 41f1bb2..8cb9aee 100644 --- a/components/toolbar.tsx +++ b/components/toolbar.tsx @@ -353,7 +353,7 @@ export const Tools = ({ return (