feat(extension): inject Mergify row into every merge box variant#494
Merged
mergify[bot] merged 1 commit intoMay 29, 2026
Conversation
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Required ReviewsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
There was a problem hiding this comment.
Pull request overview
Adds support for GitHub’s updated PR merge-status sidebar so the Mergify merge-box row is injected into the new stable container and no longer collides with GitHub’s native section#mergify.
Changes:
- Updates merge-box row ID references to
mergify-merge-box-row. - Adds the new
data-testid="mergebox-border-container"injection anchor with legacy fallback. - Adds unit coverage for new sidebar injection, native
#mergifycoexistence, fallback behavior, and missing merge-box handling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/queue.js |
Renames the injected row ID and updates queue row refresh lookups. |
src/mergify.js |
Exports and updates merge-box injection to use the new GitHub sidebar anchor. |
src/__tests__/mergify.test.js |
Adds direct tests for merge-box row injection behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
67ea233 to
c5c090a
Compare
Member
Author
Revision history
|
c5c090a to
2222c31
Compare
2222c31 to
cd78694
Compare
cd78694 to
a306b76
Compare
a306b76 to
cecbe26
Compare
cecbe26 to
ad598c6
Compare
ad598c6 to
21257fd
Compare
21257fd to
1eb5a3f
Compare
Member
Author
GitHub serves PR pages with up to three different merge-box layouts
right now:
1. The new merge-status sidebar (a Primer dialog at the document
root, anchored on `[data-testid="mergebox-border-container"]`),
being rolled out.
2. The current bottom merge box (`[data-testid="mergebox-partial"]`
with `.border.rounded-2`, optionally wrapped by
`.discussion-timeline-actions .merge-pr`).
3. The classic `.mergeability-details` merge box.
Some users only see one variant; others — depending on the rollout —
see the new sidebar alongside the bottom merge box on the same page.
The extension needs to render the Mergify row on every variant so the
queue/refresh affordance is visible wherever GitHub shows merge
controls.
Refactor injectRowIntoMergeBox around a MERGE_BOX_ANCHORS table that
walks every variant and attaches a row to every container that does
not already contain one. The single-row id is replaced by a
`data-mergify-merge-box-row` attribute since multiple instances must
coexist; updateMergifyRow callers route through a new
updateAllMergifyRows helper so post-command refreshes and the
queue-state poll cover every instance.
While there, fix a latent collision: GitHub's new sidebar renders a
native `<section id="mergify">` for the Mergify GitHub App check,
which made the previous `document.querySelector("#mergify")` gate
short-circuit our injection logic to update that native section
instead of our row. The attribute-based marker sidesteps that, and
the per-container guard inside injectRowIntoMergeBox keeps the
function idempotent on repeated MutationObserver ticks.
Tests cover the new sidebar anchor, coexistence with the native
`<section id="mergify">`, the legacy mergebox-partial fallback, the
no-merge-box case, multi-anchor coexistence (all three injected at
once), and per-anchor idempotency on repeated calls.
Fixes MRGFY-7396
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I5fbcee2590a13a5e0da0c7e5ffc05f0cf2432b02
1eb5a3f to
24aca7a
Compare
JulianMaurin
approved these changes
May 28, 2026
remyduthu
approved these changes
May 29, 2026
Contributor
Merge Queue Status
This pull request spent 2 minutes 23 seconds in the queue, including 1 minute 38 seconds running CI. Required conditions to merge
|
34 tasks
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.

GitHub serves PR pages with up to three different merge-box layouts
right now:
root, anchored on
[data-testid="mergebox-border-container"]),being rolled out.
[data-testid="mergebox-partial"]with
.border.rounded-2, optionally wrapped by.discussion-timeline-actions .merge-pr)..mergeability-detailsmerge box.Some users only see one variant; others — depending on the rollout —
see the new sidebar alongside the bottom merge box on the same page.
The extension needs to render the Mergify row on every variant so the
queue/refresh affordance is visible wherever GitHub shows merge
controls.
Refactor injectRowIntoMergeBox around a MERGE_BOX_ANCHORS table that
walks every variant and attaches a row to every container that does
not already contain one. The single-row id is replaced by a
data-mergify-merge-box-rowattribute since multiple instances mustcoexist; updateMergifyRow callers route through a new
updateAllMergifyRows helper so post-command refreshes and the
queue-state poll cover every instance.
While there, fix a latent collision: GitHub's new sidebar renders a
native
<section id="mergify">for the Mergify GitHub App check,which made the previous
document.querySelector("#mergify")gateshort-circuit our injection logic to update that native section
instead of our row. The attribute-based marker sidesteps that, and
the per-container guard inside injectRowIntoMergeBox keeps the
function idempotent on repeated MutationObserver ticks.
Tests cover the new sidebar anchor, coexistence with the native
<section id="mergify">, the legacy mergebox-partial fallback, theno-merge-box case, multi-anchor coexistence (all three injected at
once), and per-anchor idempotency on repeated calls.
Fixes MRGFY-7396
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com