Skip to content

highlight-non-default-base-branch - Simplify query#9168

Merged
fregante merged 2 commits into
refined-github:mainfrom
SeongJaeSong:highlight-non-default-base-branch-self-contained
Apr 7, 2026
Merged

highlight-non-default-base-branch - Simplify query#9168
fregante merged 2 commits into
refined-github:mainfrom
SeongJaeSong:highlight-non-default-base-branch-self-contained

Conversation

@SeongJaeSong
Copy link
Copy Markdown
Contributor

Refs #9167

Per @fregante's suggestion in #9167, this is a small refactor that prepares the feature for follow-up work without changing its scope or behavior:

  • Removes the parallel getDefaultBranch() call. The default branch is now fetched as defaultBranchRef { name } inside the same repository() query that already gets the PRs' base refs, so each batch makes one HTTP request instead of two.
  • Removes the buildRepoUrl() helper call. The base-branch tree URL is now built from nameWithOwner returned by the same query, dropping the DOM-based repo lookup.

No user-visible change. The feature still only runs on per-repo issue/PR lists. A follow-up PR will extend it to the global PR/issue list now that each batch is self-contained and doesn't depend on the current page's repo.

Test URLs

https://github.com/refined-github/sandbox/pulls?q=is%3Apr+is%3Aopen+pr+branch

Screenshot

(no visual change — same badge as before)

…m the same query

Removes the parallel `getDefaultBranch()` call and the `buildRepoUrl()` helper.
The default branch and `nameWithOwner` are now fetched in the same GraphQL
query that already retrieves the PRs' base refs, eliminating the second HTTP
request and the DOM-based repo lookup.

Refs refined-github#9167
@SeongJaeSong SeongJaeSong marked this pull request as ready for review April 7, 2026 07:00
Copy link
Copy Markdown
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

Eggcellent!

Comment thread source/features/highlight-non-default-base-branch.tsx Outdated
@fregante fregante changed the title highlight-non-default-base-branch - Get default branch and repo from the same query highlight-non-default-base-branch - Simplify query Apr 7, 2026
@fregante fregante enabled auto-merge (squash) April 7, 2026 07:20
@fregante fregante merged commit f8bf2bb into refined-github:main Apr 7, 2026
11 checks passed
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.

2 participants