fix(diffs): place selection action above bottom-up selections#922
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51568f0433
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
necolas
left a comment
There was a problem hiding this comment.
lgtm once agents are appeased
51568f0 to
0fb995a
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0fb995ad81
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Render the selection-action popover above the selection for backward (bottom-up) selections instead of covering its first line, and preserve the selection direction across a refocus so the caret/popover no longer jump to the bottom.
c855fca to
d4cdf50
Compare
|
Follow-up from the reviews here and latest What changed
Bonus find: the existing Added tests for all of the above (marker popup placement, the fallback-visibility fix, hysteresis, composition). Full |
The selection action widget position on a backward selection shifted 2 lines
update: fixed in 51512b6 |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51512b6549
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| this.#resizeObserver = new ResizeObserver(() => { | ||
| this.#height = this.#popover.offsetHeight; | ||
| }); |
There was a problem hiding this comment.
Recompute placement when the action content resizes
When the consumer-rendered selection action changes height after it is mounted (for example async content, loaded icons, or responsive wrapping), this observer only updates the cached height and never schedules #updateSelectionActionPopover(). For selections near the top/bottom of the visible scrollport, the popover can remain on a side that no longer fits and be clipped until some unrelated selection/scroll/resize event forces a reposition.
Useful? React with 👍 / 👎.

Render the selection-action popover above the selection for backward (bottom-up) selections instead of covering its first line, and preserve the selection direction across a refocus so the caret/popover no longer jump to the bottom.