Skip to content

feat(annotate): Make Agent TUI placement configurable#1050

Open
leoreisdias wants to merge 1 commit into
backnotprop:mainfrom
leoreisdias:feat/agent-tui-placement-config
Open

feat(annotate): Make Agent TUI placement configurable#1050
leoreisdias wants to merge 1 commit into
backnotprop:mainfrom
leoreisdias:feat/agent-tui-placement-config

Conversation

@leoreisdias

@leoreisdias leoreisdias commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Context

The annotate-mode Agent TUI is currently fixed to the left side of the document. This makes it awkward for people who expect agent controls beside Ask AI and annotations on the right.

This PR adds a persisted Left/Right position control to the terminal's Display popover. Left remains the default. When docked right, the terminal occupies the existing Ask AI/Annotations slot instead of adding a fourth column.

What changed

  • persist the selected terminal side through Plannotator's existing cookie-backed storage
  • make terminal placement parent-controlled so layout, resizing, and panel visibility share one source of truth
  • keep the running WebTUI session mounted while the terminal moves, is temporarily hidden, enters wide mode, or falls below the desktop breakpoint
  • make Ask AI and Annotations replace a right-docked terminal while preserving its live session for reopening
  • update borders and resize direction for each side
  • reset terminal display settings, including position, back to the left-side defaults

GIF

Jul-14-2026 16-26-23

Review focus

The important invariant is that changing layout must not tear down the active PTY. agentTerminalPanel remains one keyed React element and moves between the left and right insertion points.

The other area worth checking is right-slot coordination: a visible right-docked terminal suppresses Ask AI/Annotations, while opening either panel hides—but does not stop—the terminal. Below the desktop breakpoint, the terminal remains mounted and the normal right panel stays available.

Test plan

  • bun test packages/ui/utils/annotateAgentTerminal.test.ts packages/editor/agentTerminalIntegration.test.ts
  • PATH="$PWD/packages/ui/node_modules/.bin:$PATH" bun run typecheck
  • bun run --cwd apps/review build && bun run build:hook
  • Browser-tested moving a running terminal left → right → left without replacing its DOM node or stopping the agent
  • Browser-tested Ask AI replacing and restoring a live right-docked terminal
  • Browser-tested persisted placement across reloads and the sub-lg responsive fallback
  • Browser-tested Reset restoring Left while preserving the live terminal session

@leoreisdias leoreisdias changed the title Make Agent TUI placement configurable feat(annotate): Make Agent TUI placement configurable Jul 14, 2026
@leoreisdias leoreisdias force-pushed the feat/agent-tui-placement-config branch from bc61cf4 to e7d1d1b Compare July 14, 2026 23:39
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