Two related fixes for the autocomplete popup flipping below the visible
terminal area when navigating suggestions with the cursor at the bottom:
1. Clamp popup bounds to the actual .xterm-screen rect instead of the
.xterm-container rect. The container can be a few pixels taller due to
padding/rounding, which created a false positive spaceBelow value and
caused short suggestion lists to flip downward off-screen.
2. Refresh the popup anchor after live-preview writes and after sub-dir
panels update. Cursor movement from preview text or width changes from
sub-dir panels could leave the stored anchor stale.
Add unit tests covering short-popup bottom-row placement, clamp viewport
using the screen rect, and split-pane precedence.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace immersive instant-switch with animated active chrome theme sync so
top tabs match terminal sessions immediately on tab click, and clamp
autocomplete popups to the active pane so they stay anchored to the cursor
in split workspaces.
Co-authored-by: Cursor <cursoragent@cursor.com>
The terminal completion popup could spill past the window edges and ignored
the theme accent color (#1202):
- Horizontal: the left-edge clamp only reserved the main list width (400px),
so expanding a directory near the right edge pushed the cascading sub-dir
panels and the detail tooltip off-screen. Now the clamp accounts for the
full assembly width (main list + sub-dir panels + detail tooltip) and pins
to the left padding when it is wider than the viewport.
- Vertical: extracted the flip/clamp math into a pure, unit-tested
computeAutocompletePopupPlacement() so "not enough room below -> flip up
and bound the height" is verifiable. The detail tooltip is now height-
bounded and scrolls instead of overflowing for long snippet descriptions.
- Accent: the selected/hover row background and the active-row accent rail now
derive from the active terminal theme's cursor/selection colors (which track
the user's accent setting) instead of a hardcoded blue.
Adds terminalAutocompleteLayout.test.ts covering downward/upward placement,
bottom-of-viewport flip, height clamping, and horizontal clamping.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>