closing-remarks - Support new PR merge box - #8164
Merged
Merged
Conversation
fregante
marked this pull request as ready for review
December 18, 2024 09:22
fregante
commented
Dec 18, 2024
|
|
||
| const selector = typeof selectors === 'string' ? selectors : selectors.join(',\n'); | ||
| const seenMark = 'rgh-seen-' + getCallerID(); | ||
| const seenMark = 'rgh-seen-' + getCallerID(ancestor); |
Member
Author
There was a problem hiding this comment.
I don’t even know how this worked until now. The observer's callback was only called once because the generated rgh-seen class name was identical and successive callbacks would fail.
The observer should likely be refactored to make sure all listeners are called (probably just needs a await Promise.resolve() before removing the class but alas)
fregante
commented
Dec 18, 2024
Comment on lines
+15
to
+20
| await oneEvent(document.body, 'click', {signal, filter: ({target}: Event) => { | ||
| const clicked = target as HTMLElement; | ||
| // TODO: Drop `js-merge-commit-button` in May 2025 | ||
| return Boolean(clicked.closest('.js-merge-commit-button')) | ||
| || /^Confirm .+ merge$/i.test(clicked.textContent ?? ''); | ||
| }}); |
Member
Author
There was a problem hiding this comment.
The selector I found was not specific enough, it also matched the initial "Merge and squash" button.
But actually with :has(textarea) this appears to be enough.
I'll wait for fregante/delegate-it#55 to maybe restore an extra textContent check
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.
Test URLs
Any open PR, like this page
Screenshot
Gif also shows other auto-deletion working, but that's a separate PR