-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ui): migrate to Vite React with Heidi backend integration #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Heidi CLI UI Migration Worklog | ||
| ## Date: 2026-02-17 | ||
| ## Branch: feat/ui-work-theme (migrating to feat/ui-packaging) | ||
|
|
||
| ### Summary | ||
| Successfully migrated Heidi CLI UI from legacy architecture to new Vite-based React application, integrated with Heidi backend API, and established production packaging/release pipeline. | ||
|
|
||
| ### Commit Range | ||
| Base: bfd38de (Merge pull request #69 - palette-ux-improvements) | ||
| Changes: Working tree modifications (not yet committed as single squashed commit) | ||
| Estimated files changed: 36 files, +2682/-3648 lines | ||
|
|
||
| ### Key Deliverables | ||
|
|
||
| 1. **UI Migration (dev_1_ui_migrator)** | ||
| - Cloned work UI repo (commit: d512c199) as visual base | ||
| - Removed Next.js server.ts, socket.io, SSH dependencies | ||
| - Created Vite React app structure (src/main.tsx entry) | ||
| - Implemented Heidi API client layer: | ||
| - src/api/heidi.ts: health(), listAgents(), listRuns(), getRun(), runOnce(), runLoop(), chat(), cancelRun() | ||
| - src/api/stream.ts: SSE streaming with polling fallback | ||
| - Migrated components: Sidebar, ChatArea, AgentArea, TerminalArea, SettingsModal, RightSidebar | ||
| - Terminal tab: Safe MVP placeholder (no SSH, no socket.io) | ||
|
|
||
| 2. **Configuration** | ||
| - vite.config.ts: port 3002, strictPort, allowedHosts (heidiai.com.au) | ||
| - Proxy routes to backend: /health, /agents, /run, /loop, /chat, /runs, /api | ||
| - No direct Gemini/OpenAI keys in browser (all through Heidi backend) | ||
|
|
||
| 3. **Packaging & Release (dev_3_packaging_release)** | ||
| - UI builds to ui/dist (Vite standard output) | ||
| - CLI command: `heidi ui build` (builds with --base=/ui/, copies to ~/.cache/heidi/ui/dist) | ||
| - Backend serves SPA at /ui/ with fallback routing | ||
| - Package data: pyproject.toml includes ui_dist/**/* in setuptools package-data | ||
| - Dist resolution order: HEIDI_UI_DIST env -> HEIDI_HOME/ui/dist -> XDG_CACHE/heidi/ui/dist -> bundled ui_dist | ||
| - CI guardrail: GitHub Actions job ui-build (Node 20, npm cache, verifies dist artifacts) | ||
| - Git policy: src/heidi_cli/ui_dist/ ignored (line 80 in .gitignore) | ||
|
|
||
| 4. **Documentation** | ||
| - README.md: Added Web UI section with dev/prod instructions | ||
| - Port reference table: 3002 (Vite dev), 7777 (backend) | ||
| - CORS/allowedHosts documentation for custom domains | ||
|
|
||
| ### Verification Steps Completed | ||
| 1. ✓ UI builds: npm ci && npm run build → ui/dist/index.html + assets/ | ||
| 2. ✓ CLI build: heidi ui build --force → ~/.cache/heidi/ui/dist/ | ||
| 3. ✓ Backend serve: HEIDI_UI_DIST=... heidi serve → /ui/ accessible | ||
| 4. ✓ Package install: pip install -e '.[dev]' → heidi ui --help works | ||
| 5. ✓ CI job: .github/workflows/ci.yml includes ui-build job | ||
| 6. ✓ Git ignore: src/heidi_cli/ui_dist/ properly excluded | ||
|
|
||
| ### Notes | ||
| - UI assets are built during packaging and included in wheel/sdist | ||
| - Source UI in ui/ remains in git (source code) | ||
| - Built UI in src/heidi_cli/ui_dist/ is git-ignored but setuptools-included | ||
| - Default behavior: heidi serve falls back to bundled ui_dist if no cache built | ||
|
|
||
| ### Breaking Changes | ||
| None - this is additive. Legacy CLI commands remain functional. | ||
|
|
||
| ### Testing Required Before Merge | ||
| 1. Clean install smoke test (container/fresh venv) | ||
| 2. Verify no 404s on asset paths with correct base=/ui/ | ||
| 3. Confirm SPA routing works (refresh on /ui/ doesn't 404) | ||
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The date
2026-02-17is set far in the future. This appears to be a typo and could be confusing. Please correct it to the actual date of the work.