feat(dashboard): multi-project switcher with runtime switching - #29
Open
Camille1024 wants to merge 2 commits into
Open
feat(dashboard): multi-project switcher with runtime switching#29Camille1024 wants to merge 2 commits into
Camille1024 wants to merge 2 commits into
Conversation
Add a project switcher to the dashboard header that lets users switch between KIP and KIP-infra (and any future sibling projects) without restarting the server. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- docker-compose.yml: change dashboard build context to Barchon repo (src/barchon) so the deployed image always reflects the canonical UI - kip-state/index.py: change default output from .dashboard/state.db to .barchon/state.db to match Barchon's nodes route expectation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
state.db--lean-rootargument tokip-state/index.pyso it works for projects whose Lean source directory is not namedKIPChanges
Server
index.ts— introduceProjectState(mutable) withallProjects;discoverProjects()scans sibling directories for.barchon/oragents/routes/project.ts— new endpoints:GET /api/project,GET /api/projects,POST /api/project/switchClient
App.tsx—<ProjectSwitcher />replaces hardcoded<h1>KIP</h1>; renders a static badge when only one project is available, a dropdown otherwisehooks/useApi.ts—useProjects(),useProjectSwitch()(invalidates all queries on switch)Nodes.tsx— resetchaptersIniton project change; guard SVG fetch when graph has no nodes (avoids "render failed" for empty/no-DB projects)Deploy
docker-compose.yml— mount both project roots as/projects/KIPand/projects/KIP-infraso they are siblings inside the containerTools
kip-state/index.py— add--lean-rootflag (default:<project>/KIP)How to add a new project
1. Mount the project directory
Edit
docker-compose.yml:Restart the container:
2. Build state.db
python3 /root/KIP/tools/kip-state/index.py \ --project /path/to/NEW-PROJECT \ --lean-root /path/to/NEW-PROJECT/LeanSourceDir # omit if the Lean dir is named KIPThe database is written to
/path/to/NEW-PROJECT/.dashboard/state.db.3. Done
Refresh the dashboard — the new project appears automatically in the header dropdown.
discoverProjects()scans all siblings of the primary project path for directories containingagents/or.barchon/.Notes
KIP--lean-rootkip-stateto refreshstate.dbagents/diragents/dir, or add.barchon/ui/source changes; adding a project only needs a container restartTest plan
state.dbshows "No graph data (state.db not built)" instead of "render failed"🤖 Generated with Claude Code