Skip to content

[editor/diffs] Render marker popup in overlay element - #825

Merged
mdo merged 1 commit into
beta-1.3from
editor/fix-scroll-bug
Jun 17, 2026
Merged

[editor/diffs] Render marker popup in overlay element#825
mdo merged 1 commit into
beta-1.3from
editor/fix-scroll-bug

Conversation

@ije

@ije ije commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

This pr fixes scrolling error when a marker popup showing.

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-docs-diffs Ready Ready Preview Jun 17, 2026 8:36pm
pierre-docs-diffshub Ready Ready Preview Jun 17, 2026 8:36pm
pierre-docs-trees Ready Ready Preview Jun 17, 2026 8:36pm
pierrejs-diff-demo Ready Ready Preview Jun 17, 2026 8:36pm

Request Review

@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

Here are some automated review suggestions for this pull request.

Reviewed commit: d4b31c7504

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

],
},
preElement
overlayElement

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep marker popups outside the clipped code scroller

When the popup is appended to overlayElement, it becomes an absolutely positioned child of the [data-code] scroller because the editor overlay is display: contents; the inspected stylesheet gives [data-code] overflow: ... scroll clip. For a marker on the last rendered/file line, y is computed as the line top plus one line height, so the popup starts at the bottom of the clipped scroller and is hidden instead of being visible below the line.

Useful? React with 👍 / 👎.

const lineHeight = getLineHeight();
const y = getLineY(line) + wrapLine * lineHeight + lineHeight;
const transform = `translateX(${codeElement.offsetLeft + left}px) translateY(${codeElement.offsetTop + y}px)`;
const transform = `translateX(${left}px) translateY(${y}px)`;

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.

left and y is cached, this reduces reflow

@mdo

mdo commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Tested locally in my /edit page demos and all looks good.

@mdo
mdo merged commit 7ca2b4e into beta-1.3 Jun 17, 2026
8 checks passed
@mdo
mdo deleted the editor/fix-scroll-bug branch June 17, 2026 20:49
amadeus pushed a commit that referenced this pull request Jun 22, 2026
amadeus pushed a commit that referenced this pull request Jun 24, 2026
amadeus pushed a commit that referenced this pull request Jun 24, 2026
tjni pushed a commit to tjni/pierre that referenced this pull request Jun 25, 2026
amadeus pushed a commit that referenced this pull request Jul 21, 2026
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.

2 participants