Skip to content

feat(web): a notification centre of every daemon's notifications - #378

Closed
futrime wants to merge 1 commit into
mainfrom
feat/web-notification-centre
Closed

futrime wants to merge 1 commit into
mainfrom
feat/web-notification-centre

Conversation

@futrime

@futrime futrime commented Oct 12, 2026

Copy link
Copy Markdown
Member

Unit 10 of the multi-daemon + notifications plan: the page's notification centre, built on C7 (/api/notifications*) and C8 (invoke('notify')).

What

  • static/notifications.js: the bell (data-hmz=notifications) with an unread count, placed in the sidebar's .side-top row; its menu (data-hmz=notification-menu) lists the history newest first: kind (Done, Failed, Stopped, Question, Chat turn), daemon (Local or name), flow and text, time. It has Mark read and Clear.
  • Clicking an item reads it and opens #/[@daemon/]live?workspace=… for asked/listening, or #/[@daemon/]epics/<epic> for ended ones.
  • Toast cards (data-hmz=notification-toasts) at the bottom right, auto-dismissed after 6 s, click to open. ui.js toast is unchanged.
  • System notifications while the page is hidden or unfocused, and only when settings system is on: in the app, __TAURI_INTERNALS__.invoke('notify', {title, body, address}); elsewhere, new Notification when the permission is granted, which focuses the window and navigates on click.
  • The page rereads the list when the stream opens (to cover the gap after the first GET) and when the tab is shown again, keeping anything newer that it heard in the meantime. Retries back off and stop on 401.
  • A 404 from GET /api/notifications hides the bell, so this is green without the server unit.
  • doubles_web.opened gains routed=, which sets page.route fakes before the page loads.
  • Docs: docs/user/web.md → Notifications.

Tests

  • tests/integration/test_web_notification_centre.py (Chromium + WebKit) covers the badge, menu items, mark read, clear, picking an item, a toast from SSE, no bell on 404, the browser Notification path (system on/off) and the app notify path.
  • uv run pytest tests/unit and tests/integration/test_web_*.py pass.
  • Live check against hmz web with routed fakes, screenshots in light and dark at 1280 and 375.

🤖 Generated with Claude Code

A bell in the sidebar's top row with the unread count, a menu of the
history newest first (kind, daemon, flow and what it said, how long ago)
with Mark read and Clear, a card at the bottom right for each one heard
on the stream, and -- while the page is hidden or unfocused -- the
browser's Notification or the macOS app's `notify` command. Clicking any
of them reads it and opens the epic going or the epic that ended.

Built on the global /api/notifications endpoints; where the server has
none, the bell is hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@futrime

futrime commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Landed together in #385.

@futrime futrime closed this Oct 12, 2026
@futrime
futrime deleted the feat/web-notification-centre branch October 12, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants