Skip to content

fix: anchor mention popover at composer top-leading#1086

Merged
datlechin merged 1 commit into
mainfrom
fix/mention-popover-anchor-leading
May 7, 2026
Merged

fix: anchor mention popover at composer top-leading#1086
datlechin merged 1 commit into
mainfrom
fix/mention-popover-anchor-leading

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

Mention popover anchor was .point(.top) (top-center of composer), so the popover floated centered above the composer regardless of where the @ character was actually typed. Since the user types @ at the leftmost edge of the text input, the popover should hang over that edge instead of the center.

Change to .point(.topLeading). Combined with arrowEdge: .bottom, the popover now anchors at the top-left corner of the composer with its arrow tip at that point, hanging up-and-right from there.

This is the closest pure-SwiftUI approximation of caret-anchored autocomplete (Apple Mail address autofill, VS Code mention dropdown). True caret-precise anchoring requires NSTextView selection rect math, which would reintroduce the TextKit 1 dependency we dropped in #1076.

Test plan

  • In the AI Chat composer, type @. The mention popover appears anchored to the top-left of the composer.
  • Type more characters to filter; popover position stays stable.
  • Press Esc to dismiss; popover hides cleanly.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin datlechin merged commit a2d23f5 into main May 7, 2026
2 checks passed
@datlechin datlechin deleted the fix/mention-popover-anchor-leading branch May 7, 2026 13:01
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.

1 participant