openwolf
openwolf copied to clipboard
feat: multi-project dashboard with in-page project switcher
Problem
Currently, openwolf dashboard runs on a single fixed port (default 18791). When a user has multiple projects initialized with OpenWolf, switching between them requires:
openwolf daemon stopin the current projectcd /path/to/other-projectopenwolf dashboardto restart the daemon
This is cumbersome. If the user simply runs openwolf dashboard from a different project directory while the daemon is already running, the existing code just opens the browser to the already-running daemon — which still shows the previous project.
Root Cause
- The daemon (
wolf-daemon.js) binds to a single project viaOPENWOLF_PROJECT_ROOTat startup. - The dashboard command checks if the port is open; if yes, it skips starting a new daemon and opens the browser directly.
- There is no mechanism to tell the running daemon to switch its project context.
Proposed Solution
Single daemon, multi-project support with in-page project switcher:
- The daemon reads the central registry (
~/.openwolf/registry.json) to discover all registered projects. - Add a project selector dropdown in the dashboard sidebar (near the project name).
- When the user switches projects in the UI, the daemon reloads
.wolf/data from the selected project and pushes updated state via WebSocket. - The dashboard URL could also support a query parameter:
http://localhost:18791?project=my-project.
This way:
- One daemon serves all projects on a single port.
- Users switch projects directly in the dashboard UI — no CLI commands needed.
- The registry (
~/.openwolf/registry.json) already exists and tracks all projects, so the data source is ready.
Alternatives Considered
- Multi-port approach: Give each project a different port in
config.json. This avoids code changes but requires manual port management and remembering which port maps to which project. - CLI-based switching: A wrapper command that stops the old daemon and starts a new one. This works but is less elegant than in-page switching.
The in-page switcher approach provides the best UX and aligns with the existing registry infrastructure.