Skip to content

Feat/progressive inbox scan#72

Merged
anna-st-40 merged 9 commits intoInboxWhiz:mainfrom
Vamsiindugu:feat/progressive-inbox-scan
Oct 29, 2025
Merged

Feat/progressive inbox scan#72
anna-st-40 merged 9 commits intoInboxWhiz:mainfrom
Vamsiindugu:feat/progressive-inbox-scan

Conversation

@Vamsiindugu
Copy link
Contributor

@Vamsiindugu Vamsiindugu commented Sep 24, 2025

Summary

This PR resolves the performance issue where the extension would freeze when scanning very large inboxes (~500k emails).

It replaces the "all-at-once" email fetching mechanism with a progressive loading system that processes emails in batches.

This provides a much better user experience by preventing the UI from freezing and giving the user real-time feedback and control over the scanning process.

✨ Key Changes

  • Batched Processing: The BrowserEmailService now fetches emails in configurable batches to avoid blocking the main thread.
  • Progress UI: A new FetchProgressBar component has been added, which displays:
    • Current page vs. total pages
    • Number of processed emails
    • A percentage completion bar
  • Cancellation Support: Users can now cancel an in-progress scan via a "Cancel" button.
  • State Management: The AppProvider now manages the state for fetch progress and cancellation.
  • Incremental Aggregation: Sender data is aggregated incrementally, improving memory efficiency.

✅ Verification

All 37 existing Playwright UI tests were executed and passed successfully, confirming that these changes do not break existing functionality.

@anna-st-40 anna-st-40 requested a review from Copilot October 29, 2025 02:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds progressive loading functionality to display real-time progress when fetching email senders from Gmail, improving user experience during long-running operations.

Key changes:

  • Introduces a visual progress bar UI with cancellation support
  • Implements batch processing with progress reporting in the email fetching logic
  • Adds comprehensive Playwright tests for progressive loading behavior

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/ui/sidebar/progressiveLoading.spec.ts New test suite with 10 tests covering progress bar display, cancellation, transitions, and edge cases
test/ui/sidebar/helpers.ts Added helper functions for waiting on progress completion and retrieving progress state
src/presentation/providers/app_provider.tsx Updated context to manage fetch progress state and cancellation, integrated progress callbacks with MockEmailRepo
src/presentation/apps/sidebar/components/sendersContainer.tsx Modified rendering logic to show progress bar when fetchProgress is available
src/presentation/apps/sidebar/components/fetchProgress.tsx New component rendering the progress bar UI with stats and cancel button
src/presentation/apps/sidebar/components/fetchProgress.css Styling for the progress bar component
src/data/services/browser_email_service.ts Refactored to support batch processing, progress callbacks, and cancellation via AbortSignal
src/data/repositories/mocks/mock_email_repo.ts Added progress simulation with configurable progressive loading and cancellation
src/data/repositories/browser_email_repo.ts Added progress callback support and cancel method, listens for progress messages from content script
src/data/content_scripts/content.ts Refactored to support cancellation with AbortController and send progress updates to side panel

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@InboxWhiz InboxWhiz deleted a comment from Copilot AI Oct 29, 2025
Copy link
Member

@anna-st-40 anna-st-40 left a comment

Choose a reason for hiding this comment

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

Please consider the comments left by Copilot

@anna-st-40 anna-st-40 merged commit abd1905 into InboxWhiz:main Oct 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants