Skip to content

feat(web): turn the sidebar's foot into a daemon bar and picker - #373

Closed
futrime wants to merge 1 commit into
mainfrom
feat/web-daemon-bar
Closed

futrime wants to merge 1 commit into
mainfrom
feat/web-daemon-bar

Conversation

@futrime

@futrime futrime commented Oct 12, 2026

Copy link
Copy Markdown
Member

Unit 7 of the multi-daemon and notifications plan: the sidebar daemon bar and picker.

What changes

  • The sidebar's foot is now the daemon bar (data-hmz=daemon-bar). It shows the current daemon's name (Local, or the SSH entry's name), its host, a state dot (up, connecting, installing, failed, not connected) and the live count or idle.
  • Clicking it opens the daemon picker (data-hmz=daemon-picker, menu name Daemon). It lists GET /api/daemons with each daemon's state and switches on a click. A failed daemon gets Connect (POST /api/daemons/{name}/connect). Manage opens #/settings/daemons. The machine items stay: Update when newer, Import, Settings, Usage, Download.
  • A 404 from /api/daemons means Local only.
  • Switching follows C6:
    • If api.js exports switchDaemon, the picker calls it. The current daemon is read through daemon().
    • Otherwise a local fallback rewrites the hash to #/@<name>/new and dispatches hmz:daemon (only when onDaemon is missing).
    • On a phone, switching closes the drawer.
  • The machine-menu hook is gone. The tests that clicked it now click daemon-bar.
  • Docs updated: docs/user/web.md, docs/user/backups.md, docs/reference/cli.md.

Tests

  • New tests/integration/test_web_daemon_bar.py, in chromium and webkit. An init script answers /api/daemons in place of the unit-3 endpoint. The test checks the bar text, the picker's list, Connect, that picking lab sets #/@lab/new, that Manage opens #/settings/daemons, and Local-only on a 404 at phone width.
  • uv run pytest tests/unit (5690 passed) and tests/integration/test_web_*.py (137 passed).
  • Live check against hmz web, with screenshots in light and dark at 1280 and 375 widths. The address and the bar survive a reload.

The scoped data (runs listed per daemon) comes from unit 6, the endpoints from units 3 and 4, and the Settings → Daemons page from unit 9.

🤖 Generated with Claude Code

The bar names the daemon the page is of, its host, how it stands and
how many epics are live on it. Its picker lists GET /api/daemons (Local
alone on a 404), switches by the address's @<name>, offers Connect for
a failed daemon and Manage for Settings -> Daemons, and keeps Update,
Import, Settings, Usage and Download.

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

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-daemon-bar branch October 12, 2026 23:55
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