Add "Open System Settings" button to denied notifications banner (WAR-3575) - #14932
Draft
warp-agent-staging[bot] wants to merge 2 commits into
Draft
Conversation
…-3575) When macOS denies desktop notification permissions, the notifications error banner only offered "Troubleshoot" (a docs link) and "Close", since re-requesting permission is a no-op once macOS has denied it. Add an "Open System Settings" button, shown only in that denied state on macOS, that deep-links directly into System Settings > Notifications (scoped to Warp's own bundle identifier via the app_id-based ?id= query param) so users can fix the permission without hunting through System Settings themselves. Co-Authored-By: Warp Agent <agent@warp.dev>
1. Use the macOS 13+ (Ventura) System Settings extension bundle ID
(com.apple.Notifications-Settings.extension) for the Notifications
deep link, falling back to the legacy System Preferences pane ID
(com.apple.preference.notifications) on older macOS, detected at
runtime via NSProcessInfo.isOperatingSystemAtLeastVersion. Split the
URL builder into a pure, version-agnostic function plus a thin
production wrapper so both pane-ID branches can be tested
deterministically.
2. Add the same "Open System Settings" CTA to the notifications
discovery banner's PermissionsDenied branch -- the banner shown
immediately after the user denies the macOS permission prompt from
"Enable", which is the exact moment WAR-3575 describes. The
error-banner CTA (for a later failed-send while already denied)
remains from the previous commit.
3. Extract the button-list-building logic in both banners into
dedicated, directly-testable functions, and add regression tests:
- Unit tests asserting exactly which actions are offered per error
state / permission outcome for both banners.
- Integration tests that drive each banner into a real
PermissionsDenied state via production code paths, dispatch the
CTA's action through the real handler, and capture the URL that
reaches the platform's open-url hook via ctx.set_before_open_url.
- A pure test validating both the System Settings and legacy System
Preferences URL formats.
Co-Authored-By: Warp Agent <agent@warp.dev>
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.
Description
Fixes WAR-3575: when the user has denied macOS's notification permission request, Warp's notification banners previously offered no direct path back to the OS setting.
Two banners are affected, and both are covered:
Both now show an "Open System Settings" button, offered only when the active state is
PermissionsDeniedand only on macOS (re-invoking the permission request is a no-op once macOS has denied it once — the system won't show the prompt again). The button deep-links viax-apple.systempreferences:directly into System Settings → Notifications, using the correct pane identifier for the running macOS version:com.apple.Notifications-Settings.extensioncom.apple.preference.notificationsdetected at runtime via
NSProcessInfo.isOperatingSystemAtLeastVersion. The URL is also scoped with Warp's own bundle identifier (ChannelState::app_id()) via the?id=query parameter, so it works correctly across every channel (Stable/Preview/Dev/Local/Oss) without hardcoding.The change is compile-time gated behind
#[cfg(target_os = "macos")](enum variants, mouse-state fields, button rendering, and action handling), so non-mac platforms are unaffected and still compile.ready-to-specorready-to-implement. (Issue predates this label; work was assigned directly.)Changes
crates/warp_core/src/macos.rs(+Cargo.toml): addis_system_settings_era(), detecting whether the running macOS is Ventura (13.0)+ viaNSProcessInfo.app/src/terminal/view.rs:mac_notification_settings_url_for(is_system_settings_era, app_id)(pure, testable) +mac_notification_settings_url()(production wrapper); wire the newOpenSystemSettingsaction into both banners' action handlers.app/src/terminal/view/inline_banner/notifications_error.rs:OpenSystemSettingsaction/button whenPermissionsDenied; button-list building extracted into a directly-testable function.app/src/terminal/view/inline_banner/notifications_discovery.rs: same CTA added to thePermissionsDeniedoutcome branch; title/button building extracted into a directly-testable function.notifications_error_tests.rs/notifications_discovery_tests.rs, plus tests inview_tests.rs.Testing
./script/run(via a macOS verification runner — see below; I don't have a macOS environment directly in my own sandbox)Linux sandbox (confirms the mac-gated code doesn't regress other platforms):
cargo check -p warp --bin warp-oss(+--tests),cargo clippy -p warp --all-targets --tests -- -D warnings,./script/format --checkall pass.Real macOS verification (macOS 26.3.1, Apple Silicon), against this exact branch/commit:
cargo test -p warp --lib notification→ 48 passed, 0 failed, including:PermissionsDeniedstate via production code paths, dispatch the actual CTA action handler, and assert on the exact URL captured viactx.set_before_open_url.git statusclean afterward) to reach the livePermissionsDeniedbanner in a running./script/runbuild, then:open— both correctly launch System Settings on this macOS version.Known limitation (environment, not code): on this sandbox, "Warp Local" was never registered with the OS via a real
UNUserNotificationCenterpermission request (no code-signed, long-lived install), sox-apple.systempreferences:...?id=dev.warp.Warp-Localresolves to the generic top-level Notifications pane rather than an app-specific sub-page — this is expected per Apple's behavior and is a property of the test environment, not the PR's code. The full click chain (button → action → URL → OS navigation) was verified end-to-end regardless.Known caveat (macOS behavior, not specific to this change): if System Settings is already open to a different pane in the background, macOS brings the existing window forward without navigating to the requested pane — a pre-existing macOS quirk with the
x-apple.systempreferences:URL scheme.Screenshots / Videos
The denied-notifications banner, showing the "Open System Settings" button:
System Settings after clicking "Open System Settings":
Agent Mode
Conversation: https://staging.warp.dev/conversation/0c7f30f9-65c1-4e51-9af7-692edf842b38
Run: https://oz.staging.warp.dev/runs/019ff0ac-37a2-781e-b08b-40c868e3cfaa
This PR was generated with Oz.