Skip to content

Aggregated dashboard across multiple instances #12

@offendingcommit

Description

@offendingcommit

Context

The data layer already supports an instances[] array with a single activeId (packages/web/src/lib/config.ts). With Cloud + Self-Hosted presets now in place, users can add multiple connections — but the dashboard still only ever queries the active one.

A natural follow-up is a dashboard view that fans out across all stored instances (workspaces, sessions, queue stats) and renders them side-by-side with an instance badge.

Why it's not trivial

The API client is hard-coded to the active instance (packages/web/src/api/client.ts:1-25). TanStack Query keys are entity-only (packages/web/src/api/keys.ts) — switching instances today calls qc.clear() (packages/web/src/hooks/useInstances.ts:74) precisely because the cache would otherwise collide.

To aggregate, we'd need:

  1. A client factory createHonchoClient(instanceId) instead of a singleton tied to loadConfig().
  2. Instance id threaded into every query key so the same workspace from two instances is cached independently.
  3. New useAllWorkspaces() / useAllQueueStats() hooks that fan out across instances[] and merge results, marking each row with the originating instance.
  4. Sidebar "All Instances" toggle that switches the dashboard between single-instance (current) and aggregated views.
  5. UI affordance to distinguish duplicate-name entities ("workspace prod on Cloud" vs "workspace prod on Local").

Estimated 2–3 days of work.

Acceptance

  • Dashboard can render workspace lists from multiple instances simultaneously
  • Each row shows which instance it came from
  • Queue status banner aggregates across instances when "All" is selected
  • Switching back to a single instance preserves current behavior
  • No cache collisions when the same workspace name exists on two instances

Related

Surfaced during review of #(PR for Honcho Cloud preset)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions