Skip to content

feat(command-center): add support for standalone terminal cells#3130

Open
MattPua wants to merge 1 commit into
mainfrom
posthog-code/add-terminal-as-independent-command-center-item
Open

feat(command-center): add support for standalone terminal cells#3130
MattPua wants to merge 1 commit into
mainfrom
posthog-code/add-terminal-as-independent-command-center-item

Conversation

@MattPua

@MattPua MattPua commented Jul 3, 2026

Copy link
Copy Markdown
Member

Problem

Command center only supported adding tasks. No way to open a terminal independent of an agent run.

Changes

CleanShot.2026-07-03.at.11.25.54.mp4
  • Adds a Terminal option to the cell selector (alongside New task / Brainrot)
  • New __terminal__:<id> cell sentinel in grid.ts, mirroring the brainrot pattern
  • TerminalCell component — opens a shell in the most recently accessed folder ($HOME fallback)
  • Renamed removeTask store action → clearCell (it clears any cell type, not just tasks)
  • Cleanup on remove, drag-overwrite, layout shrink, and clear-all so ptys don't leak
  • New destroyShellTerminal helper: kills xterm instance + server-side pty + persisted state

How did you test this?

  • pnpm --filter @posthog/core typecheck and pnpm --filter @posthog/ui typecheck — clean
  • Unit tests: packages/core command-center suite (46 tests) and packages/ui store suite (1211 tests) — all pass

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

@trunk-io

trunk-io Bot commented Jul 3, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit ada2f9d.

@MattPua MattPua requested a review from a team July 3, 2026 15:26
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff (1)

  1. packages/core/src/command-center/cells.test.ts, line 14-24 (link)

    P2 The brainrot test case was not updated to assert terminalId: null, even though the empty-cell case was. Because EMPTY_CELL_DATA now spreads terminalId: null for all cell types, a brainrot cell built by buildCommandCenterCells will always carry that field. Leaving it out of the expected object lets a future regression (e.g. accidentally propagating a terminal ID into a brainrot cell) slip through undetected.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "feat(command-center): add support for st..." | Re-trigger Greptile

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