fix(dash): live slot+model counts in sidebars#306
Merged
Conversation
This was referenced May 25, 2026
Sidebar (chrome.jsx) and McpSidebar (mcp-main.jsx) read static HAL0_DATA.slots/models seed at module load, so counts never updated. Migrate both to useSlots/useModels React Query hooks (already used elsewhere in the dash) and migrate McpSidebar's lemond status block to useLemondRollup, mirroring SidebarStatusBlock in chrome.jsx. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2d38c02 to
2144663
Compare
7 tasks
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.
Bug
Left-sidebar slot + model counts (Sidebar in chrome.jsx and McpSidebar in mcp-main.jsx) read
HAL0_DATA.slots.length/HAL0_DATA.models.length— a module-level static seed inui/src/dash/data.jsx. The counts therefore never update when/api/slotsor/api/modelschanges; they're frozen at app boot.McpSidebar additionally read
HAL0_DATA.lemond.status/.versionfor its status block. The chrome.jsx Sidebar already migrated lemond touseLemondRollupviaSidebarStatusBlock— McpSidebar didn't.Fix
Surgical migration to the existing live React Query hooks (already used in
dash/slots.jsxanddash/models.jsx):chrome.jsx::Sidebar—useSlots()+useModels(), default to0whendatais undefined.mcp-main.jsx::McpSidebar— sameuseSlots/useModelsmigration, plus migrate the lemond status block touseLemondRollup()mirroring theSidebarStatusBlockpattern in chrome.jsx.HAL0_DATAand other consumers are untouched (intentional fallback for the rest of the prototype).Files
ui/src/dash/chrome.jsx(+6 / -2)ui/src/dash/mcp-main.jsx(+14 / -4)Verification ran
On hal0-dev (
/tmp/hal0-sidebar-live/ui):npm run typecheck— clean.npm install+rm -rf node_modules/.vite dist && npm run build— clean.On hal0 LXC (
/opt/hal0/ui, branch checked out + force-reset to remote tip after rebase onto current main):rm -rf node_modules/.vite dist && npm run build— clean (115 modules, dist/assets/index-CY9F9Fds.js, 508 kB).npm run typecheck— clean.grep 'queryKey:\["slots"\]\|queryKey:\["models"\]' dist/assets/index-*.js→ 2 matches (hooks compiled into the bundle).systemctl restart hal0-api→ active.curl http://127.0.0.1:8080/→ 200; served<script src=".../index-CY9F9Fds.js">matches freshly-built bundle./api/slotsreports 5 slots (embed/primary/rerank/stt/tts),/api/modelsreports 0 — both will render live in the sidebar instead of the static seed (which had different counts).POST /api/slots/primary/restart→ 200; count stable at 5, primary state cycled toready— useSlots' 5s polling carries the change.Out of scope
Other HAL0_DATA consumers (data.jsx is a shared fallback for many components — intentional), eviction bug, tweaks panel, firstrun, other sidebars.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com