Skip to content

feat: launch a project (with or without an agent) from the Terminal tab - #274

Open
NovakPAai wants to merge 1 commit into
mainfrom
feat/terminal-project-launcher
Open

feat: launch a project (with or without an agent) from the Terminal tab#274
NovakPAai wants to merge 1 commit into
mainfrom
feat/terminal-project-launcher

Conversation

@NovakPAai

@NovakPAai NovakPAai commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

@vakovalskii — review please 🙏

What this is

A new "+ Project" control in the Terminal (Workspace) toolbar: a popover listing your registered projects (like the Projects tab), but it opens in-app terminals. Each existing project offers three actions:

Action Behavior
⊞ Terminal plain terminal in the project folder — no agent
▶ ‹agent› terminal in the folder + auto-run the preferred/last-used agent
Agent ▾ pick a specific installed agent to launch there

"Just launch an agent without a project" is still available via the per-pane Launch ▾ (unchanged).

Why

  • Previously a fresh terminal tab opened in ~, and the per-pane Launch ▾ ran the agent in the home dir (agents key their history by cwd, so the conversation "gets lost"). Now you can pick a project from the Terminal tab and start the agent directly in its folder.
  • Reuses openInWorkspace(), which auto-runs the agent only when the folder actually opens (a missing folder falls back to ~ WITHOUT running the agent, so history is never misfiled).
  • Agent launch commands mirror the server's buildLaunchCommand (src/terminals.js): Copilot → gh copilot suggest, Cursor → cursor-agent, pi resolves per-machine (pi/omp) via getPiCommand().

Deployment coverage

Pure frontend (workspace.js + styles.css), no backend changes → works identically in the npm CLI (web UI) and the desktop app from one codebase.

UI states

Missing folders shown disabled with a "missing" note (degrades gracefully when the backend has no exists field yet); filter; empty-state linking to the Projects tab; close on Escape / outside-click / toggle; popover teardown on view-detach; height clamp; light+dark theming; keyboard support.

Review (pre-PR)

Ran code-reviewer + security-reviewer and fixed all severities:

  • 2 HIGH — wrong launch commands for Copilot and Pi/OhMyPi (ran a nonexistent binary) → now mirror the server.
  • 1 MEDIUM — popover and its global listeners weren't torn down on view detach → added teardown.
  • 5 LOW + 1 security LOW (--danger--accent-red, role="dialog"role="group", dead gemini entry, comment accuracy, vertical height clamp, __proto__ key guard for lastUsedByPath).

Artifacts

  • SDD: docs/design/terminal-project-launcher.md
  • BDD: specs/terminal-project-launcher.feature

Test plan

  • Launcher functions exercised in a browser against real data: correct commands for all agents, XSS-escaping (a hostile <script> name is escaped, 0 injected tags), filter/empty-state, Escape/outside-click/toggle/inner-scroll, teardown, 0 console errors, renders in dark+light.
  • ⚠️ @lydell/node-pty is not installed in my checkout, so the pty terminal itself wasn't brought up live — a full click-through in the mounted toolbar should be run where node-pty is present.

Add a "+ Project" launcher popover to the Workspace/Terminal toolbar that
mirrors the Projects-tab launch model but opens in-app terminals:
- Terminal   — open a plain terminal in the project folder (no agent)
- Run <agent> — open a terminal and auto-run the preferred/last-used agent
- Agent menu — pick a specific installed agent to launch in the folder

Reuses openInWorkspace(), which auto-runs the agent only when the folder
actually opens, so a missing folder never misfiles agent history into ~.
Agent commands mirror the server's buildLaunchCommand (terminals.js); pi
resolves per-machine (pi vs omp) via getPiCommand(). Missing folders shown
disabled; includes filter, empty-state, Escape/outside-click close, popover
teardown on view-detach, height clamp, and theme-aware styling.

Pure frontend (workspace.js + styles.css) — covers the npm CLI and the
desktop app from one codebase. No backend changes.
@NovakPAai
NovakPAai requested a review from vakovalskii July 24, 2026 11:09
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