opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: autocomplete popup repositions on window resize

Open mberrishdev opened this issue 1 month ago • 0 comments

Fixes #4829

Problem

The autocomplete popup (shown when typing / or @) had a static position that didn't update when the terminal window was resized, causing it to appear misaligned.

Solution

Added reactive position tracking that:

  • Polls the anchor element coordinates every 50ms when the popup is visible
  • Only triggers re-renders when position actually changes (no performance impact when static)
  • Uses useTerminalDimensions() to also track dimension changes
  • Cleans up the interval when the popup closes

mberrishdev avatar Dec 07 '25 10:12 mberrishdev