Repository navigation
update-pr-from-base-branch - Restore feature - #10203
Conversation
There was a problem hiding this comment.
🟡 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"]') |
|
No screenshot don't open PR |
done |
fregante
left a comment
There was a problem hiding this comment.
I can see it working, thank you! Some minor fixes and it can be merged
update-pr-from-base-branch - Restore feature
|
Looking very good and very nice |
|
Thanks @fregante for reviewing this :D |
|
Thank you for the PR! Would be good to look into |

Closes #10202
GitHub’s current PR UI uses different generated class names, so
getBranches()throws beforeupdate-pr-from-base-branchcan show its controls. The update-controls container and thepr-base-commitcaption 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
After
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
ElementNotFoundErrorfrom 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: noneand only the extension controls were visible. Temporarily removing the replacement group restored the native group todisplay: 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