feat(desktop): in-app notification center (OS side is a follow-up)#3122
Open
HUQIANTAO wants to merge 1 commit into
Open
feat(desktop): in-app notification center (OS side is a follow-up)#3122HUQIANTAO wants to merge 1 commit into
HUQIANTAO wants to merge 1 commit into
Conversation
Long-running agent events (idle, plan approval, update available,
plugin hot-add, background job done) deserve a visible signal. The
kernel doesn't yet expose a Notify() binding for the OS
notification center, but we can stand up the in-app half of the
contract now so the rest of the app has a single emit point
when the binding lands.
Add lib/notificationCenter.ts: a tiny pub-sub on a 50-entry ring
of Notification records. Identical-id events are deduped (a
recurring 'agent:idle' refreshes the at and flips read back to
false, but doesn't grow the list). The store lives in module
scope — no React state, no library. Listeners are React
components; the snapshot is defensive-copied per render.
Add components/NotificationCenter.tsx:
- NotificationCenter: a drawer (reuses the existing .drawer
shell) listing entries reverse-chronologically with a
'Clear all' button. Opening the drawer calls markAllRead()
so the unread dot disappears.
- NotificationBell: a topbar chip with a small red unread
dot. Subscribes to the store independently so the dot
updates without the parent re-rendering.
The store is intentionally not persisted across reloads — a
reboot is a deliberate user action and the source events can
be re-triggered if needed. Persistence is a separate concern.
The follow-up is a kernel-side App.Notify(title, body, level)
Wails binding that dispatches runtime.MessageDialog / OS
notification alongside the in-app push.
43b6d8c to
64d234c
Compare
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.
Long-running agent events (idle, plan approval, update available, plugin hot-add, background job done) deserve a visible signal. The kernel doesn't yet expose a
Notify()binding for the OS notification center, but we can stand up the in-app half of the contract now so the rest of the app has a single emit point when the binding lands.Add
lib/notificationCenter.ts: a tiny pub-sub on a 50-entry ring of Notification records. Identical-id events are deduped. Addcomponents/NotificationCenter.tsxwith a drawer and a topbar bell with an unread dot.The follow-up is a kernel-side
App.Notify(title, body, level)Wails binding that dispatchesruntime.MessageDialog/ OS notification alongside the in-app push.