ECHO-352 Conversation live indicator fix#234
Conversation
* Introduced a new 'live' field to the Conversation type to indicate ongoing activity based on recent chunks. * Updated the useConversationsByProjectId hook to calculate the 'live' status for conversations. * Modified ConversationAccordion component to display a visual indicator for live conversations.
* Refined the ConversationAccordion component to exclude conversations from the "CLONE" source when displaying live status indicators. * Adjusted the OngoingConversationsSummaryCard to filter out both "DASHBOARD_UPLOAD" and "CLONE" sources for ongoing conversations, enhancing data accuracy and user experience.
* Updated the ConversationAccordion component to change the "Live" status label to "Ongoing" for better clarity. * Adjusted the filtering logic in the useConversationsByProjectId hook to exclude only "DASHBOARD_UPLOAD" sources from recent chunks. * Updated localization files for German, English, Spanish, French, and Dutch to reflect the new "Ongoing" status and ensure accurate mapping for conversation status messages.
|
Caution Review failedThe pull request is closed. WalkthroughThis PR updates the logic and typing for the live/ongoing conversation indicator in the frontend. It introduces a Changes
Sequence Diagram(s)sequenceDiagram
participant UI as User Interface
participant Hook as useConversationsByProjectId
participant API as Directus API
UI->>Hook: Fetch conversations by project ID
Hook->>API: Request conversations and chunks
API-->>Hook: Return conversations data
Hook->>Hook: For each conversation, compute live status (recent chunk, not upload/clone)
Hook-->>UI: Return conversations with live boolean
UI->>UI: Render ConversationAccordionItem with conversation & live status
UI->>UI: Show live indicator if source is "portal_audio" and live is true
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (14)
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
echo/frontend/src/components/conversation/ConversationAccordion.tsx
Outdated
Show resolved
Hide resolved
echo/frontend/src/lib/query.ts
Outdated
| return conversations.map((conversation: any) => { | ||
| const hasRecentChunks = conversation.chunks?.some((chunk: any) => { | ||
| // Skip upload chunks | ||
| if (chunk.source === "DASHBOARD_UPLOAD") return false; |
There was a problem hiding this comment.
Why are we not skipping "CLONE" "conversations"? I understand this is about chunks but "live" we should skip at the "conversation" level and not at the chunk level. The chunk level checks are only if it is not CLONE or UPLOAD, and you check for recency
There was a problem hiding this comment.
this logic is to check recent chunks and we are also checking for "conversation.source = CLONE" in the component itself
|
@spashii Update constraint for conversation_link such that deletes are cascading. |
There was a problem hiding this comment.
Bug: Directus Type Definition Error: Incorrect Property Inclusion
The live property was incorrectly added to the Conversation Directus type definition. This property is client-side computed and not part of the actual Directus schema, leading to a type mismatch and potential errors when interacting with the Directus API. Additionally, its type boolean | null is overly permissive, as the property is only ever set to a boolean value, never null, which can cause type checking issues.
echo/frontend/src/lib/typesDirectus.d.ts#L64-L65
echo/echo/frontend/src/lib/typesDirectus.d.ts
Lines 64 to 65 in 72623f3
Was this report helpful? Give feedback by reacting with 👍 or 👎
| ) return { | ||
| ...conversation, | ||
| live: false, | ||
| }; |
There was a problem hiding this comment.
Bug: Case Sensitivity Issue in Source Handling
The useConversationsByProjectId hook incorrectly handles case for conversation.source when determining the live status. The check ["upload", "clone"].includes(conversation.source ?? "") expects lowercase values, but actual source values (e.g., "DASHBOARD_UPLOAD", "CLONE") are uppercase. This prevents "upload" and "clone" conversations from being correctly excluded, and should be fixed by using conversation.source?.toLowerCase().
* Enhance conversation data handling by adding 'live' status (#234) * Introduced a new 'live' field to the Conversation type to indicate ongoing activity based on recent chunks. * Updated the useConversationsByProjectId hook to calculate the 'live' status for conversations. * Modified ConversationAccordion component to display a visual indicator for live conversations. * Update conversation filtering logic in components (#235) * Refined the ConversationAccordion component to exclude conversations from the "CLONE" source when displaying live status indicators. * Adjusted the OngoingConversationsSummaryCard to filter out both "DASHBOARD_UPLOAD" and "CLONE" sources for ongoing conversations, enhancing data accuracy and user experience. * Refactor conversation status indicators and localization updates * Updated the ConversationAccordion component to change the "Live" status label to "Ongoing" for better clarity. * Adjusted the filtering logic in the useConversationsByProjectId hook to exclude only "DASHBOARD_UPLOAD" sources from recent chunks. * Updated localization files for German, English, Spanish, French, and Dutch to reflect the new "Ongoing" status and ensure accurate mapping for conversation status messages. * fix type issues * fix issues --------- Co-authored-by: Sameer Pashikanti <sameer@dembrane.com>
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Style
Refactor