Skip to content

fix(desktop): suppress notifications when viewing active pane#941

Merged
Kitenite merged 5 commits intomainfrom
fix-903
Jan 25, 2026
Merged

fix(desktop): suppress notifications when viewing active pane#941
Kitenite merged 5 commits intomainfrom
fix-903

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Jan 25, 2026

Summary

Implements Slack-pattern notification behavior - notifications and sounds are skipped when the user is already viewing the pane that triggered them.

How it works

Parses currentWorkspaceId directly from the renderer URL via window.webContents.getURL() when a notification fires. No state sync needed.

Notifications are suppressed when ALL conditions are met:

  1. Window is focused
  2. User is viewing the workspace containing the pane (parsed from URL)
  3. The tab is active in that workspace
  4. The pane is focused in that tab

Test plan

  • Open a workspace and focus a terminal pane
  • Trigger an agent event (e.g., permission request) in that pane
  • Verify no notification sound or popup appears
  • Switch to a different tab/pane and trigger event in original pane
  • Verify notification now appears
  • Minimize/unfocus the window and trigger event
  • Verify notification appears

Closes #903

Summary by CodeRabbit

  • Bug Fixes
    • Eliminated redundant notifications for content you're already viewing in your current workspace, tab, or pane. This reduces notification clutter and creates a cleaner, more focused user experience.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 25, 2026

Warning

Rate limit exceeded

@Kitenite has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds an early-exit guard to agent lifecycle notifications in the main desktop window. When the user is already viewing the related workspace, tab, or pane, the notification is suppressed by parsing the current workspace from the renderer URL hash, checking the active tab and focused pane state, and returning early if the event matches the current view.

Changes

Cohort / File(s) Summary
Notification Guard Enhancement
apps/desktop/src/main/windows/main.ts
Added early-exit logic for agent lifecycle notifications that suppresses notifications when the user is already viewing the associated workspace/tab/pane. Includes workspace ID parsing from renderer URL hash, active tab and focused pane state checking, and error logging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Quiet notifications, hooray! No more buzzing when I'm here to stay,
A guard so gentle, so kind and true, knows when you're watching, skips the cue,
Less noise, more peace, the rabbit's delight—less distraction in your busy sight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: suppressing notifications when viewing the active pane, which is the core objective of this PR.
Description check ✅ Passed The description is comprehensive, covering summary, implementation details, and test plan. All key sections are well-documented with clear explanations.
Linked Issues check ✅ Passed The PR successfully addresses the core requirement from #903: suppressing notifications when the window is focused and the user is actively viewing the pane that triggered the notification.
Out of Scope Changes check ✅ Passed The changes are focused solely on implementing notification suppression logic when viewing active panes, directly aligned with the objectives of #903.

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


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

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

Implements Slack-pattern notification behavior - notifications and sounds
are skipped when the user is already viewing the pane that triggered them.

Checks window.isFocused() and parses currentWorkspaceId directly from
the renderer URL, avoiding state sync overhead.

Closes #903
@Kitenite Kitenite merged commit c9400c6 into main Jan 25, 2026
5 checks passed
@Kitenite Kitenite deleted the fix-903 branch January 25, 2026 20:23
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

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.

Notifications show even when Superset is focused and active

1 participant