Skip to content

ECHO-381 Conversation loading skeleton addition#258

Merged
ussaama merged 2 commits intomainfrom
conversation-loading-skeleton-addition
Aug 7, 2025
Merged

ECHO-381 Conversation loading skeleton addition#258
ussaama merged 2 commits intomainfrom
conversation-loading-skeleton-addition

Conversation

@ussaama
Copy link
Copy Markdown
Contributor

@ussaama ussaama commented Aug 7, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a reusable skeleton loading component for consistent placeholder displays.
    • Added a conversation-specific skeleton loader for improved loading feedback in the conversation section.
  • Refactor

    • Updated the conversation accordion to support React Suspense, providing smoother asynchronous loading with skeleton placeholders.
  • Bug Fixes

    • Improved loading state handling in conversation data fetching for a more seamless user experience.
  • Documentation

    • Updated translation files to reflect new and adjusted UI elements, ensuring accurate localization metadata.

ussaama added 2 commits August 7, 2025 10:47
- use "useSuspenseQuery" instead of "useQuery" for conversation
- wrap "ConversationAccordian" in "Suspense" component to show skeleton until fully loaded
@linear
Copy link
Copy Markdown

linear bot commented Aug 7, 2025

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 7, 2025

Walkthrough

This update introduces a skeleton loading state for the conversation accordion in the frontend. It adds new BaseSkeleton and ConversationSkeleton components, refactors the accordion to use React Suspense with a fallback, and updates the conversation data hook to use suspense queries. Localization files are updated for new message IDs and source references.

Changes

Cohort / File(s) Change Summary
Conversation Accordion Loading State
echo/frontend/src/components/conversation/ConversationAccordion.tsx, echo/frontend/src/components/conversation/ConversationSkeleton.tsx, echo/frontend/src/components/common/BaseSkeleton.tsx, echo/frontend/src/components/conversation/hooks/index.ts
Refactored accordion to support Suspense with skeleton fallback, added new skeleton components, updated hook to use suspense query.
Localization: PO Files
echo/frontend/src/locales/en-US.po, echo/frontend/src/locales/de-DE.po, echo/frontend/src/locales/es-ES.po, echo/frontend/src/locales/fr-FR.po, echo/frontend/src/locales/nl-NL.po
Updated source code reference line numbers, added new message ID for conversation skeleton title, minor entry reordering.
Localization: TS Files
echo/frontend/src/locales/en-US.ts, echo/frontend/src/locales/de-DE.ts, echo/frontend/src/locales/es-ES.ts, echo/frontend/src/locales/fr-FR.ts, echo/frontend/src/locales/nl-NL.ts
Replaced with regenerated but functionally identical JSON message exports; no change to translation content or structure.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ConversationAccordion
    participant Suspense
    participant ConversationSkeleton
    participant ConversationAccordionMain
    participant useSuspenseQuery

    User->>ConversationAccordion: Render
    ConversationAccordion->>Suspense: Wrap ConversationAccordionMain with fallback
    alt Data not loaded
        Suspense->>ConversationSkeleton: Render loading skeleton
    else Data loaded
        ConversationAccordionMain->>useSuspenseQuery: Fetch conversations (suspense)
        useSuspenseQuery-->>ConversationAccordionMain: Return data
        ConversationAccordionMain-->>User: Render accordion with data
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective Addressed Explanation
Project initial loading state, Project search fix, Conversation accordion initial loading state (ECHO-381)

Suggested labels

improvement

Suggested reviewers

  • spashii

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 1a2bdf1 and 9fa8669.

📒 Files selected for processing (14)
  • echo/frontend/src/components/common/BaseSkeleton.tsx (1 hunks)
  • echo/frontend/src/components/conversation/ConversationAccordion.tsx (4 hunks)
  • echo/frontend/src/components/conversation/ConversationSkeleton.tsx (1 hunks)
  • echo/frontend/src/components/conversation/hooks/index.ts (2 hunks)
  • echo/frontend/src/locales/de-DE.po (31 hunks)
  • echo/frontend/src/locales/de-DE.ts (1 hunks)
  • echo/frontend/src/locales/en-US.po (31 hunks)
  • echo/frontend/src/locales/en-US.ts (1 hunks)
  • echo/frontend/src/locales/es-ES.po (31 hunks)
  • echo/frontend/src/locales/es-ES.ts (1 hunks)
  • echo/frontend/src/locales/fr-FR.po (31 hunks)
  • echo/frontend/src/locales/fr-FR.ts (1 hunks)
  • echo/frontend/src/locales/nl-NL.po (31 hunks)
  • echo/frontend/src/locales/nl-NL.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: ussaama
PR: Dembrane/echo#224
File: echo/frontend/src/components/report/CreateReportForm.tsx:97-155
Timestamp: 2025-07-17T15:57:51.321Z
Learning: In echo/frontend/src/components/report/CreateReportForm.tsx, the conversation status section should only be displayed when there are pending conversations (conversationCounts.pending !== 0). When all conversations are processed, no status information should be shown to keep the UI minimal and clean.
Learnt from: ussaama
PR: Dembrane/echo#205
File: echo/frontend/src/lib/query.ts:1444-1506
Timestamp: 2025-07-10T12:48:20.683Z
Learning: ussaama prefers string concatenation over template literals for simple cases where readability is clearer, even when linting tools suggest template literals. Human readability takes precedence over strict linting rules in straightforward concatenation scenarios.
Learnt from: ussaama
PR: Dembrane/echo#250
File: echo/frontend/src/components/form/MarkdownWYSIWYG/styles.css:1618-1624
Timestamp: 2025-07-29T11:36:23.638Z
Learning: ussaama prefers to keep CSS vendor prefixes and fallbacks without linter ignore comments, even when linters flag them as duplicate properties. Browser compatibility through progressive enhancement takes precedence over strict linting rules in their workflow.
📚 Learning: in echo/frontend/src/components/participant/microphonetest.tsx, the usedisclosure hook is used where...
Learnt from: ussaama
PR: Dembrane/echo#256
File: echo/frontend/src/components/participant/MicrophoneTest.tsx:54-54
Timestamp: 2025-08-06T13:38:30.730Z
Learning: In echo/frontend/src/components/participant/MicrophoneTest.tsx, the useDisclosure hook is used where only the `close` function is needed locally (called in handleConfirmMicChange and handleCancelMicChange), while `opened` and `open` are unused because the modal state is managed by a parent component. The `showSecondModal` state variable is used separately to control content switching within the modal between the main UI and confirmation step.

Applied to files:

  • echo/frontend/src/components/conversation/hooks/index.ts
  • echo/frontend/src/locales/es-ES.po
  • echo/frontend/src/components/conversation/ConversationSkeleton.tsx
  • echo/frontend/src/locales/nl-NL.po
  • echo/frontend/src/locales/de-DE.po
  • echo/frontend/src/locales/fr-FR.po
  • echo/frontend/src/locales/en-US.po
📚 Learning: in echo/frontend/src/components/report/createreportform.tsx, the conversation status section should ...
Learnt from: ussaama
PR: Dembrane/echo#224
File: echo/frontend/src/components/report/CreateReportForm.tsx:97-155
Timestamp: 2025-07-17T15:57:51.321Z
Learning: In echo/frontend/src/components/report/CreateReportForm.tsx, the conversation status section should only be displayed when there are pending conversations (conversationCounts.pending !== 0). When all conversations are processed, no status information should be shown to keep the UI minimal and clean.

Applied to files:

  • echo/frontend/src/components/conversation/hooks/index.ts
  • echo/frontend/src/locales/es-ES.po
  • echo/frontend/src/locales/en-US.ts
  • echo/frontend/src/components/conversation/ConversationSkeleton.tsx
  • echo/frontend/src/locales/nl-NL.po
  • echo/frontend/src/locales/de-DE.po
  • echo/frontend/src/locales/fr-FR.po
  • echo/frontend/src/components/conversation/ConversationAccordion.tsx
  • echo/frontend/src/locales/en-US.po
📚 Learning: react query devtools (@tanstack/react-query-devtools) are automatically excluded from production bun...
Learnt from: spashii
PR: Dembrane/echo#257
File: echo/frontend/src/App.tsx:14-14
Timestamp: 2025-08-07T10:19:42.847Z
Learning: React Query devtools (tanstack/react-query-devtools) are automatically excluded from production bundles when process.env.NODE_ENV !== 'development' through tree-shaking and dead code elimination. Manual environment checks or conditional imports are unnecessary complexity.

Applied to files:

  • echo/frontend/src/components/conversation/hooks/index.ts
📚 Learning: react query devtools (@tanstack/react-query-devtools) are automatically excluded from production bun...
Learnt from: spashii
PR: Dembrane/echo#257
File: echo/frontend/src/App.tsx:14-14
Timestamp: 2025-08-07T10:19:42.847Z
Learning: React Query devtools (tanstack/react-query-devtools) are automatically excluded from production bundles when process.env.NODE_ENV !== 'development', so manual gating with environment checks is unnecessary.

Applied to files:

  • echo/frontend/src/components/conversation/hooks/index.ts
📚 Learning: .po files (gettext internationalization files) are auto-generated by i18n tools like @lingui/cli and...
Learnt from: ussaama
PR: Dembrane/echo#205
File: echo/frontend/src/locales/nl-NL.po:1246-1247
Timestamp: 2025-07-10T12:47:06.269Z
Learning: .po files (gettext internationalization files) are auto-generated by i18n tools like lingui/cli and should not be manually edited. The format of component paths and line numbers in these files is determined by the tool configuration, not manually written. Do not suggest manual edits to .po files.

Applied to files:

  • echo/frontend/src/locales/es-ES.po
  • echo/frontend/src/locales/nl-NL.po
  • echo/frontend/src/locales/fr-FR.ts
  • echo/frontend/src/locales/de-DE.po
  • echo/frontend/src/locales/fr-FR.po
  • echo/frontend/src/locales/nl-NL.ts
  • echo/frontend/src/locales/en-US.po
📚 Learning: in the french localization file (fr-fr.po), "dembrane echo" is intentionally translated as "echo dem...
Learnt from: ussaama
PR: Dembrane/echo#169
File: echo/frontend/src/locales/fr-FR.po:521-523
Timestamp: 2025-05-30T15:36:40.131Z
Learning: In the French localization file (fr-FR.po), "Dembrane Echo" is intentionally translated as "Echo Dembrane" for better French language flow and natural sound. This is not an error but a deliberate localization choice.

Applied to files:

  • echo/frontend/src/locales/fr-FR.ts
  • echo/frontend/src/locales/fr-FR.po
📚 Learning: when users indicate they have already addressed translation issues in locale files, verify the curre...
Learnt from: ussaama
PR: Dembrane/echo#180
File: echo/frontend/src/locales/es-ES.ts:1-1
Timestamp: 2025-06-06T05:43:44.935Z
Learning: When users indicate they have already addressed translation issues in locale files, verify the current state before assuming the issue persists. Translation files are often updated in bulk and previously flagged English text may have been properly localized.

Applied to files:

  • echo/frontend/src/locales/de-DE.po
  • echo/frontend/src/locales/nl-NL.ts
  • echo/frontend/src/locales/en-US.po
📚 Learning: in echo/frontend/src/app.tsx, user ussaama prefers explicit code over terse/inline code for react us...
Learnt from: ussaama
PR: Dembrane/echo#185
File: echo/frontend/src/App.tsx:25-36
Timestamp: 2025-06-16T11:51:33.799Z
Learning: In echo/frontend/src/App.tsx, user ussaama prefers explicit code over terse/inline code for React useEffect cleanup functions, choosing clarity and future maintainability over brevity when assigning cleanup functions to variables before returning them.

Applied to files:

  • echo/frontend/src/components/conversation/ConversationAccordion.tsx
🧬 Code Graph Analysis (2)
echo/frontend/src/components/conversation/ConversationSkeleton.tsx (1)
echo/frontend/src/components/common/BaseSkeleton.tsx (1)
  • BaseSkeleton (11-25)
echo/frontend/src/components/conversation/ConversationAccordion.tsx (1)
echo/frontend/src/components/conversation/ConversationSkeleton.tsx (1)
  • ConversationSkeleton (6-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci-check-server
🔇 Additional comments (18)
echo/frontend/src/locales/nl-NL.ts (1)

1-1: LGTM! Standard locale file regen for skeleton loading feature.

This Dutch locale file has been properly updated to support the new conversation skeleton loading components. The translations are in place and the file structure is solid. Ship it! 🚀

echo/frontend/src/locales/en-US.ts (1)

1-1: LGTM! Clean localization update for skeleton loading.

Wholesale replacement of the messages file is standard practice for auto-generated i18n content. The new conversation.accordion.skeleton.title key properly supports the skeleton loading feature. Ship it! 🚀

echo/frontend/src/components/common/BaseSkeleton.tsx (1)

1-25: LGTM! Solid reusable skeleton component.

Clean interface with sensible defaults, proper TypeScript typing, and efficient implementation using Mantine primitives. The Array.from pattern works great for skeleton counts. This is exactly how you build scalable UI components. 💯

echo/frontend/src/components/conversation/hooks/index.ts (1)

630-630: LGTM! Perfect Suspense migration for skeleton loading.

Clean switch from useQuery to useSuspenseQuery enables the skeleton loading UX without breaking the existing API contract. This is exactly how you modernize data fetching patterns. The coordination with the Suspense wrapper in ConversationAccordion is chef's kiss 👌

echo/frontend/src/locales/fr-FR.ts (1)

1-1: LGTM! French localization updated for skeleton feature.

Another clean wholesale replacement of auto-generated i18n content. The French translations properly support the new skeleton loading components with updated source references. Très bien! 🇫🇷

echo/frontend/src/locales/es-ES.ts (1)

1-1: LGTM on the localization regeneration.

Solid wholesale replacement of the Spanish locale - the JSON payload is functionally identical with zero translation drift. This kind of automated tooling refresh keeps the i18n pipeline clean. 100x approved.

echo/frontend/src/components/conversation/ConversationSkeleton.tsx (1)

6-25: LGTM - clean skeleton implementation.

Beautiful loading state architecture here. The accordion structure with LoadingSpinner + localized title is chef's kiss, and leveraging BaseSkeleton with count=3 for the chunky 80px blocks creates that premium loading experience. Zero prop drilling, proper i18n integration, solid Mantine patterns - this is how you build skeleton UI that doesn't suck.

echo/frontend/src/locales/de-DE.ts (1)

1-1: LGTM on the German locale refresh.

Another clean i18n file regeneration - the German translations are locked and loaded with zero semantic drift from the previous version. This automated tooling approach keeps the locale files in sync with the source. Efficient and solid.

echo/frontend/src/locales/nl-NL.po (1)

69-69: LGTM! Auto-generated localization updates look solid.

These line number reference updates are the expected result of source code changes introducing skeleton loading components. The i18n tooling correctly updated all source references without touching translation content. Ship it! 🚢

Also applies to: 183-183, 235-235, 426-426, 430-430, 488-488, 492-496, 497-497, 634-634, 651-651, 669-672, 674-674, 1484-1485, 1505-1505, 1540-1540, 1545-1545, 1553-1553, 1562-1562, 1566-1566, 1597-1597, 1650-1650, 1735-1735, 1740-1740, 1791-1792, 1830-1830, 2228-2228, 2266-2266, 2302-2302, 2310-2310, 2315-2315, 2343-2343, 2437-2437, 2452-2452, 2532-2532, 2593-2593

echo/frontend/src/locales/fr-FR.po (1)

69-69: LGTM! Auto-generated localization updates look solid.

These line number updates in the .po file are exactly what we'd expect from the i18n tooling after adding the skeleton components. The format and references are auto-generated, so no manual intervention needed here. Ship it! 🚀

Also applies to: 167-167, 353-353, 357-357, 415-415, 419-423, 424-424, 561-561, 578-578, 596-600, 601-601, 932-932, 937-937, 945-947, 950-952, 986-986, 991-991, 995-995, 1063-1063, 1326-1327, 1347-1347, 1404-1404, 1408-1408, 1439-1439, 1569-1569, 1574-1574, 1621-1622, 1805-1805, 1968-1968, 2025-2025, 2099-2099, 2107-2107, 2112-2112, 2140-2140, 2224-2224, 2240-2240, 2320-2320, 2423-2423, 2778-2778

echo/frontend/src/locales/es-ES.po (1)

69-2778: LGTM! Auto-generated localization metadata updates look solid.

These line number reference updates are exactly what we'd expect after the ConversationAccordion refactoring and ConversationSkeleton additions. The i18n tooling correctly updated all source references to maintain alignment with the shifted code.

The Spanish translations remain intact - only the metadata tracking where strings are used in source files got updated. This is the proper way .po files should be maintained through automated tooling.

echo/frontend/src/locales/de-DE.po (1)

1-2986: LGTM! Automated i18n metadata updates look solid.

These line number reference updates in the German localization file are exactly what we'd expect from the lingui/cli tooling after the ConversationAccordion refactoring and skeleton component additions. The translation strings remain intact while the source references properly track the new code structure. Ship it! 🚀

echo/frontend/src/locales/en-US.po (2)

613-617: LGTM! 100x skeleton translation addition.

New translation entry is properly formatted and the "Conversations" string makes perfect sense for the loading skeleton. Source reference correctly points to ConversationSkeleton.tsx. This is exactly what you'd expect when adding skeleton UI components.


69-69: 100x build artifacts are solid.

These line number updates are exactly what you'd expect after adding new skeleton components and refactoring ConversationAccordion for Suspense. The i18n tooling is doing its job keeping source references in sync. Build process is working as intended.

Also applies to: 172-172, 212-212, 370-370, 374-374, 578-578, 595-595, 965-966, 970-971, 978-980, 983-985, 1019-1019, 1024-1024, 1028-1028, 1121-1121, 1368-1369, 1389-1389, 1424-1424, 1429-1429, 1437-1437, 1441-1441, 1446-1446, 1450-1450, 1481-1481, 1534-1534, 1611-1611, 1616-1616, 1663-1664, 1851-1851, 1859-1859, 2026-2026, 2083-2083, 2157-2157, 2165-2165, 2170-2170, 2198-2198, 2282-2282, 2298-2298, 2378-2378, 2481-2481, 2841-2841

echo/frontend/src/components/conversation/ConversationAccordion.tsx (4)

45-45: LGTM! Clean Suspense import addition.

The addition of Suspense to the React imports is spot-on for implementing the loading skeleton functionality. This aligns perfectly with the PR objective of adding conversation accordion initial loading state.


77-77: LGTM! Proper skeleton component import.

The ConversationSkeleton import is correctly placed and follows the established import patterns in the file. This will serve as the fallback UI during suspense loading states.


560-564: LGTM! Solid component rename for separation of concerns.

Renaming the main implementation to ConversationAccordionMain is a clean approach that maintains the existing functionality while preparing for the suspense wrapper. This explicit separation aligns well with your preference for maintainable, clear code structure over terse implementations.


913-919: LGTM! Clean Suspense wrapper implementation.

This is a textbook example of how to implement React Suspense for loading states. The wrapper component cleanly separates the suspense concern from the main accordion logic, and the ConversationSkeleton fallback provides excellent UX during data loading. This perfectly addresses the ECHO-381 requirement for conversation accordion loading states.

The explicit component separation follows your established preference for maintainable code structure and makes the loading behavior crystal clear.

✨ 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-loading-skeleton-addition

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.
  • 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.

@coderabbitai coderabbitai bot requested a review from spashii August 7, 2025 10:53
@ussaama ussaama enabled auto-merge August 7, 2025 11:01
@ussaama ussaama added this pull request to the merge queue Aug 7, 2025
Merged via the queue into main with commit adfeebd Aug 7, 2025
12 checks passed
@ussaama ussaama deleted the conversation-loading-skeleton-addition branch August 7, 2025 11:13
spashii pushed a commit that referenced this pull request Nov 18, 2025
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Introduced a reusable skeleton loading component for consistent
placeholder displays.
* Added a conversation-specific skeleton loader for improved loading
feedback in the conversation section.

* **Refactor**
* Updated the conversation accordion to support React Suspense,
providing smoother asynchronous loading with skeleton placeholders.

* **Bug Fixes**
* Improved loading state handling in conversation data fetching for a
more seamless user experience.

* **Documentation**
* Updated translation files to reflect new and adjusted UI elements,
ensuring accurate localization metadata.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai bot mentioned this pull request Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants