opencode
opencode copied to clipboard
fix: autocomplete popup repositions on window resize
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