openwolf icon indicating copy to clipboard operation
openwolf copied to clipboard

feat: multi-project dashboard with in-page project switcher

Open bluesky8318 opened this issue 5 months ago • 0 comments

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:

  1. openwolf daemon stop in the current project
  2. cd /path/to/other-project
  3. openwolf dashboard to 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 via OPENWOLF_PROJECT_ROOT at 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:

  1. The daemon reads the central registry (~/.openwolf/registry.json) to discover all registered projects.
  2. Add a project selector dropdown in the dashboard sidebar (near the project name).
  3. When the user switches projects in the UI, the daemon reloads .wolf/ data from the selected project and pushes updated state via WebSocket.
  4. 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.

bluesky8318 avatar Jun 09 '26 10:06 bluesky8318