Commit Graph

5 Commits

Author SHA1 Message Date
陈大猫 ee4b09059e Fix autocomplete popup boundary clamp. (#1769)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 23:59:24 +08:00
bincxz 1c4be78060 fix(autocomplete): clamp popup within terminal viewport 2026-06-26 16:43:17 +08:00
bincxz fa3f17fa32 fix(autocomplete): prevent popup from rendering below visible terminal screen (#1710)
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>
2026-06-26 15:46:10 +08:00
bincxz 037b85bd66 fix(ui): smooth work-tab chrome transitions and split-pane autocomplete
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>
2026-06-10 01:10:33 +08:00
bincxz 20bfa0e3bd fix(autocomplete): keep completion popup inside the window and follow accent
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>
2026-06-03 10:28:45 +08:00