New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse/Expand files in the Files Changed view of a Pull Request #514

Closed
dalpert-korewireless opened this Issue Nov 9, 2015 · 39 comments

Comments

Projects
None yet
@dalpert-korewireless

dalpert-korewireless commented Nov 9, 2015

As a developer participating in a Code Review for a large Pull Request
I want the ability to collapse individual files in the Files Changed view
So that I can ignore code that I've already reviewed
And navigate a large number of changes more easily.

@dalpert-korewireless

This comment has been minimized.

Show comment
Hide comment
@dalpert-korewireless

dalpert-korewireless Nov 10, 2015

-----Original Message-----
From: Ivan Žužak [mailto:support@github.com] 
Sent: November-10-15 3:41 AM
To: David Alpert
Subject: Re: Feature Request - Collapse/Expand files in the Files Changed view of a Pull Request

Thanks for expressing interest in this, David -- yeah, I agree that'd be very useful. I'll pass your suggestion to the team working on pull requests, but can't promise anything.

If there's anything else you'd like to see improved -- let me know.

Cheers,
Ivan

dalpert-korewireless commented Nov 10, 2015

-----Original Message-----
From: Ivan Žužak [mailto:support@github.com] 
Sent: November-10-15 3:41 AM
To: David Alpert
Subject: Re: Feature Request - Collapse/Expand files in the Files Changed view of a Pull Request

Thanks for expressing interest in this, David -- yeah, I agree that'd be very useful. I'll pass your suggestion to the team working on pull requests, but can't promise anything.

If there's anything else you'd like to see improved -- let me know.

Cheers,
Ivan
@ProLoser

This comment has been minimized.

Show comment
Hide comment
@ProLoser

ProLoser Dec 3, 2015

@dalpert-korewireless this feature has been partially added to Github Omnibox for chrome: https://chrome.google.com/webstore/detail/github-omnibox/jbfhklldhgbomclinhlgbmjjiimafolo?utm_source=chrome-ntp-icon
There's a control to expand/collapse all files, and then a control on each file. Although it's hard to see in this video, you can also shift+click on an individual file's collapse button and it will collapse all siblings while expanding the target file.

The extension has a lot of other features too such as personalized searching in the chrome address bar and CI server status badges (we're still porting the badges to the new github layout).

Screen

ProLoser commented Dec 3, 2015

@dalpert-korewireless this feature has been partially added to Github Omnibox for chrome: https://chrome.google.com/webstore/detail/github-omnibox/jbfhklldhgbomclinhlgbmjjiimafolo?utm_source=chrome-ntp-icon
There's a control to expand/collapse all files, and then a control on each file. Although it's hard to see in this video, you can also shift+click on an individual file's collapse button and it will collapse all siblings while expanding the target file.

The extension has a lot of other features too such as personalized searching in the chrome address bar and CI server status badges (we're still porting the badges to the new github layout).

Screen

@JeroenDeDauw

This comment has been minimized.

Show comment
Hide comment
@JeroenDeDauw

JeroenDeDauw Mar 17, 2016

Now that the list of files changed into this stupid thing:

failui

it's nearly impossible to get a quick high level overview of where a PR changes things. Being able to collapse files would help mitigate this problem.

JeroenDeDauw commented Mar 17, 2016

Now that the list of files changed into this stupid thing:

failui

it's nearly impossible to get a quick high level overview of where a PR changes things. Being able to collapse files would help mitigate this problem.

@sindresorhus

This comment has been minimized.

Show comment
Hide comment
@sindresorhus

sindresorhus Apr 4, 2016

The refined-github browser extension adds support for this.

sindresorhus commented Apr 4, 2016

The refined-github browser extension adds support for this.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost commented Apr 15, 2016

+1

@bbadeaux-ias

This comment has been minimized.

Show comment
Hide comment
@bbadeaux-ias

bbadeaux-ias commented Jul 28, 2016

+1

@jrhie

This comment has been minimized.

Show comment
Hide comment
@jrhie

jrhie commented Aug 5, 2016

+1

@dustinrohde

This comment has been minimized.

Show comment
Hide comment
@dustinrohde

dustinrohde commented Nov 12, 2016

+1

@TrentBrown

This comment has been minimized.

Show comment
Hide comment
@TrentBrown

TrentBrown commented Dec 20, 2016

+1

@joeytwiddle

This comment has been minimized.

Show comment
Hide comment
@joeytwiddle

joeytwiddle Jan 10, 2017

For userscript lovers (Greasemonkey or Tampermonkey users), my Github Notifications Dropdown script includes this feature as an extra. (You need to flip a boolean inside the script, to enable it.)

The feature only activates on a fresh page load, so you may need to reload the page if you navigated there from within the Github site.

For non-userscript lovers, the Static Bookmarklet from here might let you load the feature when you need it. (dead link)

joeytwiddle commented Jan 10, 2017

For userscript lovers (Greasemonkey or Tampermonkey users), my Github Notifications Dropdown script includes this feature as an extra. (You need to flip a boolean inside the script, to enable it.)

The feature only activates on a fresh page load, so you may need to reload the page if you navigated there from within the Github site.

For non-userscript lovers, the Static Bookmarklet from here might let you load the feature when you need it. (dead link)

@conalsmith49

This comment has been minimized.

Show comment
Hide comment
@conalsmith49

conalsmith49 Mar 22, 2017

+1 on this much needed functionality.

conalsmith49 commented Mar 22, 2017

+1 on this much needed functionality.

@noplanman

This comment has been minimized.

Show comment
Hide comment
@noplanman

noplanman Mar 25, 2017

GitHub has implemented this not long ago:
file-collapse

My user script GitHub Tweaks has had this feature for quite some time, also for comments in conversations 👍

As GitHub adds features natively, I'm happy to lighten my script 😊

noplanman commented Mar 25, 2017

GitHub has implemented this not long ago:
file-collapse

My user script GitHub Tweaks has had this feature for quite some time, also for comments in conversations 👍

As GitHub adds features natively, I'm happy to lighten my script 😊

@bbi-yggy

This comment has been minimized.

Show comment
Hide comment
@bbi-yggy

bbi-yggy Mar 29, 2017

@noplanman The new triangle toggle in GitHub is nice, but there is no easy way (that I can find) to collapse all the files in the review. Do you know if this is possible, maybe I'm overlooking something?

bbi-yggy commented Mar 29, 2017

@noplanman The new triangle toggle in GitHub is nice, but there is no easy way (that I can find) to collapse all the files in the review. Do you know if this is possible, maybe I'm overlooking something?

@noplanman

This comment has been minimized.

Show comment
Hide comment
@noplanman

noplanman Mar 29, 2017

noplanman commented Mar 29, 2017

@bbi-yggy

This comment has been minimized.

Show comment
Hide comment
@bbi-yggy

bbi-yggy Mar 29, 2017

That's what I figured / feared. Thanks for the clarification. :)

bbi-yggy commented Mar 29, 2017

That's what I figured / feared. Thanks for the clarification. :)

@yardensachs

This comment has been minimized.

Show comment
Hide comment
@yardensachs

yardensachs May 29, 2017

Also, you can run this on browser console:

$$('div.file-header > div.file-actions > button').map(function(x){x.click()});

yardensachs commented May 29, 2017

Also, you can run this on browser console:

$$('div.file-header > div.file-actions > button').map(function(x){x.click()});

@clarkbw clarkbw added the code review label Jan 3, 2018

@drbergeron

This comment has been minimized.

Show comment
Hide comment
@drbergeron

drbergeron Jan 19, 2018

+1 for creating a "Collapse All" option, or even starting collapsed if number of files is over some threshold/parameter.

drbergeron commented Jan 19, 2018

+1 for creating a "Collapse All" option, or even starting collapsed if number of files is over some threshold/parameter.

@benjamincharity

This comment has been minimized.

Show comment
Hide comment
@benjamincharity

benjamincharity Jan 19, 2018

I'll add on to @yardensachs with this:

// Close all open
$$('div:not(.Details--on) > div.file-header > div.file-actions > button').map(function(x){x.click()});

Was useful to speed up the browser when halfway through a PR with tons of files.

benjamincharity commented Jan 19, 2018

I'll add on to @yardensachs with this:

// Close all open
$$('div:not(.Details--on) > div.file-header > div.file-actions > button').map(function(x){x.click()});

Was useful to speed up the browser when halfway through a PR with tons of files.

@sharpdot

This comment has been minimized.

Show comment
Hide comment
@sharpdot

sharpdot commented Jan 26, 2018

+1

@Brian-Clement

This comment has been minimized.

Show comment
Hide comment
@Brian-Clement

Brian-Clement commented Jan 26, 2018

+1

@KayakinKoder

This comment has been minimized.

Show comment
Hide comment
@KayakinKoder

KayakinKoder Feb 2, 2018

This can't be real life. Just considering switching our enterprise app from bitbucket to github but....I can't easily see a list of files changed?

KayakinKoder commented Feb 2, 2018

This can't be real life. Just considering switching our enterprise app from bitbucket to github but....I can't easily see a list of files changed?

@larsxschneider

This comment has been minimized.

Show comment
Hide comment

larsxschneider commented Feb 6, 2018

based on @yardensachs and @benjamincharity 's solutions I created a bookmarklet: https://gist.github.com/larsxschneider/c024d7308683eefe2704dffe0b706549

@truongnguyen-ntq

This comment has been minimized.

Show comment
Hide comment
@truongnguyen-ntq

truongnguyen-ntq May 4, 2018

Alt + click to expand/collapse all :)

image

truongnguyen-ntq commented May 4, 2018

Alt + click to expand/collapse all :)

image

@Brian-Clement

This comment has been minimized.

Show comment
Hide comment
@Brian-Clement

Brian-Clement May 4, 2018

@truongnguyen-ntq I'm not seeing that option...is that a new feature rolling out? Otherwise @larsxschneider 's bookmarklet is working well for me.

Brian-Clement commented May 4, 2018

@truongnguyen-ntq I'm not seeing that option...is that a new feature rolling out? Otherwise @larsxschneider 's bookmarklet is working well for me.

@truongnguyen1912

This comment has been minimized.

Show comment
Hide comment
@truongnguyen1912

truongnguyen1912 May 6, 2018

@Brian-Clement ah, refined-github browser extension adds support for it. It is not original github feature :(

truongnguyen1912 commented May 6, 2018

@Brian-Clement ah, refined-github browser extension adds support for it. It is not original github feature :(

@emilygdavis

This comment has been minimized.

Show comment
Hide comment
@emilygdavis

emilygdavis May 22, 2018

+1 here too. It would be great to have this as a native feature of Github and not just part of an extension!

emilygdavis commented May 22, 2018

+1 here too. It would be great to have this as a native feature of Github and not just part of an extension!

@elpiel

This comment has been minimized.

Show comment
Hide comment
@elpiel

elpiel May 30, 2018

+1 as well.

elpiel commented May 30, 2018

+1 as well.

@wedgiebee

This comment has been minimized.

Show comment
Hide comment
@wedgiebee

wedgiebee commented Jun 1, 2018

+1 !!! ;)

@xnlcasad

This comment has been minimized.

Show comment
Hide comment
@xnlcasad

xnlcasad commented Jul 3, 2018

+1

@SimKennedy

This comment has been minimized.

Show comment
Hide comment
@SimKennedy

SimKennedy commented Jul 16, 2018

+1

@picheli20

This comment has been minimized.

Show comment
Hide comment
@picheli20

picheli20 Jul 20, 2018

You can check my chrome extension: https://chrome.google.com/webstore/detail/github-code-tree/caffoilocbbhnkdlpdcfanpbeholjdii

It helps me a bit for checking commits or pr's :) If anyone wants to contribute: https://github.com/picheli20/github-code-tree

picheli20 commented Jul 20, 2018

You can check my chrome extension: https://chrome.google.com/webstore/detail/github-code-tree/caffoilocbbhnkdlpdcfanpbeholjdii

It helps me a bit for checking commits or pr's :) If anyone wants to contribute: https://github.com/picheli20/github-code-tree

@s2t2

This comment has been minimized.

Show comment
Hide comment
@s2t2

s2t2 Jul 26, 2018

Array.from(document.getElementsByClassName('js-details-target')).forEach(function(element){element.click()})

s2t2 commented Jul 26, 2018

Array.from(document.getElementsByClassName('js-details-target')).forEach(function(element){element.click()})
@natron2244

This comment has been minimized.

Show comment
Hide comment
@natron2244

natron2244 commented Aug 1, 2018

+1

@lukehefson

This comment has been minimized.

Show comment
Hide comment
@lukehefson

lukehefson Aug 18, 2018

Hello all 🙋‍♂️. I'm a Product Manager at GitHub and I though you all might like to know that we just shipped this on the site. Thanks everyone for your continued feedback and support 😻

lukehefson commented Aug 18, 2018

Hello all 🙋‍♂️. I'm a Product Manager at GitHub and I though you all might like to know that we just shipped this on the site. Thanks everyone for your continued feedback and support 😻

@TPS

This comment has been minimized.

Show comment
Hide comment
@TPS

TPS commented Aug 19, 2018

@dalpert-korewireless @isaacs @cirosantilli If satisfied, close FTW? 🙇

@cirosantilli

This comment has been minimized.

Show comment
Hide comment
@cirosantilli

cirosantilli Aug 19, 2018

Collaborator

@TPS thanks for the ping.

@lukehefson if you or any other GitHub Staff finds such issues, you can @ mention me directly and I will close them for you.

Collaborator

cirosantilli commented Aug 19, 2018

@TPS thanks for the ping.

@lukehefson if you or any other GitHub Staff finds such issues, you can @ mention me directly and I will close them for you.

@lukehefson

This comment has been minimized.

Show comment
Hide comment
@lukehefson

lukehefson Aug 20, 2018

Thanks, @cirosantilli (and @TPS) that's great to know 😄!

lukehefson commented Aug 20, 2018

Thanks, @cirosantilli (and @TPS) that's great to know 😄!

@codesimplicity

This comment has been minimized.

Show comment
Hide comment
@codesimplicity

codesimplicity Aug 29, 2018

@lukehefson this is a good improvement but one thing that annoys me even more is that deleted files show up just like normal diffs. But from my point of view it is a huge difference if lines have been deleted from a file or if the file was deleted; for the latter I usually only need to know the file name (while it is good to still be able to see the old content).
Therefore I'd be very happy to see something like "Deleted: path/to/file" instead of the deleted lines; similar to the 'large diff' display but maybe taking less vertical space. It could behave like a collapsed file so you could open it if needed.
In a PR with a lot of deleted files this would dramatically reduce the number of lines to look at without collapsing anything.

I hope that makes sense for you as well.
I did not find any existing issue but this (though #587 mentions something similar).

codesimplicity commented Aug 29, 2018

@lukehefson this is a good improvement but one thing that annoys me even more is that deleted files show up just like normal diffs. But from my point of view it is a huge difference if lines have been deleted from a file or if the file was deleted; for the latter I usually only need to know the file name (while it is good to still be able to see the old content).
Therefore I'd be very happy to see something like "Deleted: path/to/file" instead of the deleted lines; similar to the 'large diff' display but maybe taking less vertical space. It could behave like a collapsed file so you could open it if needed.
In a PR with a lot of deleted files this would dramatically reduce the number of lines to look at without collapsing anything.

I hope that makes sense for you as well.
I did not find any existing issue but this (though #587 mentions something similar).

@lukehefson

This comment has been minimized.

Show comment
Hide comment
@lukehefson

lukehefson Aug 30, 2018

@codesimplicity This is great feedback and definitely something (or at least something similar) that we've got in mind!

lukehefson commented Aug 30, 2018

@codesimplicity This is great feedback and definitely something (or at least something similar) that we've got in mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment