Cleanup pull-request from clutter
See original GitHub issueDescription
Sometimes pull-requests stay open longer than expected and pile up a lot of X previously approved these changes N days ago
and Y dismissed X's stale review via C N days ago
… Maybe in combination with M hidden items
yielding more of previous examples after expanded…
This makes the pull-request view quite unusable because you need to scroll 4000px (just looked it up in one of my PRs) until you get to the important stuff.
An option to clean that up IMHO would be a great addition and would help the user to work more efficiently.
A simple “cleanup” which might be suitable to demonstrate the effect would be this one:
[...document.querySelectorAll('.js-timeline-item')].filter(itm => {
const html = itm.innerHTML
return html.includes('previously approved') || (html.includes('stale review') && html.includes('dismissed'))
}).forEach(itm => itm.parentElement.removeChild(itm))
Sadly this needs to be re-applied every time a M hidden items
section is expanded.
Screenshot
Before / default state
After / cleaned
Example URL
Not providing an URL below as all example PRs are in private repos having a branch protection with “Dismiss stale pull request approvals when new commits are pushed” active.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
We can definitely include stale reviews in the “collapsed comments” filter, which are currently never hidden: https://github.com/refined-github/sandbox/pull/10#event-6400656397
I wonder if we should always just keep commits visible instead. The feature was designed around issue conversations and then the PR followed. I think commits are an important part of PRs (uh, which seems obvious) so maybe we should never hide them.
Both of these changes would fix it for you.
I think we already do this as part of the
filter-conversation-activity
feature or whatever it’s called