Skip to content

Fix overlapping comment highlights - #172

Merged
HamptonMakes merged 1 commit into
mainfrom
hampton/fix-overlapping-comment-anchors
Aug 13, 2026
Merged

Fix overlapping comment highlights#172
HamptonMakes merged 1 commit into
mainfrom
hampton/fix-overlapping-comment-anchors

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

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

  • Give overlapping comment anchors independent nested highlight elements
  • Keep open nested highlights interactive and route clicks to the innermost thread
  • Cover the exact single-word heading selection, Enter submission, reload, and click flow

Risk Assessment

Low — limited to overlapping inline comment anchors; the existing comment UX and anchoring system suites pass.

Generated with Amp

background: var(--color-highlight-open-bg);
border-bottom: 2px solid var(--color-highlight-open-border);
cursor: pointer;
pointer-events: auto;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this do?

@HamptonMakes
HamptonMakes marked this pull request as ready for review August 13, 2026 16:22
@HamptonMakes
HamptonMakes merged commit 73b7e68 into main Aug 13, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const mark = document.createElement("mark")
mark.className = className
range.surroundContents(mark)

P2 Badge Preserve click access for fully overlapping threads

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".

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