Skip to content

feat(site): add Open Terminal and Copy SSH Command to agent chat TopBar - #22529

Merged
johnstcn merged 4 commits into
mainfrom
cian/agent-chat-terminal-ssh-buttons
Mar 3, 2026
Merged

johnstcn merged 4 commits into
mainfrom
cian/agent-chat-terminal-ssh-buttons

Conversation

@johnstcn

@johnstcn johnstcn commented Mar 2, 2026

Copy link
Copy Markdown
Member

Adds two new items to the agent chat TopBar dropdown menu:

  • Open Terminal: opens the workspace web terminal in a new browser window, reusing the existing getTerminalHref/openAppInNewWindow infra.
  • Copy SSH Command: copies the SSH command (e.g. ssh agent.workspace.owner.suffix) to the clipboard with a toast confirmation. Only shown when the deployment SSH hostname suffix is configured.

Both items appear after a separator below the existing editor/workspace actions.

Changes

File What
TopBar.tsx Added Open Terminal and Copy SSH Command dropdown items with separator, TerminalIcon/CopyIcon, toast on copy
AgentDetail.tsx Wired up getTerminalHref, openAppInNewWindow, deploymentSSHConfig query, and passed new props to TopBar in all 3 render paths
TopBar.stories.tsx Added new fields to default story props

Adds two new items to the agent chat TopBar dropdown menu:

- Open Terminal: opens the workspace web terminal in a new browser
  window, reusing the existing getTerminalHref/openAppInNewWindow infra.
- Copy SSH Command: copies the ssh command (e.g. ssh agent.workspace.owner.suffix)
  to the clipboard with a toast confirmation. Only shown when the
  deployment SSH hostname suffix is configured.

Both items appear after a separator below the existing editor/workspace
actions.
@johnstcn johnstcn self-assigned this Mar 2, 2026
@johnstcn
johnstcn requested a review from DanielleMaywood March 2, 2026 22:53
@johnstcn
johnstcn marked this pull request as ready for review March 2, 2026 22:53
Copilot AI review requested due to automatic review settings March 2, 2026 22:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds two new dropdown menu items to the AgentDetailTopBar component in the Coder Agents UI: "Open Terminal" (opens a workspace web terminal in a new window) and "Copy SSH Command" (copies an SSH command to the clipboard with a toast notification). These reuse existing infrastructure (getTerminalHref/openAppInNewWindow for the terminal, and deploymentSSHConfig query for the SSH hostname suffix).

Changes:

  • Added "Open Terminal" and "Copy SSH Command" menu items to the TopBar dropdown, plus a new separator between them and the "View Workspace" item.
  • Wired up the necessary props (canOpenTerminal, onOpenTerminal, sshCommand) in all three render paths of AgentDetail.tsx, including fetching deploymentSSHConfig.
  • Updated TopBar.stories.tsx default props to include the new fields.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
site/src/pages/AgentsPage/AgentDetail/TopBar.tsx Added Open Terminal and Copy SSH Command dropdown items with icons, separator, clipboard write, and toast feedback
site/src/pages/AgentsPage/AgentDetail.tsx Added deploymentSSHConfig query, computed canOpenTerminal/terminalHref/sshCommand, implemented handleOpenTerminal, passed all new props in all three AgentDetailTopBar render invocations
site/src/pages/AgentsPage/AgentDetail/TopBar.stories.tsx Added canOpenTerminal, onOpenTerminal, and sshCommand to story default props

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@johnstcn
johnstcn merged commit 3c4a416 into main Mar 3, 2026
23 checks passed
@johnstcn
johnstcn deleted the cian/agent-chat-terminal-ssh-buttons branch March 3, 2026 11:44
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants