feat(quantum): add sidebar dashboard with credits, jobs, and compute status#7
Open
Kenny-Heitritter wants to merge 2 commits intofeat/codeq-telemetryfrom
Open
feat(quantum): add sidebar dashboard with credits, jobs, and compute status#7Kenny-Heitritter wants to merge 2 commits intofeat/codeq-telemetryfrom
Kenny-Heitritter wants to merge 2 commits intofeat/codeq-telemetryfrom
Conversation
…status Add quantum resource dashboard to the TUI sidebar and footer: - QuantumState: centralized reactive store tracking credits balance, active jobs, and compute instance status via Bus events - QuantumPoller: Scheduler-based adaptive polling (credits/compute 60s, jobs 30s when active) with auto-detection of API key mid-session - QuantumSidebarSection: collapsible sidebar panel showing credit balance, active job rows with status dots and elapsed time, compute status - QuantumFooterIndicator: compact footer indicator (active QPU count) - Extended client.ts with getCredits (billing/credits/balance endpoint), getComputeStatus, listActiveJobs, and Zod schemas for validation - Fixed getCredits return type mismatch in estimate_cost tool - Tools (submit, cancel, get_result) trigger state refresh for immediate sidebar updates after quantum operations - Wired poller and initial refresh into InstanceBootstrap
- Move CreditsBalanceSchema and ComputeStatusSchema to the schema section at the top of client.ts, alongside QuantumDeviceSchema, QuantumJobSchema, and JobResultSchema - Remove redundant formatCredits branch (n >= 10 and default were identical)
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
quantum/state.ts) usingInstance.state()for per-instance isolation, with Bus events for TUI reactivityDesign
Progressive disclosure — minimal when idle (just
⚛ qBraid $42.50in footer), expands when resources are active (shows job rows, compute status in sidebar section).Three pillars mirroring the qBraid account page:
/billing/credits/balance/jobs/compute/servers/status(management is future work)New Files
quantum/state.ts— Centralized state store withInstance.state(), Bus eventquantum.state.updated, refresh functions for credits/jobs/computequantum/poller.ts— Scheduler-based adaptive background polling withInstance.state()for per-instance timestamp trackingcli/cmd/tui/component/quantum-status.tsx—QuantumSidebarSection(collapsible),QuantumFooterIndicator(compact),useQuantumState()hookModified Files
quantum/client.ts— AddedgetCredits(),getComputeStatus(),listActiveJobs(),isConfigured(),CreditsBalanceSchema,ComputeStatusSchemaquantum/tools.ts— Added state refresh triggers after submit/cancel/get_result, fixedgetCreditsreturn typequantum/index.ts— AddedQuantumStateandQuantumPollerexportsproject/bootstrap.ts— AddedQuantumPoller.init()+QuantumState.refreshAll()callscli/cmd/tui/routes/session/sidebar.tsx— Added qBraid section between Context and MCPcli/cmd/tui/routes/session/footer.tsx— AddedQuantumFooterIndicatorbetween permissions and LSPArchitecture Patterns
Instance.state()for all per-instance state (matches all 25+ existing modules)BusEvent.define()with explicit Zod schemaz.object({})for signal eventsuseTheme()for typed RGBA color access (no type-erasing helper functions)Commits (2)
Stats
9 files changed, 546 insertions(+), 7 deletions(-)
Depends On