Skip to content

feat(web): Daemons and Notifications settings pages - #376

Closed
futrime wants to merge 1 commit into
mainfrom
feat/web-settings-daemons-notifications
Closed

futrime wants to merge 1 commit into
mainfrom
feat/web-settings-daemons-notifications

Conversation

@futrime

@futrime futrime commented Oct 12, 2026

Copy link
Copy Markdown
Member

Summary

Unit 9 of the multi-daemon + notifications batch.

  • New views/settings/daemons.js: Local (fixed) plus each SSH daemon from GET /api/daemons with its state (up, connecting, installing, failed, idle), detail and version. The list polls while a daemon is connecting or installing, redrawing only the state cells so that a pending Remove confirmation or a Connect refusal stays put. There is an add/edit SSH form, filled in a part at a time (name, host, user, port, identity file via the path picker, proxy jump, SSH options as ordered pairs), which saves through POST /api/daemons. Import takes a checklist from GET /api/daemons/hosts and posts it to POST /api/daemons/import {aliases}. Remove asks first and goes through POST /api/daemons/remove, and Connect through POST /api/daemons/{name}/connect. A refusal is shown where it happened.
  • New views/settings/notifications.js: toggles for the C2 kinds (Done, Failed, Stopped, Questions, Chat turns) and for System, read and written through /api/notifications/settings and saved on each change. Outside the app, an Allow button calls Notification.requestPermission() from the click and then shows the resulting state.
  • Both are registered in the settings PAGES map. A 404 from their endpoints shows Unavailable.
  • A CSS block /* settings: daemons, notifications */ lays the daemon table out as stacked blocks at phone width.
  • Docs: docs/user/web.md (Settings table) and docs/reference/web.md (settings pages).

Tests

  • tests/integration/test_web_settings_pages.py (Chromium and WebKit, with endpoints faked through page.route): add with options, import, remove with confirmation, a refused connect, the Unavailable state, toggles saving, and the permission button with a stubbed Notification.
  • uv run pytest tests/unit and tests/integration/test_web_*.py pass.
  • Pre-commit passes apart from pyright's macOS-only false positives on Linux-only attributes in files this PR doesn't touch.
  • Live check against hmz web --port 0 with routed fakes: light, dark, wide and phone screenshots, with no horizontal overflow.

🤖 Generated with Claude Code

Settings gains a Daemons page -- Local and every SSH daemon with its
state, an SSH form a part at a time, import from the SSH config, connect,
and remove asked first -- and a Notifications page with the kinds, the
system toggle and the browser's Allow. Both say Unavailable where the
server does not serve their endpoints yet.

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

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-settings-daemons-notifications 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