-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: fix initial sent message not showing and creating conversation load #2871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds client-side directives to chat input and messages components; refactors ChatMessages typing, streaming extraction, and empty-state handling; tweaks stream-message padding; replaces ChatTab loading fallback with a centered spinner; removes a debug log and an ESLint suppression; and updates ChatConversation shape (title required, suggestions moved top-level) with corresponding DB mapper changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant CT as ChatTab
participant API as api.chat.message.getAll
participant CTC as ChatTabContent
U->>CT: Open Chat tab
CT->>API: useQuery(conversationId, enabled)
API-->>CT: data (messages | undefined), isLoading
alt isLoading or no initialMessages
CT-->>CT: Render loading panel (Icons.LoadingSpinner + "Loading messages...")
else
CT->>CTC: Render ChatTabContent with initialMessages, conversationId, projectId
end
sequenceDiagram
autonumber
participant Props as Parent/Store
participant CM as ChatMessages (client)
participant UI as ChatMessageList / EmptyState
Props-->>CM: { messages: baseMessages, isStreaming, error, onEditMessage }
CM->>CM: useMemo compute { messages, streamedMessage }:
note right of CM: If isStreaming and last baseMessage.role==='assistant',\nexclude last from messages and set streamedMessage
alt No messages and no editor selection
CM-->>UI: Render EmptyState
else Messages exist
CM-->>UI: Render ChatMessageList (messages)
opt streamedMessage present
CM-->>UI: Render streamedMessage separately
end
end
opt error present
CM-->>UI: Render error block
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsx (3)
155-158: Use internationalization for placeholder text.The ASK mode placeholder text is hardcoded as "Ask a question about your project..." but should use the internationalization system like the EDIT mode does.
Apply this diff to use internationalization consistently:
const getPlaceholderText = () => { if (chatMode === ChatType.ASK) { - return 'Ask a question about your project...'; + return t(transKeys.editor.panels.edit.tabs.chat.input.placeholderAsk); } return t(transKeys.editor.panels.edit.tabs.chat.input.placeholder); };You'll need to add the corresponding translation key to your i18n configuration.
267-267: Use internationalization for toast message.The screenshot success toast message "Screenshot added to chat" should use internationalization.
- toast.success('Screenshot added to chat'); + toast.success(t(transKeys.editor.panels.edit.tabs.chat.screenshotAdded));
418-418: Use internationalization for tooltip content.The "Stop response" tooltip text should use internationalization.
- <TooltipContent>{'Stop response'}</TooltipContent> + <TooltipContent>{t(transKeys.editor.panels.edit.tabs.chat.stopResponse)}</TooltipContent>apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx (1)
91-91: Consider simplifying the contentKey logic.The contentKey computation is complex and could be simplified for better maintainability.
Consider extracting this logic to a helper function or simplifying it:
+const getContentKey = (messages: ChatMessage[], isStreaming: boolean): string => { + const messageIds = messages.map(m => m.id).join('|'); + if (!isStreaming) return messageIds; + const lastMessageId = messages[messages.length - 1]?.id ?? ''; + return `${messageIds}|${lastMessageId}`; +}; return ( <ChatMessageList - contentKey={`${messages.map((m) => m.id).join('|')}${isStreaming ? `|${messages?.[messages.length - 1]?.id ?? ''}` : ''}`} + contentKey={getContentKey(messages, isStreaming)} >
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsx(1 hunks)apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx(2 hunks)apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsx(1 hunks)apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsx(1 hunks)apps/web/client/src/app/project/[id]/_components/right-panel/index.tsx(0 hunks)apps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsx(1 hunks)
💤 Files with no reviewable changes (1)
- apps/web/client/src/app/project/[id]/_components/right-panel/index.tsx
🧰 Additional context used
📓 Path-based instructions (6)
apps/web/client/src/app/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
apps/web/client/src/app/**/*.tsx: Default to Server Components; add 'use client' when using events, state/effects, browser APIs, or client‑only libraries
Do not use process.env in client code; import env from @/env insteadAvoid hardcoded user-facing text; use next-intl messages/hooks
Files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsxapps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
apps/web/client/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
apps/web/client/src/**/*.{ts,tsx}: Use path aliases @/* and ~/* for imports that map to apps/web/client/src/*
Avoid hardcoded user-facing text; use next-intl messages/hooks insteadUse path aliases @/* and ~/* for imports mapping to src/*
Files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsxapps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
apps/web/client/src/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
apps/web/client/src/**/*.tsx: Create MobX store instances with useState(() => new Store()) for stable references across renders
Keep the active MobX store in a useRef and perform async cleanup with setTimeout(() => storeRef.current?.clear(), 0) to avoid route-change races
Avoid useMemo for creating MobX store instances
Avoid putting the MobX store instance in effect dependency arrays if it causes loops; split concerns by domain
apps/web/client/src/**/*.tsx: Create MobX store instances with useState(() => new Store()) for stable identities across renders
Keep the active MobX store in a useRef and clean up asynchronously with setTimeout(() => storeRef.current?.clear(), 0)
Do not use useMemo to create MobX stores
Avoid placing MobX store instances in effect dependency arrays if it causes loops; split concerns instead
observer components must be client components; place a single client boundary at the feature entry; child observers need not repeat 'use client'
Files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsxapps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Do not use the any type unless necessary
Files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsxapps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
apps/web/client/src/app/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Default to Server Components; add 'use client' only when using events, state/effects, browser APIs, or client-only libs
Files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsxapps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
{apps,packages}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Avoid using the any type unless absolutely necessary
Files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsxapps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
🧠 Learnings (6)
📚 Learning: 2025-09-14T01:44:21.209Z
Learnt from: CR
PR: onlook-dev/onlook#0
File: AGENTS.md:0-0
Timestamp: 2025-09-14T01:44:21.209Z
Learning: Applies to apps/web/client/src/app/**/*.tsx : Default to Server Components; add 'use client' when using events, state/effects, browser APIs, or client‑only libraries
Applied to files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
📚 Learning: 2025-09-16T19:22:52.461Z
Learnt from: CR
PR: onlook-dev/onlook#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-16T19:22:52.461Z
Learning: Applies to apps/web/client/src/app/**/*.{ts,tsx} : Default to Server Components; add 'use client' only when using events, state/effects, browser APIs, or client-only libs
Applied to files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsx
📚 Learning: 2025-09-16T19:22:52.461Z
Learnt from: CR
PR: onlook-dev/onlook#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-16T19:22:52.461Z
Learning: Applies to apps/web/client/src/**/*.tsx : observer components must be client components; place a single client boundary at the feature entry; child observers need not repeat 'use client'
Applied to files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
📚 Learning: 2025-09-14T01:44:21.209Z
Learnt from: CR
PR: onlook-dev/onlook#0
File: AGENTS.md:0-0
Timestamp: 2025-09-14T01:44:21.209Z
Learning: Applies to apps/web/client/src/**/*.{ts,tsx} : Avoid hardcoded user-facing text; use next-intl messages/hooks instead
Applied to files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
📚 Learning: 2025-09-16T19:22:52.461Z
Learnt from: CR
PR: onlook-dev/onlook#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-16T19:22:52.461Z
Learning: Applies to apps/web/client/src/app/**/*.tsx : Avoid hardcoded user-facing text; use next-intl messages/hooks
Applied to files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsxapps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsxapps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx
📚 Learning: 2025-09-14T01:44:21.209Z
Learnt from: CR
PR: onlook-dev/onlook#0
File: AGENTS.md:0-0
Timestamp: 2025-09-14T01:44:21.209Z
Learning: Applies to apps/web/client/src/trpc/react.tsx : Keep tRPC React client provider(s) behind a client boundary (ensure this provider file is a client component)
Applied to files:
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsx
🧬 Code graph analysis (2)
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsx (1)
apps/web/client/src/trpc/react.tsx (1)
api(23-23)
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx (6)
apps/web/client/src/components/store/editor/index.tsx (1)
useEditorEngine(10-14)packages/models/src/chat/message/message.ts (1)
ChatMessage(18-18)apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/assistant-message.tsx (1)
AssistantMessage(4-15)apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/user-message.tsx (1)
UserMessage(29-264)apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsx (1)
StreamMessage(6-27)apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/error-message.tsx (1)
ErrorMessage(11-63)
🔇 Additional comments (7)
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/stream-message.tsx (1)
12-12: Spacing change looks good.The switch from
py-2(vertical padding) topt-2(top padding only) is appropriate for the stream message layout, preventing excessive spacing between the message content and the loading indicator below.apps/web/client/src/app/project/[id]/_hooks/use-chat/index.tsx (1)
229-238: Clean return statement formatting.The multi-line object literal formatting improves readability and is consistent with React hook conventions.
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-input/index.tsx (1)
1-1: Correct use of client directive.Adding
'use client'is appropriate here as the component uses React hooks, event handlers, drag-and-drop, clipboard operations, and other browser APIs that require client-side rendering.apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsx (1)
10-13: Good defensive programming with default value.Using destructuring with a default empty array prevents potential runtime errors if the query returns undefined, ensuring ChatTabContent always receives a valid array.
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/chat-messages/index.tsx (3)
1-2: Appropriate client component conversion.Adding
'use client'is correct since this component uses hooks likeuseMemo,useCallback, and the MobXobserverHOC, all requiring client-side rendering.
33-47: Well-structured streaming logic with proper typing.The refactored streaming logic is cleaner and more type-safe. The explicit type annotation for the memoized result improves code clarity and prevents type inference issues.
76-87: Good empty state handling.The empty state now correctly shows only when there are no messages AND no elements selected, preventing confusing UI states.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/db/src/mappers/chat/conversation.ts (1)
12-18: Critical: don’t spread ChatConversation into DbConversation — omit chat-only fields and use nullish coalescingSpreading the source leaks Chat-only fields (e.g., title) into the DB shape and the current
||coalescing collapses valid falsy values; removetitle/suggestionsfrom the spread and use??.File: packages/db/src/mappers/chat/conversation.ts (both fromDbConversation and toDbConversation)
Suggested change for toDbConversation (apply the symmetric pattern to fromDbConversation — destructure/omit displayName before returning and use
??):export const toDbConversation = (conversation: ChatConversation): DbConversation => { - return { - ...conversation, - projectId: conversation.projectId, - displayName: conversation.title || null, - suggestions: conversation.suggestions || [], - } + const { title, suggestions, ...rest } = + conversation as ChatConversation & Record<string, unknown>; + return { + ...(rest as Omit<DbConversation, 'displayName' | 'suggestions'>), + displayName: title ?? null, + suggestions: (suggestions as ChatConversation['suggestions']) ?? [], + } as DbConversation }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsx(2 hunks)apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/suggestions.tsx(0 hunks)packages/db/src/mappers/chat/conversation.ts(2 hunks)packages/models/src/chat/conversation/index.ts(1 hunks)
💤 Files with no reviewable changes (1)
- apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/suggestions.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/index.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Do not use the any type unless necessary
Files:
packages/models/src/chat/conversation/index.tspackages/db/src/mappers/chat/conversation.ts
{apps,packages}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Avoid using the any type unless absolutely necessary
Files:
packages/models/src/chat/conversation/index.tspackages/db/src/mappers/chat/conversation.ts
🧬 Code graph analysis (1)
packages/models/src/chat/conversation/index.ts (1)
packages/models/src/chat/suggestion.ts (1)
ChatSuggestion(9-12)
🔇 Additional comments (1)
packages/models/src/chat/conversation/index.ts (1)
9-9: Approve — keep non‑optionalsuggestions: ChatSuggestion[]Strongly typed non‑optional is preferable and the DB mapper defaulting to
[]complements this; repository search formetadata.suggestionsandconversation.metadatareturned no matches, so no cleanup required.
| title: conversation.displayName || null, | ||
| suggestions: conversation.suggestions || [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ?? instead of || and avoid spreading DB rows into model objects.
|| nullwill convert''tonull. Use?? nullto only default onnull/undefined.- Spreading
...conversation(a Db row) risks leaking DB‑only fields into the model and can trigger excess‑property issues.
Suggested refactor:
export const fromDbConversation = (conversation: DbConversation): ChatConversation => {
- return {
- ...conversation,
- title: conversation.displayName || null,
- suggestions: conversation.suggestions || [],
- }
+ return {
+ id: conversation.id,
+ title: conversation.displayName ?? null,
+ projectId: conversation.projectId,
+ createdAt: conversation.createdAt,
+ updatedAt: conversation.updatedAt,
+ suggestions: conversation.suggestions ?? [],
+ }
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| title: conversation.displayName || null, | |
| suggestions: conversation.suggestions || [], | |
| export const fromDbConversation = (conversation: DbConversation): ChatConversation => { | |
| return { | |
| id: conversation.id, | |
| title: conversation.displayName ?? null, | |
| projectId: conversation.projectId, | |
| createdAt: conversation.createdAt, | |
| updatedAt: conversation.updatedAt, | |
| suggestions: conversation.suggestions ?? [], | |
| } | |
| } |
🤖 Prompt for AI Agents
In packages/db/src/mappers/chat/conversation.ts around lines 7-8, the mapper
currently uses `||` which will coerce empty strings and falsy values incorrectly
and also may be spreading the DB row into the model; change
`conversation.displayName || null` to `conversation.displayName ?? null` and
`conversation.suggestions || []` to `conversation.suggestions ?? []`, and remove
any object spread of the raw DB row—explicitly construct the model by listing
only the allowed fields (e.g., id, title, suggestions, createdAt, updatedAt) so
DB-only columns are not leaked into the returned model.
| export interface ChatConversation { | ||
| id: string; | ||
| title?: string; | ||
| title: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Required title now allows null — verify call sites and prefer nullish coalescing.
Good change for explicitness. Ensure all producers/consumers set null (not undefined) and update any code that used optional title. Downstream, prefer ?? checks to avoid treating empty strings as falsy unintentionally.
Run a quick sweep for legacy optional access and falsy checks:
🏁 Script executed:
#!/bin/bash
# Legacy optional title usage
rg -nP --type=ts --type=tsx -C2 '\btitle\?\s*:|\.title\?\.'
# Falsy title checks that may collapse '' to null/false
rg -nP --type=ts --type=tsx -C2 '\bif\s*\(\s*!?\s*conversation\.title\b'Length of output: 55
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Searching for optional property declarations 'title?:' in TS/TSX/JS/JSX files"
rg -n -P --hidden -S '\btitle\?\s*:' -g '!**/node_modules/**' -g '**/*.ts' -g '**/*.tsx' -g '**/*.js' -g '**/*.jsx' -C2 || true
echo
echo "Searching for direct 'conversation.title' usages"
rg -n -P --hidden -S '\bconversation\.title\b' -g '!**/node_modules/**' -g '**/*.ts' -g '**/*.tsx' -g '**/*.js' -g '**/*.jsx' -C2 || true
echo
echo "Searching for optional chaining 'conversation?.title' usages"
rg -n -P --hidden -S 'conversation\?\.\s*title' -g '!**/node_modules/**' -g '**/*.ts' -g '**/*.tsx' -g '**/*.js' -g '**/*.jsx' -C2 || true
echo
echo "Searching for falsy checks like 'if (!conversation.title)' or 'if (conversation.title)'"
rg -n -P --hidden -S 'if\s*\(\s*!?\s*conversation\.title' -g '!**/node_modules/**' -g '**/*.ts' -g '**/*.tsx' -g '**/*.js' -g '**/*.jsx' -C2 || true
echo
echo "Searching for patterns that collapse empty string: '!conversation.title', 'conversation.title &&', 'conversation.title ??'"
rg -n -P --hidden -S '(!conversation\.title|conversation\.title\s*&&|conversation\.title\s*\?\?)' -g '!**/node_modules/**' -g '**/*.ts' -g '**/*.tsx' -g '**/*.js' -g '**/*.jsx' -C2 | head -n 200 || trueLength of output: 5709
Use nullish coalescing for conversation.title and ensure producers emit null
- packages/db/src/mappers/chat/conversation.ts:16 — replace
displayName: conversation.title || null
with
displayName: conversation.title ?? null - apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/history.tsx:91 already uses
conversation.title ?? 'New Conversation'(no change). - Search for producer sites that set/assign title (object literals /
.title =) and ensure they emitnull(notundefined) when no title exists.
🤖 Prompt for AI Agents
In packages/models/src/chat/conversation/index.ts around line 5, the
conversation.title field is typed as string | null; update call sites
(specifically packages/db/src/mappers/chat/conversation.ts around line 16) to
use nullish coalescing (conversation.title ?? null) instead of logical OR so
falsy non-null titles like empty string are preserved, and audit producer sites
that construct or assign conversation.title (object literals and .title =
assignments) to ensure they explicitly emit null (not undefined) when no title
exists; change any places returning undefined to return null and adjust any
factory/defaults to set title: null when appropriate.
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Important
Refactor chat components for client-side execution, fix rendering bugs, and adjust styles.
chat-input/index.tsxandchat-messages/index.tsx.chat-messages/index.tsxfor clarity.chat-tab/index.tsx.chat-messages/index.tsx.stream-message.tsx.stream-message.tsx.use-chat/index.tsx.This description was created by
for 64d3d3e. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit