Repository navigation
feat(site): add terminal panel to chat sidebar - #23231
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 149e22c2af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
+1 to this |
da24888 to
f73a658
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f73a6589da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f73a658 to
585e579
Compare
|
@codex review |
DanielleMaywood
left a comment
There was a problem hiding this comment.
🤖 This review was written by Coder Agent on behalf of Danielle Maywood 🤖
Code review by Pluto 🐕 and team — 6 reviewers, 26 hypotheses tested, 5 unique findings verified by independent fact-checkers.
|
|
||
| return ( | ||
| <div className="flex h-full min-h-0 flex-col"> | ||
| <WorkspaceTerminalAlerts |
There was a problem hiding this comment.
[P2 — Improvement] RRT002: RefreshSessionButton calls window.location.reload(), destructive in sidebar context
RefreshSessionButton (in WorkspaceTerminalAlerts.tsx, line 198) unconditionally calls window.location.reload(). This was fine when the component only lived on the standalone TerminalPage (where the terminal IS the page). Now that it's used here in the sidebar, clicking "Refresh session" reloads the entire Agents page — destroying the chat, git panel state, sidebar position, and any unsaved work.
The DisconnectedAlert shows this button when the WebSocket disconnects, which is a realistic scenario (network blip, server restart).
Suggestion: Accept an optional onRefresh callback prop in WorkspaceTerminalAlerts. When provided, use it instead of window.location.reload(). TerminalPanel can pass a handler that resets the terminal connection (e.g. bumping the reconnection token via state) without reloading. TerminalPage continues passing nothing (or () => window.location.reload()) to preserve existing behavior.
Found by react-robustness-top-down.
🤖 This comment was written by Coder Agent on behalf of Danielle Maywood 🤖
There was a problem hiding this comment.
Inherited from existing TerminalAlerts (moved, not modified). Should be fixed for sidebar context in a follow-up.
There was a problem hiding this comment.
Inherited from existing TerminalAlerts (moved, not modified). Should be addressed for sidebar context as a follow-up.
There was a problem hiding this comment.
P2 Re-raising: still no ticket for this. RefreshSessionButton calls window.location.reload(), which in the sidebar destroys the entire page: chat history scroll position, git panel state, and the terminal itself. The user clicked a button scoped to the terminal panel and lost everything else. (Nami)
The component moved from TerminalPanel.tsx to WorkspaceTerminalAlerts.tsx but the behavior is unchanged. For the sidebar consumer, this needs a scoped action (e.g., regenerate the reconnection token to force a new WS connection) instead of a full page reload.
🤖
There was a problem hiding this comment.
Acknowledged — this is a real UX issue in the sidebar context. The fix (scoped reconnection instead of full page reload) requires changes to WorkspaceTerminalAlerts which is shared with the standalone page. Tracking as a follow-up to avoid scope creep in this PR.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 585e579256
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b5d6bf0 to
2deae76
Compare
|
@codex review |
2deae76 to
73484bb
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73484bb027
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3707027 to
6fd84b7
Compare
Extract a reusable WorkspaceTerminal component from TerminalPage and wire it into the agents chat right sidebar as a new Terminal tab. - Extract shared terminal runtime into modules/terminal/ - Add TerminalPanel wrapper for the chat sidebar - Add Terminal tab (gated on workspace availability) - Add Storybook stories for all panel states - Guard fitAddon.fit() against pre-renderer crashes - Report workspace usage and route links through port-forward rewriting - Convert terminal styles from emotion to tailwind - Extract shared terminal config helper - Migrate TerminalPage test from jest to vitest
…event hidden-container crash
…latch, guard all ws handlers - Convert reportTerminalError from useCallback to useEffectEvent for stability, matching handleOpenLink and handleStatusChange patterns. - Add one-way activation latch (activated state) so tab switches via SidebarTabView's CSS hidden toggling don't tear down the WebSocket. Terminal creation and WS connection effects now gate on activated instead of isVisible. The refit effect still uses isVisible. - Add disposed guards to open, message, and reconnect WebSocket handlers (error and close already had them). - Soften transient zero-size resize: when getTerminalDimensions returns null in scheduleTerminalResize and reconnect handler, just return instead of forcing disconnected status on a healthy socket.
…nt testId dual purpose
a2b799a to
6ad55f3
Compare
Add terminal panel to chat sidebar
Extract the reusable terminal runtime from
TerminalPageintomodules/terminal/and wire it into the agents chat right sidebar as a new Terminal tab.Changes
modules/terminal/WorkspaceTerminal.tsx— Shared xterm + websocket terminal component (container-sized, no route dependency)modules/terminal/WorkspaceTerminalAlerts.tsx— Moved fromTerminalPage/to shared modulepages/AgentsPage/TerminalPanel.tsx— Sidebar wrapper aroundWorkspaceTerminalpages/AgentsPage/AgentDetailView.tsx— Terminal tab added (gated onhasWorkspace)pages/TerminalPage/TerminalPage.tsx— Slimmed to page-shell using shared componentDemo
dogfood-terminal-demo.webm
Behavior
fitAddon.fit()guarded against pre-renderer crashes (fixes proxy access)Generated with
mux• Model:anthropic:claude-opus-4-6• Thinking:xhigh