Skip to content

update-pr-from-base-branch - Restore feature - #10203

Merged
fregante merged 4 commits into
refined-github:mainfrom
smengcl:fix-pr-ui-selectors
Oct 15, 2026
Merged

fregante merged 4 commits into
refined-github:mainfrom
smengcl:fix-pr-ui-selectors

Conversation

@smengcl

@smengcl smengcl commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #10202

GitHub’s current PR UI uses different generated class names, so getBranches() throws before update-pr-from-base-branch can show its controls. The update-controls container and the pr-base-commit caption selector also no longer match.

Accept the current branch-header markup alongside the previous and legacy layouts, and update the merge-box selectors, including the CSS that hides GitHub’s native update group once the replacement is present. Add regression coverage for branch parsing across all three layouts and for the mergeability caption with both wrapper layouts.

Screenshots

Before, on 26.10

image

After

image

Browser verification

Reproduced on the live GitHub site in Chrome 155.0.8059.80 on macOS with released Refined GitHub 26.10 after clearing its cache: both additions were missing and the console reported ElementNotFoundError from the old branch-header selector.

Loaded the patched unpacked extension and reloaded the same PR using an existing configured token. On apache/ozone#11542, both Update branch and Rebase rendered, together with “It’s 8 commits behind”. On up-to-date apache/ozone#11545, neither the controls nor the behind notice appeared; there were no Refined GitHub console errors. The behind count can change as the base advances. No merge or rebase was executed.

Also reproduced duplicate native and extension update controls on a temporary draft in my fork with native branch updates enabled. After the CSS fix, the native group had display: none and only the extension controls were visible. Temporarily removing the replacement group restored the native group to display: flex; reloading restored the replacement and hid the native group again. The temporary PR is now closed and the fork setting is restored.

Tests

The CI unit-test command passed with 328 tests passed and one skipped. TypeScript checking, the extension bundle build, ESLint and formatting checks also passed.

Generated-by: Codex (GPT-6)

Test URLs

Screenshot

@github-actions github-actions Bot added the bug label Oct 15, 2026
@smengcl
smengcl marked this pull request as ready for review October 15, 2026 02:43
Copilot AI lite review requested due to automatic review settings October 15, 2026 02:43

Copilot AI 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.

🟡 Changes recommended

The companion CSS still targets the old container, so the native and added Update branch controls can appear together.

1 open finding
What changed in this PR

This PR restores branch-update controls and the commits-behind notice on GitHub’s current pull request UI while retaining support for older layouts.

Changes:

  • Accept current, previous, and legacy branch-header markup.
  • Update merge-box selectors and add regression tests for branch parsing and caption matching.
File Description
source/​github-helpers/​selectors.ts Broadens the mergeability caption selector.
source/​github-helpers/​pr-mergeability.test.ts Tests the caption against both wrapper layouts.
source/​github-helpers/​pr-branches.ts Recognizes the current branch-header markup.
source/​github-helpers/​pr-branches.test.ts Tests branch parsing across three layouts.
source/​features/​update-pr-from-base-branch.tsx Finds the current update-controls container.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


// The same container as the native button uses
$('section[aria-label="Conflicts"] div[class^="MergeBoxSectionHeader-module__contentLayout"]')
$('section[aria-label="Conflicts"] div[class*="contentLayout"]')
@fregante

Copy link
Copy Markdown
Member

No screenshot don't open PR

@fregante fregante closed this Oct 15, 2026
@smengcl

smengcl commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

No screenshot don't open PR

done

@fregante fregante reopened this Oct 15, 2026

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can see it working, thank you! Some minor fixes and it can be merged

Comment thread source/github-helpers/pr-branches.ts Resolved
@fregante fregante changed the title Restore branch update controls and behind notice on current PR UI update-pr-from-base-branch - Restore feature Oct 15, 2026
@fregante

Copy link
Copy Markdown
Member

Looking very good and very nice

@fregante
fregante merged commit bbe6a39 into refined-github:main Oct 15, 2026
14 checks passed
@smengcl

smengcl commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @fregante for reviewing this :D

@fregante

Copy link
Copy Markdown
Member

Thank you for the PR! Would be good to look into restore-file. GitHub must have changed a bunch of classes this week and suddenly many features are broken: bug

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

Labels

Development

Successfully merging this pull request may close these issues.

update-pr-from-base-branch and pr-base-commit missing on current PR UI

3 participants