isaacs / github

Just a place to track issues and feature requests that I have for github
2.21k stars 129 forks source link

Pull request page should allow to expand all comments quickly #1190

Open findepi opened 6 years ago

findepi commented 6 years ago

When pull request has many comments, links from mail notifications no longer work. This happens when comment from mail is collapsed, hidden "behind" NN Hidden conversations \n Load More.... Please provide a button / option / whatever to expand all such hidden conversations.

findepi commented 6 years ago

I crafted some ugly cheap workaround: https://openuserjs.org/scripts/findepi/GitHub_PR_expand,_expand,_expand!

image

findepi commented 6 years ago

i mailed GH support about PR mail updates having dead links.

OliverJAsh commented 6 years ago
// Expand all collapsed commits

$$('.js-timeline-progressive-disclosure-button').forEach(el => el.click());

// Expand all collapsed conversations

$$('button')
  .filter(el => el.innerText === 'Load more…')
  .forEach(el => el.click());

// Expand all collapsed threads

const collapsedEls = $$('.outdated-comment').filter(el => !el.open);

collapsedEls.map(el => el.querySelector('.js-toggle-outdated-comments')).forEach(el => el.click());

// Expand all collapsed outdated threads

collapsedEls
  .map(el => el.querySelector('.js-toggle-outdated-comments'))
  .filter(el => el.querySelector('.show-outdated-button').textContent === 'Show outdated')
  .forEach(el => el.click());

https://gist.github.com/OliverJAsh/bc842d8e50fb946a03af7d7b356d832d

findepi commented 6 years ago

@OliverJAsh this works unless there is even more comments; then "load more..." won't load everything at once, you need to click "load more..." in a loop until all are loaded. Did you try the script i published on userscripts (https://openuserjs.org/scripts/findepi/GitHub_PR_expand,_expand,_expand!)? It does exactly that.

aeikum commented 4 years ago

@findepi That script works great, nice work! I'd suggest also matching issues URLs. I did this locally and it seems to work fine.

findepi commented 4 years ago

@aeikum thanks for kind words. I published my userscript's source on Github (https://github.com/findepi/user.js/blob/master/github-expand-expand-expand.user.js) so it's easier to collaborate.

hassifmohd commented 4 years ago

@aeikum thanks for kind words. I published my userscript's source on Github (https://github.com/findepi/user.js/blob/master/github-expand-expand-expand.user.js) so it's easier to collaborate.

emm how to use? using GreaseMonkey?


edited

Install guide

you need to install TamperMonkey for Google Chrome https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo/related?hl=en

Go here and click install https://openuserjs.org/scripts/findepi/GitHub_PR_expand,_expand,_expand!

findepi commented 4 years ago

Go here and click install https://openuserjs.org/scripts/findepi/GitHub_PR_expand,_expand,_expand!

@hassifmohd yes

As you see above, ! is valid part of URL (ie won't be url-escaped when copying from browser address bar) but is not treated as such by markdown (obviously), so after the initial publish with ! I also published without ot avoid 404s.

I didn't foresee this when picking up initial name...