From 69bdfa5df16b15e5f17f7ed0c0e4aaebe31c4833 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 29 Jan 2026 23:36:01 -0600 Subject: [PATCH] fix: code review cleanup - Fixed TypeScript exactOptionalPropertyTypes errors in chat components - Removed console.error statements (errors are handled via state) - Fixed type compatibility issues with undefined vs null values - All chat-related files now pass strict TypeScript checks --- apps/web/src/components/chat/Chat.tsx | 6 +++--- apps/web/src/components/chat/ConversationSidebar.tsx | 8 ++++---- apps/web/src/hooks/useChat.ts | 10 +++++----- apps/web/src/lib/api/ideas.ts | 7 +++++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/apps/web/src/components/chat/Chat.tsx b/apps/web/src/components/chat/Chat.tsx index 3ccc5f1..64abf8e 100644 --- a/apps/web/src/components/chat/Chat.tsx +++ b/apps/web/src/components/chat/Chat.tsx @@ -66,9 +66,9 @@ export const Chat = forwardRef(function Chat({ clearError, } = useChat({ model: "llama3.2", - projectId: initialProjectId, - onError: (err) => { - console.error("Chat error:", err); + ...(initialProjectId !== undefined && { projectId: initialProjectId }), + onError: (_err) => { + // Error is handled by the useChat hook's state }, }); diff --git a/apps/web/src/components/chat/ConversationSidebar.tsx b/apps/web/src/components/chat/ConversationSidebar.tsx index fe1db0d..3133b19 100644 --- a/apps/web/src/components/chat/ConversationSidebar.tsx +++ b/apps/web/src/components/chat/ConversationSidebar.tsx @@ -54,9 +54,9 @@ export const ConversationSidebar = forwardRef { - return updateIdea(id, { content, title }); + return updateIdea(id, { + content, + ...(title !== undefined && { title }) + }); }