Skip to content

Add functionality to expand all outdated comments at once #781

Closed

Description

@sgabler

Hey everyone, first comment in this repo, so wanted to give you a big "Thank You" first for creating this great extension!

What do you think of the following small tweak for pull requests:

  • when hovering over the "Show outdated" text, a small popup tells you "Hold shift while clicking to expand all comments"
  • when shift-clicking on the "Show outdated" text, all collapsed comments expand

image

Alternative implementation ideas:

  • Have a button/text next to "Show outdated"
  • Use a different button combination

Why? My team is currently in the habit of manually going through all outdated comments to make sure they were implemented correctly. Sometimes those comments are outdated because of code formatting or similar. We are currently using JS via a bookmark to achieve that functionality, but it would be really nice to have this in this extension.

Very happy to try implementing this myself, but I wanted to check if this is something you might be interested in.

Activity

  1. fregante commented on Oct 29, 2017

    @fregante
    Member

    I find myself doing this often too. I feel that we should tackle this and other similar toggles via keyboard shortcut, eg cmd+click=toggle all. No UI clutter necessary.

    Alternatively it could be alt+click to match macOS’ alternative behavior, and perhaps we could show the alternative actions while alt is held down i.e. all Show outdated become Show all outdated (macOS does the same)

  2. fregante commented on Oct 29, 2017

    @fregante
    Member

    #212 is related. Maybe pressing i also works in the discussione tab? I’m away from keyboard now

  3. sgabler commented on Oct 29, 2017

    @sgabler
    Author

    I didn't find anything and I think that Github doesn't provide that feature

    Here's a screenshot of the shortcuts displayed for the discussion page

    image

  4. laurenbrandstein commented on Aug 2, 2018

    @laurenbrandstein

    JS bookmark for recent Github redesign:
    javascript:Array.from(document.getElementsByClassName('outdated-comment')).forEach(l => l.setAttribute('open',true));

  5. jakesylvestre commented on Aug 22, 2018

    @jakesylvestre
  6. mgoveas commented on Oct 1, 2018

    @mgoveas

    To add to @laurenbrandstein solution, this worked for me
    javascript:Array.from(document.getElementsByClassName('outdated-comment')).forEach(l=>l.setAttribute('class','file js-comment-container has-inline-notes'));

  7. haridsv commented on Sep 30, 2019

    @haridsv

    @mgoveas I think the entire conversation needs to be unhidden and I have a few PRs where I have to meticulously scroll around to find these "hidden items" and click a few times and it is a pain.

  8. voppe commented on Jun 8, 2020

    @voppe

    2020 edition.

    Open all resolved:

    javascript:Array.from(document.getElementsByClassName("js-toggle-outdated-comments")).forEach(l => l.click());
    

    Click all "Load More":

    javascript:Array.from(document.getElementsByClassName("ajax-pagination-btn")).forEach(l => l.click());
    
  9. tekumara commented on Jun 22, 2020

    @tekumara

    thanks @voppe that worked!

  10. haridsv commented on Jul 3, 2020

    @haridsv

    The solution for "Load More" is too simplistic that only works for one level (I have PRs that nest at least 10 levels), so here is my better solution: https://stackoverflow.com/a/62711702/95750

    There are other solutions that I found later:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions