Skip to content

ECHO-677 ECHO-676 show auto generated title in conversation accordian, overview real time#475

Merged
ussaama merged 2 commits intomainfrom
title-not-showing-conversations-fix
Mar 10, 2026
Merged

ECHO-677 ECHO-676 show auto generated title in conversation accordian, overview real time#475
ussaama merged 2 commits intomainfrom
title-not-showing-conversations-fix

Conversation

@ussaama
Copy link
Contributor

@ussaama ussaama commented Mar 10, 2026

  • Improved formatting and readability in ConversationEdit component.
  • Added title handling logic to ensure it syncs with conversation data.
  • Enhanced query invalidation in ProjectConversationOverview after mutation success to keep data consistent.
  • Minor adjustments to component imports for better organization.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed title synchronization in conversation editing so the title stays consistent when the field hasn't been manually changed.
  • Style

    • Changed conversation duration display to a single-line layout for cleaner, more compact presentation.
  • Refactoring

    • Improved cache invalidation so conversation updates refresh related conversation lists across the project for better data consistency.

- Improved formatting and readability in ConversationEdit component.
- Added title handling logic to ensure it syncs with conversation data.
- Enhanced query invalidation in ProjectConversationOverview after mutation success to keep data consistent.
- Minor adjustments to component imports for better organization.
@linear
Copy link

linear bot commented Mar 10, 2026

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Walkthrough

Updates adjust form synchronization and cache invalidation around conversations: minor formatting and payload ordering in ConversationEdit, a useEffect to keep form title in sync when not dirty, a duration display tweak, and expanded post-mutation cache invalidation to include project-level conversations. LGTM.

Changes

Cohort / File(s) Summary
Conversation edit component
echo/frontend/src/components/conversation/ConversationEdit.tsx
Formatting tweak in getNameDescription, reordered defaultValues, moved title placement in payload, added useEffect to sync form title with conversation.title when title field isn't dirty, changed duration display to single-line.
Project conversation overview / cache behavior
echo/frontend/src/routes/project/conversation/ProjectConversationOverview.tsx
Replaced a direct refetch() call with query invalidations: now invalidates ["conversations", conversationId] and ["projects", projectId, "conversations"] after generate-summary mutation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

bug

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title mentions ticket numbers and describes displaying auto-generated titles in real-time, which aligns with the core changes: title synchronization logic and improved query invalidation for data consistency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch title-not-showing-conversations-fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@echo/frontend/src/components/conversation/ConversationEdit.tsx`:
- Around line 195-203: The effect that syncs conversation.title only runs for
truthy titles, so if the backend sends null/"" while the field is clean the
input stays stale; update the useEffect (the block using conversation.title,
formState.dirtyFields.title, getValues, and setValue) to remove the truthy guard
and instead check only that the title field is not dirty and getValues("title")
!== conversation.title, then call setValue("title", conversation.title ?? "", {
shouldDirty: false }) so null/empty backend titles overwrite the input.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ffd77229-4581-40bc-8b12-f78588d60077

📥 Commits

Reviewing files that changed from the base of the PR and between e04c139 and 96644d9.

📒 Files selected for processing (2)
  • echo/frontend/src/components/conversation/ConversationEdit.tsx
  • echo/frontend/src/routes/project/conversation/ProjectConversationOverview.tsx

- Simplified the title handling logic to use a default empty string when the conversation title is not available.
- Improved readability by reducing nested conditions in the useEffect hook.
@coderabbitai coderabbitai bot added the bug Something isn't working label Mar 10, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
echo/frontend/src/components/conversation/ConversationEdit.tsx (2)

157-163: ⚠️ Potential issue | 🟡 Minor

Trim whitespace-only titles before persisting.

data.title || null treats " " as a real title, so blank-looking titles can be saved; if the backend preserves that whitespace, hasTitle stays truthy and the Generate CTA remains hidden. Normalize with data.title.trim() || null before building the mutation payload.

Suggested fix
 		onSave: async (data: ConversationEditFormValues) => {
+			const title = data.title.trim();
 			await updateConversationMutation.mutateAsync({
 				id: conversation.id,
 				payload: {
 					participant_name: data.participant_name,
-					title: data.title || null,
+					title: title || null,
 				},
 			});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@echo/frontend/src/components/conversation/ConversationEdit.tsx` around lines
157 - 163, In onSave inside ConversationEdit.tsx (the handler using
ConversationEditFormValues and calling updateConversationMutation.mutateAsync),
normalize the title by trimming whitespace before building the payload: compute
a trimmedTitle = data.title?.trim() and pass title: trimmedTitle || null
(instead of data.title || null) so whitespace-only titles are treated as null;
leave participant_name unchanged.

176-193: ⚠️ Potential issue | 🟠 Major

Surface generate-title failures inline.

This mutation only handles success, so a failed Generate click goes silent. Add toast + contextual CloseableAlert/Alert near the title field off generateTitleMutation.isError.

As per coding guidelines "Surface UI mutations with inline feedback: pair toasts with contextual Mantine Alert components inside modals/forms for errors or warnings".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@echo/frontend/src/components/conversation/ConversationEdit.tsx` around lines
176 - 193, The generate-title mutation currently only handles onSuccess and
leaves failures silent; update useMutation (generateTitleMutation) to handle
onError by showing a toast with the error message and expose
generateTitleMutation.isError so the ConversationEdit component can render a
contextual CloseableAlert/Alert next to the title field that displays the
mutation error (use the error returned from generateConversationTitle). Keep the
existing onSuccess behavior (setValue and queryClient.invalidateQueries) and
ensure the alert is conditionally rendered based on
generateTitleMutation.isError and cleared when the user dismisses it or when a
successful mutation occurs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@echo/frontend/src/components/conversation/ConversationEdit.tsx`:
- Around line 157-163: In onSave inside ConversationEdit.tsx (the handler using
ConversationEditFormValues and calling updateConversationMutation.mutateAsync),
normalize the title by trimming whitespace before building the payload: compute
a trimmedTitle = data.title?.trim() and pass title: trimmedTitle || null
(instead of data.title || null) so whitespace-only titles are treated as null;
leave participant_name unchanged.
- Around line 176-193: The generate-title mutation currently only handles
onSuccess and leaves failures silent; update useMutation (generateTitleMutation)
to handle onError by showing a toast with the error message and expose
generateTitleMutation.isError so the ConversationEdit component can render a
contextual CloseableAlert/Alert next to the title field that displays the
mutation error (use the error returned from generateConversationTitle). Keep the
existing onSuccess behavior (setValue and queryClient.invalidateQueries) and
ensure the alert is conditionally rendered based on
generateTitleMutation.isError and cleared when the user dismisses it or when a
successful mutation occurs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0da1a5d0-2a2b-4282-bdc3-adaa5d85f6a2

📥 Commits

Reviewing files that changed from the base of the PR and between 96644d9 and 3b35e56.

📒 Files selected for processing (1)
  • echo/frontend/src/components/conversation/ConversationEdit.tsx

@ussaama ussaama enabled auto-merge March 10, 2026 15:55
@ussaama ussaama requested a review from spashii March 10, 2026 15:55
@ussaama ussaama added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit 5d68d05 Mar 10, 2026
11 checks passed
@ussaama ussaama deleted the title-not-showing-conversations-fix branch March 10, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants