vscode: Codev Dev panel tab + status-bar chip for the dev server (#921)#996
Merged
Conversation
…tegration contract
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.
PIR Review: Codev Dev surface (bottom-panel tab + always-visible status-bar chip)
Fixes #921
Summary
Adds two complementary VSCode surfaces for the single
afx devPTY so a reviewer can see at a glance whether a dev is running, for which target, and stop/restart it fast without hunting the terminal dropdown. Acodev.devServerpanel tab (the first real view in #812'scodevPanelcontainer) shows a status header — target / live uptime / best-effort port — with title-bar Stop / Restart / Switch Target / Show-Hide-sidebar actions; an always-visible status-bar chip ($(server-process) Dev: <target>) appears only while a dev runs and clicks through to the tab. Both derive from the oneTerminalManager.onDidChangeDevTerminalsevent, and the nativeCodev: <name> (dev)terminal stays as the output surface (coexist), so there is no PTY re-plumbing.Files Changed
packages/vscode/package.json(+78 / -…) —codev.devServerview incodevPanel; 5 command declarations; 4 title-bar menu entries (Stop/Restart gated on running, Switch always, Show↔Hide sidebar toggle); command-palette gatingpackages/vscode/src/views/dev-server.ts(+125) — newDevServerTreeProvider(status header / placeholder / epitaph rows, 1s uptime ticker, best-effort port)packages/vscode/src/views/dev-server-format.ts(+72) — new pure helpersformatUptime/extractDevPortpackages/vscode/src/commands/dev-server-actions.ts(+82) — new title-bar handlers (stop / restart / switch / show / hide)packages/vscode/src/commands/dev-shared.ts(+86) —restartDevForTarget,listSwitchTargets,resolveDevTargetByIdpackages/vscode/src/extension.ts(+63 / -…) — register the view; status-bar chip lifecycle;codev.devServerRunningkey; flipcodev.panelContainerEmptyfalsepackages/vscode/src/terminal-manager.ts(+25) —builderId → startedAtmap +getDevStartedAtfor uptimepackages/vscode/src/__tests__/dev-server-format.test.ts(+63) — unit tests for the pure helperspackages/vscode/src/__tests__/contributes-dev-server.test.ts(+80) — contributes/wiring invariantspackages/vscode/src/__tests__/contributes-panel.test.ts(+17 / -…) — updated vscode: introduce a Codev panel tab (bottom-area view container) to relieve sidebar overload #812 guards for the now-false key + second viewcodev/resources/arch.md,codev/resources/lessons-learned.md— see sections belowCommits
1996981f[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Track dev-terminal start times for uptimec80ceb49[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Add pure dev-status formatters (uptime, port) + testsc492354c[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Add DevServerTreeProvider for the Codev Dev panel tab500f899b[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Add dev-server title-bar actions (stop/restart/switch/reveal)9e2520fd[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Wire Codev Dev view, status-bar chip, and context keysa92363f3[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Contribute codev.devServer view, commands, title-bar menus5c73dd9b[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Make Reveal a Codev-sidebar show/hide togglede9a52ad[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Rename Reveal action to 'Show Codev Sidebar' for toggle symmetry0ef6ad63[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Rename revealInWorkspace command id to showSidebarc3cd9aa1[PIR vscode: Codev Dev surface — bottom-panel tab with title-bar Stop/Restart, paired with always-visible status-bar chip #921] Use(plus thread-file updates)
Test Results
pnpm check-types: ✓ passpnpm lint: ✓ passnode esbuild.js(bundle): ✓ passpnpm test:unit: ✓ pass (311 tests, ~11 new acrossdev-server-formatandcontributes-dev-server)dev-approvalgate against the running worktree — exercised the chip + panel tab, the Show/Hide sidebar toggle, and iterated on the chip icon ($(zap)→$(server-process), since$(zap)reads as AI) and the toggle's label/command-id naming.Architecture Updates
Updated
codev/resources/arch.md. The existing Panel view container (#812) decision noted the panel was scaffolding whose placeholder "hides once real views register" — #921 makescodev.devServerthe first such view, so I amended that line (the panel now ships non-empty, key seededfalse) and added a Codev Dev surface (#921) key-design-decision bullet documenting the two-surface design, the single-event source of truth, the coexist-with-terminal choice (status surface, not an output mirror), and thestartedAtmap that backs uptime.Lessons Learned Updates
Added two UI/UX entries to
codev/resources/lessons-learned.md:StatusBarItem.backgroundColorhonors onlyerrorBackground/warningBackground;prominentBackgroundas a background is silently ignored, so a "prominent, not alarming" chip cue must use the foreground (prominentForeground) instead. (Verify the API's documented constraint, don't trust a spec's color name.)$(zap)now reads as the AI/sparkle glyph in VSCode — use a literal glyph ($(server-process)) for non-AI features.The two-command
when-clause toggle pattern used for Show/Hide sidebar was already captured under #952, so it isn't duplicated.Things to Look At During PR Review
prominentBackground; the VSCode API only honors error/warning backgrounds, so I usedcolor = statusBarItem.prominentForegroundinstead. If a stronger cue is wanted,warningBackgroundis the only API-honored background (the issue called it too alarming). Seeextension.tsupdateDevChip.whenclauses. They hinge onsideBarVisible && activeViewlet == 'workbench.view.extension.codev'. If the Codev container is dragged into the secondary side panel,activeViewletwon't match and the toggle falls back to always showing "Show Codev Sidebar." Edge case (Codev defaults to the primary activity bar), but worth knowing.listSwitchTargets/resolveDevTargetByIduse the worktree basename (e.g.pir-809) as the target id, matching theafx dev/ Workspace-view convention and the chip display. A dev started via the older builder-row path (run-worktree-dev, which uses the overview id) could in principle not match by id — pre-existing inconsistency, not introduced here, and the dominantafx devpath is consistent.worktree.devUrls/devCommand(no guessing). This repo'sdevCommandmay not expose a port, so expect the Port row absent here.How to Test Locally
pir-921→ View Diffafx dev pir-921$(server-process) Dev: <target>) only while a dev runs; click focuses the Codev Dev tab; disappears on stop