Skip to content

fix: autocomplete popup repositions on window resize - #5196

Merged
rekram1-node merged 2 commits into
anomalyco:devfrom
mberrishdev:fix/autocomplete-position-resize
Dec 7, 2025
Merged

rekram1-node merged 2 commits into
anomalyco:devfrom
mberrishdev:fix/autocomplete-position-resize

Conversation

@mberrishdev

Copy link
Copy Markdown
Contributor

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 and others added 2 commits December 7, 2025 14:43
The autocomplete popup position was static and didn't update when the
terminal window was resized. This change adds position tracking that
polls the anchor element every 50ms when the popup is visible, but only
triggers a re-render when coordinates actually change.
@rekram1-node

Copy link
Copy Markdown
Collaborator

/review

@github-actions

github-actions Bot commented Dec 7, 2025

Copy link
Copy Markdown
Contributor

lgtm

@rekram1-node

Copy link
Copy Markdown
Collaborator

This seems to work pretty well, nice job

@rekram1-node
rekram1-node merged commit 4eb82e8 into anomalyco:dev Dec 7, 2025
3 of 4 checks passed
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select popup with commands doesn't reposition on terminal resize

2 participants