Skip to content

docs: Clarify that anchor is the Popover's origin, not the display side#2537

Merged
huacnlee merged 1 commit into
mainfrom
clarify-anchor-docs
Jul 6, 2026
Merged

docs: Clarify that anchor is the Popover's origin, not the display side#2537
huacnlee merged 1 commit into
mainfrom
clarify-anchor-docs

Conversation

@huacnlee

@huacnlee huacnlee commented Jul 6, 2026

Copy link
Copy Markdown
Member

Description

Closes #2534.

Users read the anchor option as "which side of the trigger the popover shows on" and reported it as inverted. It actually uses GPUI's corner-anchoring model, and the docs described it in a way that reinforced the wrong mental model.

This PR only clarifies documentation, no behavior change. Instead of explaining the mechanics, it uses a concrete image: imagine the popover has a pointer tip (like a speech bubble's tail) — the anchor is where that tip sits relative to the trigger (Anchor::TopLeft → the trigger's top-left corner, Anchor::BottomRight → the bottom-right, and so on), and the popover hangs off that point.

  • Rewrite the anchor() doc comments on Popover and HoverCard.
  • Update the Popover and HoverCard docs (en + zh-CN) with the same explanation.
  • Drop stale wording that implied two separate Anchor types.

@huacnlee
huacnlee force-pushed the clarify-anchor-docs branch 3 times, most recently from cf0f13b to 90c2370 Compare July 6, 2026 08:42
@huacnlee huacnlee changed the title popover: Clarify that anchor is the popover's origin, not the display side docs: Clarify that anchor is the Popover's origin, not the display side Jul 6, 2026
@huacnlee
huacnlee enabled auto-merge (squash) July 6, 2026 08:44
@huacnlee
huacnlee disabled auto-merge July 6, 2026 08:45
@huacnlee
huacnlee force-pushed the clarify-anchor-docs branch from 90c2370 to b3b2be1 Compare July 6, 2026 08:47
Users read the `anchor` option as "which side of the trigger the popover
shows on" and reported it as inverted (#2534). It actually uses GPUI's
corner-anchoring model.

Explain it with a concrete image instead: the anchor is where the popover's
pointer tip (like a speech bubble's tail) sits relative to the trigger, and
the popover hangs off that point. Applied to the `anchor()` comments on
`Popover`/`HoverCard` and their docs (en + zh-CN), added a small `TopLeft`
example diagram, and dropped stale wording that implied two separate `Anchor`
types. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huacnlee
huacnlee force-pushed the clarify-anchor-docs branch from b3b2be1 to 2081606 Compare July 6, 2026 08:59
@huacnlee
huacnlee merged commit dbc038c into main Jul 6, 2026
4 checks passed
@huacnlee
huacnlee deleted the clarify-anchor-docs branch July 6, 2026 09:05
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.

Positioning of popover and hover cards are inverted

1 participant