Visitar URL original
feat(gui-plugins): add interactive terminal panel stories by usrnk1 · Pull Request #63736 · anomalyco/opencode · GitHub
Skip to content

feat(gui-plugins): add interactive terminal panel stories - #63736

Open
usrnk1 wants to merge 2 commits into
devfrom
terminal-stories
Open

usrnk1 wants to merge 2 commits into
devfrom
terminal-stories

Conversation

@usrnk1

@usrnk1 usrnk1 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Standalone components lab work.

Type of change

  • New feature (components lab)
  • Refactor / code improvement (GUI terminal plugin)

What does this PR do?

Adds six stories for the terminal panel: running, empty, loading, list failed, disconnected and unsupported. Each fixture PTY keeps its own transcript, so you can type, switch tabs and reconnect in the real emulator. Input echoes in memory; it never executes a command.

Feature flag: The stories use the components lab's existing dev/Beta gate. The production terminal delegates snapshots and connections to the existing persistent PTY client, so the refactor needs no rollout flag.

Hona review: Please check the PTY lifetime in packages/gui-plugins/src/terminal/{panel.tsx,pty.ts}: each mount captures its PTY ID, while each connection uses the session's current server client and URL for authentication.

How did you verify your code works?

  • Exercised all six stories in Chromium. On plugins-terminal--disconnected, reconnected, typed local echo, appended output, disconnected again and recovered both lines on the same PTY. Build log kept its own transcript. “Try again” recovered the inventory after a list failure.
  • bun install --frozen-lockfile; GUI plugin typecheck; 131 terminal unit tests passed. All four app terminal component tests passed on each of ten runs (two workers).
  • Root bun run check passed; bun run lint:changed origin/dev reported zero problems across the ten changed files.

Visual

Chromium, 1024 × 576 viewport. The terminal plugin story is absent on f413b302fb; the first image shows the closest existing shell-output story, current-session-terminal-work--running-tests.

Before · dev shell-output story After · terminal panel after reconnect
Shell output in the base timeline story Workspace after reconnect, with typed input and appended output restored

Checklist

  • I have tested my changes locally.
  • I have not included unrelated changes in this PR.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking concerns.

The terminal unit tests in packages/gui-plugins pass (131 of 131) and tsc -b is clean. I couldn't open the stories myself because Chromium couldn't start in my environment, so I'm relying on your Chromium run for the interactive behaviour.

On the PTY lifetime you asked about: connect() reads props.pty each time, and that getter calls props.model.pty(session.server(), ptyID). So the PTY ID is set once per mount, and every reconnect still uses the session's current server client and URL, the same as before. The test change only moves the shared helpers into model.fixture.ts.

Public API is unchanged. TerminalProps (ptyID/server → pty) and the new pty field on the terminal model are internal to the plugin.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit only merges dev. This pull request's own changes are identical to the version I reviewed before, and the merge brings in nothing else. The terminal unit tests still pass (131 of 131) and tsc -b is clean. No new concerns, and the public API is unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant