[PR #5196] fix: autocomplete popup repositions on window resize #11288

Closed
opened 2026-02-16 18:16:06 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5196

State: closed
Merged: Yes


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5196 **State:** closed **Merged:** Yes --- 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
yindo added the pull-request label 2026-02-16 18:16:06 -05:00
yindo closed this issue 2026-02-16 18:16:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11288