feat: #1686 add Display tab unavailable state #1701
Reference in New Issue
Block a user
Delete Branch "feat/1686-display-unavailable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up to #1686 Track B groundwork after #1695 merged.
GET /workspaces/:id/display.compute.display.mode:Displayworkspace-panel tab that fetches the endpoint only when the tab is opened.Display is not enabled for this workspace.for normal non-display workspaces.Scope
This is intentionally only the unavailable/product-surface slice. It does not provision DCV, create display sessions, expose raw credentials, or implement desktop-control sidecar tooling.
Trust Boundary
The display endpoint is admin-gated from the first version because a later implementation will return short-lived proxied display-session URLs. The current response does not expose raw DCV/VNC/RDP credentials.
Branch Coverage Ledger
WorkspaceHandler.Display: empty{}compute returnsavailable:false/reason:display_not_enabled->TestWorkspaceDisplay_NonDisplayWorkspaceReturnsUnavailable.SidePanel: tab registry includes Display and preserves ARIA tab behavior ->SidePanel.tabs.test.tsx.DisplayTab: non-display endpoint response renders unavailable copy and calls endpoint only when the component mounts ->DisplayTab.test.tsx.Comprehensive testing performed
Local-postgres E2E run
Pending / not run locally: Docker is not running on this Mac, so I did not boot local Postgres/Redis or apply migrations against a live DB. This PR has no new migration, but it does touch workspace-server routing/handler code, so a reviewer may require isolated-host Stage A before merge.
Staging-smoke verified or pending
Pending post-merge or reviewer-run staging smoke. Local verification covers the route/component behavior; no staging tenant deploy has been performed from this branch.
Root-cause not symptom
Root cause: #1686 Track A persisted
compute.display, but Canvas had no Display tab and core had no display-status endpoint, so non-display workspaces could not show the explicit unavailable state requested in the issue.Five-Axis review walked
Correctness: no Required findings. The endpoint returns the issue-specified unavailable shape and the Canvas tab calls it lazily by being rendered only for
panelTab === "display".Readability/simplicity: no Required findings. The new component is isolated and uses the existing
api.gethelper.Architecture: no Required findings. This keeps display session infrastructure out of this PR and leaves future DCV/session URL wiring behind the same endpoint.
Security: no Required findings. Endpoint is admin-gated before any future sensitive URL shape exists.
Performance: no Required findings. One GET only when the Display tab opens; no background polling or panel-wide eager fetch.
No backwards-compat shim / dead code added
No backwards-compat shim or dead code added. Existing workspaces without
compute.display.modereceive the explicitdisplay_not_enabledresponse and the Canvas tab handles that as the normal default.Memory/saved-feedback consulted
No saved memory was consulted for this slice; I used the live issue/PR context and current repository code. The applicable standing feedback was the dev SOP and local coding/testing discipline already reflected in this PR body.
Verification
go test ./internal/handlers -run 'TestWorkspaceDisplay|TestValidateWorkspaceCompute'go test ./internal/handlers ./internal/routergo test ./...fromworkspace-server/npm test -- --run src/components/__tests__/SidePanel.tabs.test.tsx src/components/tabs/__tests__/DisplayTab.test.tsxnpm test -- --run src/components/__tests__/SidePanel.tabs.test.tsx src/components/tabs/__tests__/DisplayTab.test.tsx src/store/__tests__/canvas-topology.test.tsnpm run buildfromcanvas/SOP Stage A Status
Local live Docker/Postgres Stage A is still not run on this Mac because Docker is not running here. This PR should get the isolated host Stage A check before merge if reviewers require the full backend SOP gate.
PR is ready for team review. Verification: local Go handlers/router tests passed, workspace-server go test ./... passed, targeted Canvas vitest passed, canvas npm run build passed. Current Gitea DB status for head
cb223735: implementation/SOP/checklist jobs are green; qa-review and security-review are still red because no qualifying APPROVE has been submitted yet.Subagent review follow-up: QA/product and security reviews found no blocking issues. Both recommended a route-level auth regression test for the new display endpoint; added in
ee2d62f6(TestWorkspaceDisplayRoute_RequiresAdminAuth). Verification after patch: targeted router/handler tests passed andworkspace-server: go test ./...passed.QA approval based on independent subagent QA/product review. No blocking QA issues found. The review-requested route-level auth regression test was added in
ee2d62f679and local backend verification passed.QA approval based on independent subagent QA/product review. No blocking QA issues found. The review-requested route-level auth regression test was added in
ee2d62f679and local backend verification passed.Security approval based on independent subagent security review. No blocking security issues found. The recommended display-route auth regression test was added in
ee2d62f679. No browser-control/session access or secrets are exposed in this PR./qa-recheck
/security-recheck