Repository navigation
Conversation
The page in the app can call `notify` with {title, body, address}. The app
posts it through UNUserNotificationCenter, asking for permission the first
time. Clicking the notification brings the window forward. If the address is
a `#/...` hash, the app opens that hash on hmz web's own origin and goes
nowhere else. A click that launches the app opens the hash once the page is
there.
- The app's commands get an ACL manifest. The remote page
(http://127.0.0.1:*) is granted only `notify`, next to drag and zoom. The
app's own page keeps status, retry, keep and update_now.
- No new crates: objc2, objc2-foundation, block2 and
objc2-user-notifications are already in the lock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Landed together in #385. |
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.
Unit 11 of the multi-daemon and notifications batch. It implements contract C8.
What
notifycommand takes{title, body, address}and posts a native macOS notification throughUNUserNotificationCenter, using objc2'sobjc2-user-notifications.addressis a#/...hash, the window opens that hash at/on hmz web's own origin. It is a hash change only, so the page does not reload..hmzepicopened early.build.rsdeclares an app manifest forstatus,retry,keep,update_nowandnotify.capabilities/page.json(remotehttp://127.0.0.1:*) gets onlyallow-notify, next to drag and zoom.capabilities/default.json(the app's own page) gets the other four.statusis refused..appbundle (cargo run/tauri dev), notifications are only logged, because UNUserNotificationCenter throws for a process that is not in a bundle.objc2,objc2-foundation,block2andobjc2-user-notificationswere already transitive dependencies. The generatedpermissions/autogenerated/is gitignored, likegen/.docs/user/desktop.mdgets a Notifications section.I picked UNUserNotificationCenter over
tauri-plugin-notification, which on macOS goes throughnotify-rust/mac-notification-sys, the deprecated NSUserNotification, and has no click handling. This way gives click-to-focus and click-to-navigate with no new crates.Spec
specs/desktop.mdstill says the page is granted "none of the app's commands". Unit 1 rewrites that for C8. This PR does not edit specs.Tests
cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --lockedpass (46 tests).pnpm tauri build --debug --bundles appbuilds..appwithHUMANIZE_HMZset to a stand-inhmz webthat serves a page callinginvoke('notify', ...):notifyresolves.invoke('status')from the remote page is refused by the ACL.pre-commitpasses except pyright on macOS. That failure is in Linux-only stdlib attributes in files this PR does not touch, and is the same onmain.🤖 Generated with Claude Code