Repository navigation
feat(mac): show native notification permission in dashboard Notifications settings - #110646
Conversation
…ions settings The Mac app's embedded Control UI showed the web-push section as Unsupported/Not subscribed even though the app delivers notifications natively. The dashboard now installs an openclawNotifications WebKit bridge (status / request-permission / send-test) and the Notifications settings page renders native permission state with Enable, Open System Settings, and Send test actions when hosted in the Mac app. Browsers keep the existing web-push UI. The notifications section renderer moved out of the oversized config view module.
|
Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 8:15 AM ET / 12:15 UTC. Summary PR surface: Source +239, Tests +140, Docs +5, Other +123. Total +507 across 15 files. Reproducibility: no. high-confidence live reproduction was supplied. The source-level path is clear: a provisional status is rendered as granted while the reviewed native sender accepts only authorized status. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Align provisional authorization with native delivery semantics, obtain redacted macOS after-fix evidence for permission request, denied-settings recovery, focus resync, and test delivery, then have the macOS owner explicitly approve the WebKit bridge boundary. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was supplied. The source-level path is clear: a provisional status is rendered as granted while the reviewed native sender accepts only authorized status. Is this the best way to solve the issue? No. The narrowest maintainable fix is to make the displayed provisional state agree with actual native delivery behavior, then prove the full embedded macOS flow rather than relying only on unit tests. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 74880cb56f9e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +239, Tests +140, Docs +5, Other +123. Total +507 across 15 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
…n gates Move the notifications section props to a leaf contract (no view.ts type import), unexport the status-event constant, use bracket access for the injected dunder global, default-case the status switch, and refresh the native i18n inventory line offset.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0af3c8b207
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case .authorized, .provisional: | ||
| "granted" |
There was a problem hiding this comment.
Treat provisional notification permission consistently
When macOS reports .provisional (Apple documents it as provisionally authorized to post noninterruptive notifications: https://developer.apple.com/documentation/usernotifications/unauthorizationstatus/provisional), this maps the dashboard UI to granted, which shows only the native “Send test” action. That action calls NotificationManager().send, but apps/macos/Sources/OpenClaw/NotificationManager.swift only accepts .authorized, so provisional users get a button that silently fails and no in-page way to request full permission or open Settings; either keep provisional out of the granted UI state or make the native send path accept it.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
…ions settings (openclaw#110646) * feat(mac): show native notification permission in dashboard Notifications settings The Mac app's embedded Control UI showed the web-push section as Unsupported/Not subscribed even though the app delivers notifications natively. The dashboard now installs an openclawNotifications WebKit bridge (status / request-permission / send-test) and the Notifications settings page renders native permission state with Enable, Open System Settings, and Send test actions when hosted in the Mac app. Browsers keep the existing web-push UI. The notifications section renderer moved out of the oversized config view module. * fix(ui): break config view import cycle and satisfy lint/deadcode/i18n gates Move the notifications section props to a leaf contract (no view.ts type import), unexport the status-event constant, use bracket access for the injected dunder global, default-case the status switch, and refresh the native i18n inventory line offset.
…ions settings (openclaw#110646) * feat(mac): show native notification permission in dashboard Notifications settings The Mac app's embedded Control UI showed the web-push section as Unsupported/Not subscribed even though the app delivers notifications natively. The dashboard now installs an openclawNotifications WebKit bridge (status / request-permission / send-test) and the Notifications settings page renders native permission state with Enable, Open System Settings, and Send test actions when hosted in the Mac app. Browsers keep the existing web-push UI. The notifications section renderer moved out of the oversized config view module. * fix(ui): break config view import cycle and satisfy lint/deadcode/i18n gates Move the notifications section props to a leaf contract (no view.ts type import), unexport the status-event constant, use bracket access for the injected dunder global, default-case the status switch, and refresh the native i18n inventory line offset.
What Problem This Solves
The Control UI Settings → Notifications page only knows about browser web push. Inside the macOS app's embedded dashboard (WKWebView), web push is unsupported, so the page shows "Unsupported / Not subscribed" even though the Mac app delivers notifications natively through
UNUserNotificationCenter(the node runtime's notify path). Users see a dead, misleading settings page in the app that actually has the best notification support.Why This Change Was Made
The dashboard webview is "only partially a website": the host app owns notification delivery, so the page must reflect the host's native permission state instead of browser push capability. This adds a small WebKit script-message bridge (
openclawNotifications) following the existing dashboard bridge patterns (openclawLink,openclawWindowDrag,openclawUpdate):status/request-permission/send-testrequests, publishing{permission: granted|denied|notDetermined}back via the same CustomEvent+global pattern as the native history bridge.request-permissionreusesPermissionManager.ensure([.notifications], interactive: true), which prompts when undetermined and opens System Settings → Notifications when denied.send-testposts a real native notification.ui/src/pages/config/view.tsintoui/src/pages/config/notifications-section.ts.User Impact
Mac app users see real notification state on Settings → Notifications: whether the app can notify, a one-click permission request, a shortcut to System Settings when denied, and a native test notification. No behavior change for browsers or other hosts (handler absent → web-push UI as before).
Evidence
cd apps/macos && swift build— Build complete (verified twice, including after the.ephemeralcleanup below).cd apps/macos && swift test --filter DashboardNotificationsBridgeTests— 3 tests pass (request parsing, invalid-request rejection, permission-label mapping including raw-value-4 ephemeral → notDetermined).ui/src/app/native-notifications.test.tscover bridge probe, status seeding from the injected global, event validation, focus re-sync, action posting, and dispose; they run in the UI CI lane (this worktree has no node_modules, so UI test execution is delegated to hosted CI per repo policy).git diff --checkclean; changed TS files formatted with oxfmt.gpt-5.6-sol): one P1 raised on an earlier revision (UNAuthorizationStatus.ephemeralis unavailable-by-name on macOS; it compiled only because pattern position tolerates it). Resolved by dropping the case into a commenteddefaultbranch; the rerun reports "patch is correct" with zero findings.ui/src/pages/config/view.ts(grandfathered oversized) shrank by ~150 lines via the section extraction; web-push rendering is byte-identical to before.receiveUpdateMessage: main frame only, same webview,isTrustedLinkSourceorigin/path check.