Repository navigation
fix(web): pull request hover card holds a comment or commit's place while it loads - #37460
Open
flamboh wants to merge 2 commits into
Conversation
flamboh
marked this pull request as ready for review
November 16, 2026 03:47
| expect(document.querySelector('[data-slot="skeleton"]')).toBeNull(); | ||
| }); | ||
|
|
||
| it.each([ |
Contributor
There was a problem hiding this comment.
This tests a purely visual layout-shift fix, for which the before/after captures are the required proof. Could you remove the new placeholder and fallback tests, along with the added skeleton assertion in the existing loading test?
Posted via Macroscope — Test Signal
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Pull-request hover cards now reserve space for linked comments, commits, and timestamps while loading. The change is limited to transient presentation, with existing fetching, navigation, and error fallbacks unchanged. You can add or adjust custom eligibility rules. Learn more. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
🤖 Claude Opus 5.5 on behalf of Oliver
Change for the redesign stack, targets layer 1 (#28839).
Stacked on #37453: this branch contains that commit, so review #37453 first; the diff here shrinks to its own change once that one lands.
Problem
A hover card for a link to a pull request comment or commit needs a second read for that comment or commit. Until it lands, the card shows the pull request's title and author, then swaps that whole body for the comment or commit, so the card changes content and size under the pointer.
Change
The URL already says whether the link is to a comment or a commit, so from the first frame the card shows a skeleton laid out like that body: author line plus four text lines for a comment (excerpts are clamped to four), a two-line headline plus the sha and author row for a commit. The real content replaces it when the read lands. If the read fails, or the comment or commit is no longer there, the card shows the pull request's title and author as it does today. Links to other timeline events (
#event-…) never resolve to a comment, so they keep showing the pull request.Evidence
Hovering a comment link and a commit link, with the activity read slowed by 1.5 s on both sides. Before (base, #37453's head) the card shows the pull request's title and author, then swaps to the comment or commit and changes size. After, a placeholder of the same shape fills in and the card keeps its size. Loaded, the cards are pixel-identical.
A comment link:
https://gh-file-drop-api-prod-galwoqjslzlnws6s.oliver-boorstein.workers.dev/f/3c0fedbcc7b31ec2/comment-card.mp4
A commit link:
https://gh-file-drop-api-prod-galwoqjslzlnws6s.oliver-boorstein.workers.dev/f/c216173535a254a5/commit-card.mp4
Measured on the after build: a four-line comment and a two-line commit headline do not move the card at all. A very short comment ("LGTM") shrinks it by 58.5 px once, a 20-character headline shrinks it by 19.25 px, and a 121-character headline grows it by 19.25 px.
Validation
PullRequestLinkPreview.browser.test.tsxcovers the comment and commit placeholders, the#event-link that keeps the pull request, and the fallback when the read fails.vp run check:changed df77ec3054a: format, lint, knip, typecheck, tests and the React compiler check pass.Made with Claude Opus 5.5 in Claude Code (T3 Code).