Skip to content

feat(desktop): dock the terminal to the right, and let it fill the window - #1601

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Nov 13, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

The desktop terminal panel could only sit in one place: a row under the conversation and the files panel. This PR gives it the two placements a workbench terminal has — the bottom row or a column between the conversation and the files panel — plus a maximized state that hands it the whole content area. Both owners of the panel (this machine's shells and a paired desktop's) go through the same shell, so a dock and a maximize work on either.

Commits

  • feat(desktop): dock the terminal to the right, and let it fill the window — useTerminalPanel keeps the dock, a width and a height (the two docks size on different axes) and the maximize state; TerminalPanelShell draws size, border and resize grip for the edge it is attached to; AppShell builds one panel element and places it in the bottom row, the right column, or the whole content column. The right column is reserved in the two clamps that could otherwise squeeze the conversation (reservedWidth, useRightPanelWidth's reserveRight).

Verification

Run in a detached worktree at 32b450f8e with the workspace node_modules linked from the main checkout (ulimit -n 8192):

  • npx tsc --noEmit (desktop) — clean
  • npx eslint on the six changed sources — clean
  • npx vitest run (desktop, full) — 426 files / 6041 tests passed
  • npx vitest run on the six changed test files — 212 tests passed
  • make check-docs — 417 docs OK, 0 pairs pending, provider matrix 13 rows OK

No Rust crate is touched, so no cargo run was needed.

User-visible changes

  • The terminal panel gains two new header controls: dock to the right / dock to the bottom, and maximize / restore. Before: the panel was always a row under the conversation, resized only vertically. After: it can be a column between the conversation and the files panel, and can take the whole content area; while maximized the conversation and files panel stay mounted behind hidden, so restoring keeps the transcript, its scroll position and the draft.
  • The dock choice and both panel sizes are window-level preferences and are persisted (they survive a restart, alongside the per-conversation open map); maximizing is session state and is dropped when the panel closes. A persisted right dock is only applied while the window can host the column beside the conversation's width floor — the stored choice is kept and comes back when the window grows, and the header hides the dock button instead of offering an inert control.
  • The zh-CN resize tooltip no longer says "height": it now says "size", because the panel resizes on two axes.
  • Reverting the commit a2ebb3e1a restores the previous bottom-row-only behaviour; no stored preference becomes invalid (the dock field simply stops being read).

Notes

None: no migration, no feature flag, no default value of an existing setting changes.

…ndow

The terminal panel only ever drew one way: a row under the conversation and the
files panel. It now has the two placements a workbench terminal has — the same
row, or a column between the conversation and the files panel — plus a maximized
state that gives it the whole content area.

- `useTerminalPanel` keeps the dock, a width and a height (the two docks size on
  different axes), and the maximize state. Dock and sizes are window-level
  preferences, persisted with the open-per-conversation map; maximizing is
  session state and is dropped when the panel closes, so reopening gives the
  layout it was docked in. A right dock is only *effective* when the window can
  host the column beside the conversation's floor — the stored choice is kept and
  comes back when the window grows, and the header hides the dock button while it
  cannot be honoured rather than offering an inert control.
- `TerminalPanelShell` draws the size, border and resize grip for the edge it is
  attached to, and gains the two header buttons. Both owners (this machine's
  shells and a paired desktop's) go through the same shell, so a dock and a
  maximize work on either.
- `AppShell` builds one panel element and places it: the bottom row, the column
  after the conversation, or — maximized — the content column with the
  conversation and files panel `hidden` but still mounted, so returning to them
  keeps the transcript, its scroll position and the draft. The right column is
  reserved in the two clamps that could otherwise squeeze the conversation
  (`useTerminalPanel`'s `reservedWidth`, `useRightPanelWidth`'s `reserveRight`).
- The screenshot harness gains `terminal-right` and `terminal-maximized`, which
  measure the panel's rect, the conversation's width and the grip's axis, and
  `?terminal=reset` so both frames start from the same layout instead of from
  whatever the previous run left docked.
@huichen
huichen enabled auto-merge (squash) November 13, 2026 13:17
@huichen
huichen merged commit d6987a6 into main Nov 13, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch November 13, 2026 13:24
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