Skip to content

ECHO-352 Conversation live indicator fix#234

Merged
spashii merged 7 commits intomainfrom
conversation-live-fix
Jul 24, 2025
Merged

ECHO-352 Conversation live indicator fix#234
spashii merged 7 commits intomainfrom
conversation-live-fix

Conversation

@ussaama
Copy link
Copy Markdown
Contributor

@ussaama ussaama commented Jul 22, 2025

Summary by CodeRabbit

  • New Features

    • Conversations now display an "Ongoing" status indicator when they are actively live, with improved detection logic based on recent activity.
    • The "Ongoing" status is accurately localized in German, English, Spanish, French, and Dutch.
  • Bug Fixes

    • Improved filtering in conversation summaries to exclude more non-relevant conversation sources.
  • Documentation

    • Updated and refreshed localization files for all supported languages, ensuring up-to-date translations.
  • Style

    • Minor adjustment to the layout of the live status indicator for better alignment.
  • Refactor

    • Enhanced type handling and consistency for conversation and conversation link data throughout the application.

ussaama added 3 commits July 22, 2025 10:29
* 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.
@linear
Copy link
Copy Markdown

linear bot commented Jul 22, 2025

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 22, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR updates the logic and typing for the live/ongoing conversation indicator in the frontend. It introduces a live boolean to conversations, refines the display logic for the live indicator, updates translations and locale files, adjusts conversation type definitions, and enhances hooks to compute live status. Localization files are refreshed accordingly.

Changes

File(s) Change Summary
ConversationAccordion.tsx, ConversationLink.tsx Updated prop typing and logic for ConversationAccordionItem to handle optional conversations with a live boolean. Refined live indicator display condition and label. Added type assertions in ConversationLink.
hooks/index.ts Enhanced useConversationsByProjectId to compute and inject a live boolean per conversation based on recent chunk activity, with a 40-second window, and exclude uploads/clones from being marked as live.
OngoingConversationsSummaryCard.tsx Broadened filter to exclude both "DASHBOARD_UPLOAD" and "CLONE" sources from ongoing conversation chunks.
typesDirectus.d.ts Updated Conversation and related types: made linked_conversations and linking_conversations required, expanded ConversationLink fields, added new/optional fields to ProcessingStatus, Project, ProjectAnalysisRun, View, and updated CustomDirectusTypes.
locales/en-US.po, locales/de-DE.po, locales/es-ES.po, locales/fr-FR.po, locales/nl-NL.po Added new translation entry for conversation.ongoing ("Ongoing" and equivalents), deprecated/commented out "Live" and legacy "Ongoing" keys.
locales/en-US.ts, locales/de-DE.ts, locales/es-ES.ts, locales/fr-FR.ts, locales/nl-NL.ts Replaced entire locale JSON message strings with updated versions, reflecting new/updated translations and keys. No structural or export 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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Suggested labels

bug, improvement

Suggested reviewers

  • ussaama

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61c6652 and a773b2d.

📒 Files selected for processing (14)
  • echo/frontend/src/components/conversation/ConversationAccordion.tsx (4 hunks)
  • echo/frontend/src/components/conversation/ConversationLink.tsx (1 hunks)
  • echo/frontend/src/components/conversation/hooks/index.ts (3 hunks)
  • echo/frontend/src/lib/typesDirectus.d.ts (6 hunks)
  • echo/frontend/src/locales/de-DE.po (2 hunks)
  • echo/frontend/src/locales/de-DE.ts (1 hunks)
  • echo/frontend/src/locales/en-US.po (2 hunks)
  • echo/frontend/src/locales/en-US.ts (1 hunks)
  • echo/frontend/src/locales/es-ES.po (2 hunks)
  • echo/frontend/src/locales/es-ES.ts (1 hunks)
  • echo/frontend/src/locales/fr-FR.po (2 hunks)
  • echo/frontend/src/locales/fr-FR.ts (1 hunks)
  • echo/frontend/src/locales/nl-NL.po (2 hunks)
  • echo/frontend/src/locales/nl-NL.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch conversation-live-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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ussaama ussaama enabled auto-merge July 22, 2025 11:20
@coderabbitai coderabbitai bot requested a review from spashii July 22, 2025 11:20
cursor[bot]

This comment was marked as outdated.

return conversations.map((conversation: any) => {
const hasRecentChunks = conversation.chunks?.some((chunk: any) => {
// Skip upload chunks
if (chunk.source === "DASHBOARD_UPLOAD") return false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this logic is to check recent chunks and we are also checking for "conversation.source = CLONE" in the component itself

@spashii
Copy link
Copy Markdown
Member

spashii commented Jul 23, 2025

@spashii Update constraint for conversation_link such that deletes are cascading.

@spashii spashii disabled auto-merge July 23, 2025 08:29
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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

is_finished?: boolean | null;
live?: boolean | null;

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

) return {
...conversation,
live: false,
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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().

Locations (1)

Fix in CursorFix in Web

@spashii spashii merged commit c2bc28a into main Jul 24, 2025
6 checks passed
@coderabbitai coderabbitai bot added bug Something isn't working improvement labels Jul 24, 2025
@ussaama ussaama deleted the conversation-live-fix branch September 11, 2025 12:22
spashii added a commit that referenced this pull request Nov 18, 2025
* 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>
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