Skip to content

feat(lab-envs): TUI view for backend-agnostic ephemeral lab envs - #2

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1777389400-lab-envs
Open

feat(lab-envs): TUI view for backend-agnostic ephemeral lab envs#2
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1777389400-lab-envs

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Adds a Lab Envs view to the Bubble Tea client mirroring the concave-web /lab/envs page and backed by the same backend-agnostic API introduced in concave#1.

Changes

  • internal/client/client.go: LabEnv, LabStorage, LabEnvsResponse, LabLaunchRequest types and Client.LabEnvs / LabLaunch / LabExtend / LabArchive methods.
  • cmd/concave-tui/model/api_bindings.go: apiLabEnvsFn / apiLabLaunchFn / apiLabExtendFn / apiLabArchiveFn — injectable function variables for tests.
  • cmd/concave-tui/model/lab_envs.go: LabEnvsModel.
    • 10-second refresh tick for the env table.
    • 1-second tick for live TTL countdowns.
    • Keybindings: r refresh, j/k select, e extend +1h (developer+), a archive now (operator+).
    • Header shows active driver, hot tier, and cold tier so the operator sees where an archive will land.
    • Detail pane shows per-env Jupyter URL, hot/cold paths, and archive ref.
  • cmd/concave-tui/model/root.go: new ViewLabEnvs slot in the view enum, wired into Update, activateView, deactivateView, activeContent, applyLayout, visibleViews, sidebarIcon, sidebarLabel, and the help overlay.
  • Tests:
    • model/root_test.go: updated TestRootSwitchesViewsWhenAuthenticated (system is now the ninth key), TestAdminVisibleViewsIncludeSystemAndUsers (10 views), TestViewerVisibleViewsIncludeMonitoringScreens (7 views).
    • model/lab_envs_test.go: formatTTL rendering cases, LabEnvsModel table rendering + cold-tier header, and role-gated extend.

Gradient-specific touches

  • Live TTL countdown with local tick (1s) + authoritative poll (10s) — matches the web countdown cadence without hammering the API.
  • Role gating in lockstep with the server (auth.ActionStart extends, auth.ActionStop archives).
  • Header surface the mesh-addressable cold tier path so an operator can reason about where an archive will be restorable from.

Review & Testing Checklist for Human

  • Pair with concave#1 and concave-web#2 in a local Gradient box. Log into concave-tui, press 7 to jump to Lab Envs, and confirm the env list populates in parallel with the web page.
  • Launch an env from the CLI (concave lab envs launch --image jupyter/minimal-notebook:latest --ttl 30m) and watch the TTL count down in the TUI without manual refresh.
  • Press e as a developer and a as an operator. Confirm both actions succeed and the list refreshes.

Notes

  • No new dependencies.
  • The view shares no code with the existing phase 15 monitoring scaffolding on main; it's a standalone screen.

Link to Devin session: https://app.devin.ai/sessions/5d19efa113054ca4953d9ed9309ce705
Requested by: @ElFariss

Adds a Lab Envs view to the Bubble Tea client mirroring the concave-web
/lab/envs page. Lists running envs with live TTL countdown, supports
extend and archive actions gated by role.

- internal/client: LabEnv, LabStorage, LabEnvsResponse, LabLaunchRequest
  types and Client.LabEnvs / LabLaunch / LabExtend / LabArchive methods.
- cmd/concave-tui/model/api_bindings.go: apiLabEnvsFn / apiLabLaunchFn /
  apiLabExtendFn / apiLabArchiveFn test seams.
- cmd/concave-tui/model/lab_envs.go: LabEnvsModel with 10s refresh, 1s
  countdown tick, viewer/developer/operator role gating, keybindings
  (r refresh, j/k select, e extend +1h, a archive).
- cmd/concave-tui/model/root.go: ViewLabEnvs slot, visibleViews wiring,
  Lab Envs help entry.
- Tests: formatTTL + LabEnvsModel table rendering + role-gated extend.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant