Skip to content

shorten-links - Show "(earlier review)" for same-thread links#9332

Merged
fregante merged 1 commit into
mainfrom
copilot/detect-review-links-mark-earlier-review
May 1, 2026
Merged

shorten-links - Show "(earlier review)" for same-thread links#9332
fregante merged 1 commit into
mainfrom
copilot/detect-review-links-mark-earlier-review

Conversation

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor

Extends the same-thread link shortening (added in #9329 for comments) to also handle review links. GitHub renders cross-references to reviews in the same PR as #123 (review) — these are now replaced with (earlier review).

  • source/github-helpers/dom-formatters.tsx: added else if branch in shortenLink() matching #${conversationNumber} (review)(earlier review)

Test URLs

#9329

Screenshot

@fregante fregante changed the title shorten-links: detect #123 (review) and show "(earlier review)" shorten-links - Show "(earlier comment)" for same-thread links May 1, 2026
@fregante fregante changed the title shorten-links - Show "(earlier comment)" for same-thread links shorten-links - Show "(earlier review)" for same-thread links May 1, 2026
@SunsetTechuila

Copy link
Copy Markdown
Contributor

What if we replace the number with "this conversation"? "this conversation (review)"/"this conversation (comment)"?

@fregante fregante marked this pull request as ready for review May 1, 2026 15:07
@SunsetTechuila

SunsetTechuila commented May 1, 2026

Copy link
Copy Markdown
Contributor

What if we replace the number with "this conversation"? "this conversation (review)"/"this conversation (comment)"?

This is something that shorten-repo-url can/should do itself

@fregante

fregante commented May 1, 2026

Copy link
Copy Markdown
Member

I initially didn't do it because we're using shorten-repo-URL via its applyToLink helper, which skips already-customized links like this one. If we add this logic to that package it would still need to be a separate+manual shortenRepoUrl call and a lot more complex than what we have now.

What if we replace the number with "this conversation"? "this conversation (review)"/"this conversation (comment)"?

The reason why I'm hesitant to use your suggestion (this conversation (comment)) is that it doesn't really look like a native link. Whereas (earlier comment) seems more flexible and human.

@fregante

fregante commented May 1, 2026

Copy link
Copy Markdown
Member

I'm still open to suggestions since 2022 (#6057) but that's the only two options we got so far. I'll merge this for this release and review once we find better alternatives.

@fregante fregante merged commit 2ba018f into main May 1, 2026
17 checks passed
@fregante fregante deleted the copilot/detect-review-links-mark-earlier-review branch May 1, 2026 16:29
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

To maintainers: Please add labels to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants