feat(notifications): add option to notify even when window is focused#18003
Open
coygeek wants to merge 1 commit intoanomalyco:devfrom
Open
feat(notifications): add option to notify even when window is focused#18003coygeek wants to merge 1 commit intoanomalyco:devfrom
coygeek wants to merge 1 commit intoanomalyco:devfrom
Conversation
Currently, system notifications are suppressed when the OpenCode window has focus. This is inconvenient when running long agent tasks while working in other sessions within the same window. Add a Notify when focused toggle under Settings > Notifications that bypasses the focus check in both web and desktop platform notify implementations. Default is off, preserving existing behavior.
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #18004
Type of change
What does this PR do?
Adds a "Notify when focused" toggle under Settings > Notifications. When enabled, system notifications fire even when the OpenCode window has focus, instead of being suppressed.
I ran into this because I run long agent tasks while working in other sessions within the same OpenCode window. The focus-suppression meant I'd miss notifications for completed background sessions.
The implementation adds an optional
{ skipFocusCheck?: boolean }parameter toPlatform.notify(). The notification context threads the newnotifyWhenFocusedsetting into both notify call sites (agent idle and error). Both platform implementations (web entry.tsx and desktop index.tsx) conditionally skip the existing focus check when the flag is set.Default is off — zero behavior change for existing users.
How did you verify your code works?
Read the source to understand the existing notification flow, traced through both web and desktop platform implementations, and verified the type changes are consistent across the Platform interface, both implementations, and the caller in notification.tsx.
Screenshots / recordings
No UI screenshot yet — the change adds one additional toggle row to the existing notification settings section, following the same SettingsRow + Switch pattern as the Agent/Permissions/Errors toggles above it.
Checklist