Fix overlapping comment highlights - #172
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019ff95d-70a0-7360-88b7-6ee54f576771 Co-authored-by: Amp <amp@ampcode.com>
| background: var(--color-highlight-open-bg); | ||
| border-bottom: 2px solid var(--color-highlight-open-border); | ||
| cursor: pointer; | ||
| pointer-events: auto; |
There was a problem hiding this comment.
what does this do?
There was a problem hiding this comment.
💡 Codex Review
coplan/engine/app/javascript/controllers/coplan/text_selection_controller.js
Lines 842 to 844 in 074e4ea
When two threads anchor the exact same range, this unconditional nesting makes the later mark completely cover the earlier one; because openThreadPopover() now stops propagation, clicking the highlighted text can only open the inner thread, leaving the outer thread’s popover unreachable by mouse. This commonly occurs when multiple reviewers select the same phrase, so fully coincident anchors need a way to expose both threads rather than routing every click exclusively to the newest nested mark.
AGENTS.md reference: AGENTS.md:L138-L142
ℹ️ 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".
Why
A new open comment nested inside an older resolved anchor was persisted but disappeared after reload because both threads shared the resolved anchor's invisible highlight.
What
Risk Assessment
Low — limited to overlapping inline comment anchors; the existing comment UX and anchoring system suites pass.
Generated with Amp