feat(terminal): expandable mini terminal — full-screen modal view#1424
Conversation
|
@shreyaspapi is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR adds an expand-to-fullscreen capability for the mini terminal in the right sidebar. Clicking the new maximize icon renders Key observations:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| src/renderer/components/ExpandedTerminalModal.tsx | New full-screen modal component that physically moves an xterm.js session between DOM containers via SessionRegistry.reattach(); two header buttons (Minimize2 and X) both call onClose with identical behaviour, and the explicit detach() before reattach() is redundant since attach() already calls detach() internally. |
| src/renderer/components/TaskTerminalPanel.tsx | Adds expand-button toolbar entry and wires ExpandedTerminalModal; the global reattachKey approach forces all TerminalPane instances to remount on modal close rather than only the one that was expanded. |
| src/renderer/terminal/SessionRegistry.ts | Adds reattach() helper that delegates directly to session.attach(container) — minimal, correct addition that fits cleanly into the existing registry pattern. |
Sequence Diagram
sequenceDiagram
participant User
participant TaskTerminalPanel
participant ExpandedTerminalModal
participant SessionRegistry
participant TerminalSessionManager
User->>TaskTerminalPanel: Click Maximize button
TaskTerminalPanel->>TaskTerminalPanel: setExpandedTerminalId(activeTerminalId)
TaskTerminalPanel->>ExpandedTerminalModal: Mount (portal on document.body)
ExpandedTerminalModal->>SessionRegistry: detach(terminalId)
SessionRegistry->>TerminalSessionManager: detach() → moves DOM to terminalHost
ExpandedTerminalModal->>SessionRegistry: reattach(terminalId, modalContainer)
SessionRegistry->>TerminalSessionManager: attach(modalContainer) → moves DOM to modal
TerminalSessionManager-->>ExpandedTerminalModal: session (with PTY/scrollback intact)
ExpandedTerminalModal->>TerminalSessionManager: focus() [via rAF]
User->>ExpandedTerminalModal: Click Minimize / Esc
ExpandedTerminalModal->>TaskTerminalPanel: onClose()
TaskTerminalPanel->>TaskTerminalPanel: setExpandedTerminalId(null) + setReattachKey(k+1)
ExpandedTerminalModal->>SessionRegistry: detach(terminalId) [cleanup effect]
SessionRegistry->>TerminalSessionManager: detach() → moves DOM to terminalHost
Note over TaskTerminalPanel: All TerminalPane keys change (reattachKey bump)
TaskTerminalPanel->>SessionRegistry: attach(terminalId, sidebarContainer)
SessionRegistry->>TerminalSessionManager: attach(sidebarContainer) → session restored
Last reviewed commit: ffdd9c1
|
All three review comments addressed in 17372ad:
|
There was a problem hiding this comment.
hey @shreyaspapi
expanded terminal is overlapping with window's action button, pls address this
try to expand it upto certain extend
…i-terminal # Conflicts: # src/renderer/components/TaskTerminalPanel.tsx
|
@arnestrickmann fixed the merge conflict! |
|
Thx! |

Summary
Adds the ability to expand the mini terminal in the right sidebar into a full-screen modal overlay. The terminal session (PTY, scrollback, scroll position) is fully preserved across expand/collapse — no restart, no lost output.
SessionRegistry.reattach()— the xterm.js Terminal instance is physically moved between DOM containersHow it works
ExpandedTerminalModalmounts as a portal ondocument.bodyterminalSessionRegistry.reattach()TerminalPanere-mounts to reclaim it (via areattachKeybump)No new dependencies. Uses the existing
TerminalSessionManagerattach/detach lifecycle.Fixes
Fixes #1378
Snapshot
Screen.Recording.2026-03-12.at.12.46.29.AM.mov
Type of change
Mandatory Tasks
Checklist
pnpm run format)pnpm run lint)