Repository navigation
Description
Problem
afx dev spawns a single dev PTY in the active builder's (or main's) worktree. Today this PTY is exposed as a generic VSCode terminal tab in the regular Terminal panel — indistinguishable from any other terminal the user has open. There is no first-class affordance to:
- See at a glance whether a dev is currently running
- Tell which target (
main/pir-XXX) is the active dev - Stop / restart the dev quickly without hunting through the terminal dropdown or navigating to the Workspace view
The result: users either keep a mental note of "is dev running?" or open the Workspace view in the sidebar to check (which costs sidebar real estate every time). The dev PTY has the structural shape of a content surface — it wants width, it persists, it has a clear lifecycle — but it currently rides on a generic terminal that wasn't designed for it.
Proposal — two complementary surfaces, one goal
Pair a dedicated Codev Dev tab in the bottom-panel container (the codevPanel introduced by #812) with a minimal status-bar chip that's always visible when a dev is running. The panel tab carries the real UI; the chip is the always-visible breadcrumb that delegates to the panel tab on click.
This intentionally mirrors the panel-tab migration family already in flight (#813 Recently Closed, #814 Team, #815 Status) — Codev Dev becomes a fourth sibling tab in the same container.
Surface 1 — Codev Dev panel tab (the primary UI)
- Container: lives in
codevPanel(the bottom-panel viewsContainer introduced by vscode: introduce a Codev panel tab (bottom-area view container) to relieve sidebar overload #812). Same neighborhood as Terminal / Problems / Output / Debug Console. - Tab title:
Codev Dev(consistent capitalization with sibling Codev panel tabs). - Tab badge: when dev is running and the user is on a different panel tab, the Codev Dev tab carries a small colored dot indicating activity (same mechanism Problems uses for its error count). When no dev is running, no badge.
- Tab content (top → bottom):
- Status header: target name (
main/pir-XXX), port if known (best-effort — extract fromworktree.devCommandconfig or first stdout line; if undetectable, omit), uptime (Running for 4m 32s). - Scrolling PTY output: tail of the dev PTY stdout/stderr, identical to what the underlying terminal shows. Auto-scrolls to bottom; user can scroll up to read history.
- Status header: target name (
- Tab title bar actions (
view/titlemenu items):Stop Dev Server(icon:debug-stop)Restart Dev Server(icon:debug-restart)Switch Target— opens Quick Pick to swap from current target tomainor another builder. Same single-slot semantics asafx devtoday (swap-detection prompt if needed; this control just surfaces it).Reveal in Workspace View(icon:eye) — focuses the Workspace sidebar view's Dev Server row so the user can see it in its existing home if they prefer.
- Lifecycle: tab auto-appears in the panel container when a dev starts (
afx dev <target>). When dev stops, the tab stays present but shows a header readingStopped (last target: <name>, ran for Xs)— preserves the log for inspection, no auto-disappear. User can manually X the tab.
Surface 2 — status-bar chip (always-visible indicator)
- Placement: leftmost status bar group, priority 99 (left of project counts the extension already shows).
- Visibility: present only while a dev PTY is running. Disposed when dev stops.
- Appearance:
$(zap) Dev: <target>(e.g.$(zap) Dev: pir-809or$(zap) Dev: main). Background tinted withThemeColor('statusBarItem.prominentBackground')so it stands out as an active state without screaming. - Tooltip:
Codev dev server running for <target> · Click to focus Codev Dev panel - Click action: focus the Codev Dev panel tab. If the panel is closed, opens it. If it's open on a different tab, switches to Codev Dev. No Quick Pick layer between chip and tab — the chip is a thin breadcrumb.
How the two surfaces complement
| User state | What they see |
|---|---|
| Dev not running | No chip, no Codev Dev tab content. Tab presence is up to design call (see below). |
| Dev starting | Chip appears with target name; panel tab auto-shows (or badges if already exists). |
| Dev running, panel closed | Chip in status bar is the only indicator. Click → opens panel + focuses tab. |
| Dev running, panel open on different tab | Chip + tab-strip badge on Codev Dev. Click chip OR badge → tab focuses. |
| Dev running, focused on Codev Dev tab | Full UI: status header, PTY output, Stop/Restart in title bar. Chip still in status bar. |
| Dev just stopped | Chip disappears. Tab stays with "Stopped" header for inspection. |
The chip alone is a poor primary UI (no actions on it directly, can't fit a stop button at chip size without it becoming visually heavy). The panel tab alone has a visibility gap (when panel is closed, no signal that dev is running). Together they cover both: always-visible signal + rich actionable surface.
Dependencies and sibling relationships
- Hard dependency on vscode: introduce a Codev panel tab (bottom-area view container) to relieve sidebar overload #812 — needs the
codevPanelviewsContainer to exist before this tab can mount. Cannot land until vscode: introduce a Codev panel tab (bottom-area view container) to relieve sidebar overload #812 ships. - No dependency on vscode: migrate Recently Closed view from sidebar to Codev panel tab #813 / vscode: migrate Team view from sidebar to Codev panel tab #814 / vscode: migrate Status view from sidebar to Codev panel tab #815 — these are independent siblings in the same family; any can land in any order after vscode: introduce a Codev panel tab (bottom-area view container) to relieve sidebar overload #812.
- Closes the "always-visible dev indicator" UX gap that the Workspace view's Dev Server row partially addresses today (the row only exists when dev is running, which is the right shape — but it costs sidebar real-estate and isn't visible if the sidebar is on a different view).
Design calls for plan-approval
- Codev Dev tab when no dev is running: hide entirely (re-appears on next start), or stay present with a placeholder ("No dev running — start one via
afx dev <target>or the Workspace view")? Hiding is cleaner; placeholder is more discoverable. - PTY output rendering inside the tab: pure terminal (xterm.js or VSCode's built-in pseudo-terminal embed) vs. plain styled log lines. Terminal-faithful rendering means ANSI colors, cursor positioning, etc. work — but is heavier. Plain log is lighter and good enough for most dev output.
- Tab content vs. existing terminal duplication: today the same PTY is exposed as a real VSCode terminal tab named
Codev: <name> (dev). Does the panel tab REPLACE that (hide it; dev output only visible in the Codev Dev tab), or COEXIST (both surfaces show the same PTY)? Replace is cleaner; coexist is safer for users with muscle memory. - Status bar chip background:
prominentBackground(yellow-ish),warningBackground(orange — too alarming for "normal running"), or default (no tint — risk of being missed)? Prominent is the canonical pick. Switch Targetaction — show always, or only when ≥2 swap targets exist (i.e. at least one other valid target: another builder, ormainif user is on a builder)? Always-show is consistent; conditionally-show keeps the title bar less cluttered when there's only one option.
Acceptance
- After vscode: introduce a Codev panel tab (bottom-area view container) to relieve sidebar overload #812 lands and this PR ships, starting
afx dev <target>(orafx dev main) makes the Codev Dev tab visible in the bottom panel and renders its status header + PTY output. - Tab title bar carries Stop / Restart / Switch Target / Reveal-in-Workspace actions; each works as labeled.
- A status bar chip
$(zap) Dev: <target>appears in the bottom-left of every VSCode window while dev is running. - Clicking the chip focuses the Codev Dev panel tab (opening the panel if closed).
- When dev stops (via Stop button, terminal exit,
afx dev --stop, or any other path), the chip disappears and the tab shows a "Stopped" header. - Tab and chip handle target swap correctly: stopping the current target's dev and starting another target's dev updates both surfaces in lockstep.
- No regression to the existing Workspace view's dev-server row (per the runnable-worktrees docs); both views show consistent state.
- Dark, light, and high-contrast themes all render the panel tab and chip cleanly (CSS variables /
ThemeColoronly — no hand-coded colors).
Out of scope
- Multi-dev concurrent runs.
afx devis single-slot by design (URLs are load-bearing — see runnable-worktrees docs). The chip and tab assume single-slot; if multi-dev is ever introduced, both surfaces need a rethink that's not in this issue. - Replacing or unifying with the existing Workspace view's dev-server row. That row stays as the always-visible-in-the-sidebar control for users who prefer sidebar UI; the panel tab + chip is the always-visible-outside-the-sidebar surface.
- Mirroring dev state to anything outside this VSCode window (no Tower dashboard sync beyond what already exists).
- Custom keyboard shortcuts. Users can bind their own.
Why PIR
The two surfaces have real design surface that benefits from a plan-approval gate (five design calls listed above), and the visual result needs running-app verification before PR — multiple themes, panel positions, panel-open vs panel-closed states, target swaps. PR diff alone won't catch theme regressions or interaction subtleties. PIR's dev-approval gate is the right shape; CMAP-2 single-pass on the PR is sufficient.
Implementation skeleton
packages/vscode/src/panels/dev-panel.ts— new file. Registers a TreeDataProvider (or WebviewView, depending on design call Context Window Optimization - AI Needs Project Knowledge Without Breaking Limits #2) for the Codev Dev panel-side view. Subscribes to Tower's dev PTY start/stop notifications.packages/vscode/src/extension.ts— add the StatusBarItem lifecycle (create on dev start, dispose on dev stop), register thecodev.devServer.*commands, register the panel-side view.packages/vscode/package.json— add thecodev.devServerStatusview inside thecodevPanelviewsContainer, add the fourview/titlemenu items, add command declarations.- Tests: pure-helper tests for any status-formatting logic (uptime formatting, target display); manual / Playwright at
dev-approvalfor the panel + chip wiring.
Activity
amrmelsayed commentedon Jun 3, 2026
On it! Working on this with the PIR protocol (plan + dev-approval gates before PR).
[PIR #921] Plan draft (design-of-record; held pending #812)
[PIR #921] Plan revised: #812 landed, plan now active + codevPanel in…
[PIR #921] Plan draft (design-of-record; held pending #812)
[PIR #921] Plan revised: #812 landed, plan now active + codevPanel in…
[PIR #921] Track dev-terminal start times for uptime
[PIR #921] Add pure dev-status formatters (uptime, port) + tests
[PIR #921] Add DevServerTreeProvider for the Codev Dev panel tab
[PIR #921] Add dev-server title-bar actions (stop/restart/switch/reveal)
[PIR #921] Wire Codev Dev view, status-bar chip, and context keys
[PIR #921] Contribute codev.devServer view, commands, title-bar menus
[PIR #921] Update builder thread (implement)
[PIR #921] Make Reveal a Codev-sidebar show/hide toggle
2 remaining items
[PIR #921] Rename revealInWorkspace command id to showSidebar
[PIR #921] Use $(server-process) for the dev chip instead of $(zap)
[PIR #921] Review + retrospective
[PIR #921] Update builder thread (review + consultation)
[PIR #921] Refresh dev surfaces when a dev terminal is closed manually
[PIR #921] Add Codev Dev tab badge via createTreeView
[PIR #921] Normalize dev target name (basename + formatTargetName)
[PIR #921] Record consultation findings + dispositions in review
[PIR #921] Update builder thread (consultation fixes)
Merge pull request #996 from cluesmith/builder/pir-921
vscode CHANGELOG + release notes: #921 Codev Dev surface (bottom-pane…
[PIR #991] Update thread: merged main (PIR #921 dev-surface)
[Bugfix #1158] Fix: strip "dev server" terminology from VS Code surfaces
[Spec 1049] Simplify to purely-contextual panel (drop pills/summaries…