highlight-non-default-base-branch - Support global PR/issue lists#9170
Merged
fregante merged 18 commits intoApr 16, 2026
Merged
Conversation
fregante
reviewed
Apr 12, 2026
fregante
approved these changes
Apr 12, 2026
Member
fregante
left a comment
There was a problem hiding this comment.
Should be ok now. Thank you!
now they include prs to deleted branches
SunsetTechuila
approved these changes
Apr 15, 2026
fregante
reviewed
Apr 16, 2026
Comment on lines
+123
to
+127
| observe([ | ||
| '.js-issue-row a[data-hovercard-type="pull_request"]', // Repo and global PR lists | ||
| 'a[data-hovercard-type="pull_request"][data-testid="listitem-title-link"]', // Preview global PR list | ||
| 'a[data-hovercard-type="pull_request"][data-testid="issue-pr-title-link"]', // Issue list | ||
| ], batchedFunction(add, {delay: 100}), {signal}); |
Member
There was a problem hiding this comment.
@SunsetTechuila see last commit. While :is feels like an optimization (DRY) it actually makes it difficult to:
- read each selector (especially if it varies with
*sometimes and sometimes not) - modify each selector in the future in cases where the root
ishas to be changed
If the common selector is super long, we could use replacement to preserve readability while keeping it DRY:
const link = 'a[data-hovercard-type="pull_request"]'
observe([
`.js-issue-row ${link}`, // Repo and global PR lists
`${link}[data-testid="listitem-title-link"]`, // Preview global PR list
`${link}[data-testid="issue-pr-title-link"]`, // Issue list
], batchedFunction(add, {delay: 100}), {signal});but this is also not without issues
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.
Closes #9167. Follow-up to #9168.
Extends the feature to the global PR/issue dashboards (
/pulls,/issues,/pulls?author=@me, etc.) where the badge is arguably most useful — that's where you scan PRs across many repos and have no other quick way to spot one targeting a non-default branch.What changed
pageDetect.isGlobalIssueOrPRListtoinclude.a[data-testid="issue-pr-title-link"][href*="/pull/"]) used by the global lists, alongside the existing legacy selector.href, so the feature no longer assumes a single-repo page context.buildQuerynow emits one aliasedrepository(owner, name) { ... }block per repo, all in a single GraphQL query.Why grouping by repo into a single query:
Sending one query per PR (or per repo, in parallel) would be simpler, but I went with single-query alias grouping to be safe against GitHub's secondary rate limits — the global PR list can easily contain PRs from 10+ distinct repos, and the per-request limit (and burst limit) is much tighter than the points budget. One batched query also saves a round trip and keeps response handling sequential. The added complexity is contained to
buildQuery+ alias lookup inadd.If you'd rather have the simpler version (one
api.v4call per repo, in parallel), happy to switch.Test URLs
Screenshot
Per-repo
Global PR list