Skip to content

Fix pending count capped at 1, show count in sidebar bell - #25

Merged
trydis merged 1 commit into
mainfrom
notifications-counter
Mar 15, 2026
Merged

trydis merged 1 commit into
mainfrom
notifications-counter

Conversation

@trydis

@trydis trydis commented Mar 15, 2026 •

Copy link
Copy Markdown
Owner
  • Remove auto-clear-on-focus from enqueueCompletion() so the focused surface's completion stays pending and counts correctly
  • Clear pending completion on agent .started so a new prompt acts as the natural acknowledgement
  • Display numeric count next to the bell icon in the sidebar row

Summary by CodeRabbit

Release Notes

  • New Features

    • Pending workspace completions now display a count alongside the indicator bell icon.
    • Updated accessibility labels to dynamically reflect the number of pending completions.
  • Bug Fixes

    • Improved handling of pending completion state to prevent stale completions from lingering when workspace activity begins.

- Remove auto-clear-on-focus from enqueueCompletion() so the focused
  surface's completion stays pending and counts correctly
- Clear pending completion on agent .started so a new prompt acts
  as the natural acknowledgement
- Display numeric count next to the bell icon in the sidebar row
@coderabbitai

coderabbitai Bot commented Mar 15, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 49892c17-6771-4943-9858-98fb3ff2cadf

📥 Commits

Reviewing files that changed from the base of the PR and between 254b0ce and dd7f5cc.

📒 Files selected for processing (2)
  • Sources/Shellraiser/Features/WorkspaceSidebar/WorkspaceSidebarRow.swift
  • Sources/Shellraiser/Services/Workspaces/WorkspaceManager+Completions.swift

📝 Walkthrough

Walkthrough

The pull request enhances the pending completion indicator UI to display a numeric count with accessibility labels, and refactors the completion handling logic to proactively clear pending state when a new agent activity event starts instead of reactively handling focused completions.

Changes

Cohort / File(s) Summary
Pending Indicator UI
Sources/Shellraiser/Features/WorkspaceSidebar/WorkspaceSidebarRow.swift
Enhanced WorkspacePendingIndicator to accept and display a count parameter alongside the bell icon, with updated accessibility labels reflecting the dynamic completion count.
Completion Handling Logic
Sources/Shellraiser/Services/Workspaces/WorkspaceManager+Completions.swift
Removed passive focus-based completion handling from enqueueCompletion; introduced proactive clearing of pending completion state in handleAgentActivityEvent when agent activity starts, with corresponding surface manager updates.

Sequence Diagram(s)

sequenceDiagram
    participant AgentActivity as Agent Activity<br/>(External Trigger)
    participant WorkspaceManager as WorkspaceManager
    participant SurfaceManager as SurfaceManager
    participant Notifications as Notification<br/>System
    participant UI as Workspace<br/>Sidebar UI

    AgentActivity->>WorkspaceManager: Activity Event Starts
    
    rect rgba(100, 150, 255, 0.5)
    Note over WorkspaceManager: New Proactive Clearing
    WorkspaceManager->>SurfaceManager: clearPendingCompletion(workspace,<br/>surface, context)
    WorkspaceManager->>Notifications: Remove pending<br/>notifications
    end
    
    Note over WorkspaceManager: Resume normal activity handling
    
    rect rgba(100, 200, 100, 0.5)
    Note over UI: Count Display
    SurfaceManager->>UI: Update pending count
    UI->>UI: Display count with<br/>bell indicator
    end
Loading

Possibly Related PRs

  • Add workspace busy badge indicator #15: Modifies the same WorkspaceSidebarRow pending indicator rendering and WorkspaceManager+Completions completion handling logic, touching both the UI component and manager behavior in parallel.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main changes: fixing a pending count bug and adding count display in the sidebar bell icon.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch notifications-counter
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@trydis
trydis merged commit caf7094 into main Mar 15, 2026
2 checks passed
@trydis
trydis deleted the notifications-counter branch March 15, 2026 14:16
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.

1 participant