Skip to content

feat(desktop): Show project indexing progress in notification bell #605

Description

@haiphucnguyen

Problem

When a user opens a project in ProjectView, indexing starts automatically. The
indexing progress is only visible while the user stays on ProjectView - it
renders the progress inline in that screen.

If the user navigates away (e.g. starts a chat, switches to another view), they have
no indication that:

  • Indexing is still running in the background
  • Indexing has completed successfully
  • Indexing has failed

This creates a confusing experience: the user may start chatting expecting RAG to be
available, but the index isn't ready yet - with no feedback.

Root Cause

ProjectIndexer emits IndexingStartedEvent, IndexingQueuedEvent,
IndexingCompletedEvent, and IndexingFailedEvent to EventBus.userEvents, but
NotificationComponents.notificationIcon currently only listens for
UpdateAvailableEvent and ShellErrorEvent. Indexing events are silently dropped.

Proposed Solution

1. Handle indexing events in notificationIcon (NotificationComponents.kt)

The existing LaunchedEffect in notificationIcon already collects from
EventBus.userEvents. Extend notificationEventCard to render cards for:

Event Icon Card style
IndexingQueuedEvent HourglassEmpty neutral surfaceVariant
IndexingStartedEvent Sync (animated spin) neutral surfaceVariant
IndexingCompletedEvent CheckCircleOutline tertiaryContainer (green-ish)
IndexingFailedEvent ErrorOutline error-tinted surfaceVariant

The card should show:

  • Project name (event.projectName)
  • Status label (e.g. "Indexing…", "Index ready", "Indexing failed")
  • Timestamp
  • For IndexingCompletedEvent: files indexed count (event.filesIndexed)
  • For IndexingFailedEvent: error message + selectable stack trace (same pattern as
    ShellErrorEvent cause expansion)
  • For IndexingStartedEvent / IndexingQueuedEvent: auto-dismiss the card once
    IndexingCompletedEvent or IndexingFailedEvent arrives for the same project
    (replace in the events list by projectId)

2. Auto-open bell for terminal states

Mirror the existing behaviour for UpdateAvailableEvent and ShellErrorEvent:

  • IndexingFailedEvent → auto-open the notification popup (user must know)
  • IndexingCompletedEvent → increment unread badge only (don't force-open)

3. Deduplicate in-progress cards

If IndexingStartedEvent arrives for a project that already has a
IndexingQueuedEvent card, replace the queued card in-place rather than appending.
Use projectId as the deduplication key.

Files Affected

File Change
NotificationComponents.kt Handle IndexingStartedEvent, IndexingQueuedEvent, IndexingCompletedEvent, IndexingFailedEvent in notificationEventCard and notificationIcon
i18n resource files Add keys: event.indexing.started, event.indexing.queued, event.indexing.completed, event.indexing.failed, event.indexing.files_indexed

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions