Skip to content

Add conversation-timeline-filter feature - #3847

Closed
shoter wants to merge 83 commits into
refined-github:mainfrom
shoter:master
Closed

shoter wants to merge 83 commits into
refined-github:mainfrom
shoter:master

Conversation

@shoter

@shoter shoter commented Dec 27, 2020 •

Copy link
Copy Markdown
Contributor
  1. LINKED ISSUES:
    Closes Toggle/Hide TimelineItem elements (e.g. added label etc) #3764

  2. TEST URLS:
    Use stages pipeline dotnet/aspnetcore#13040 - Contains all cases that I already found on github
    Multipart pipe reader dotnet/aspnetcore#28939 ( Multipart pipe reader dotnet/aspnetcore#28939 (comment) shows comment attached to review that is unresolvable as it is attached to comment from previous review)

  3. SCREENSHOT:
    (I already fixed top-bar display issue above unresolved comments)
    filter

  4. Description

Creates new functionality that let user filter not needed things on pull request timeline.
Can filter following things:

  • Unresolved comments (default: Show)
  • Resolved comments (default: Hide)
  • Normal comments (comment that cannot be resolved) (default: Show)
  • Commits (default: Show)
  • Other (default: Show)

Additionally to quickly see all things in given timeline it has option to auto load hidden items - by default off.
I tested it on Github and Github Enterprise.

It is my first time contributing to this repo so if there is code duplication or I do not adhere to some standard then please correct me to do things right :).

@shoter shoter changed the title feat: filter pull request timeline Filter pull request timeline Dec 27, 2020
@fregante

fregante commented Dec 27, 2020 •

Copy link
Copy Markdown
Member

I’m hesitant to accept large UIs, but this appears relatively compact for what it does and it could be a solution to #615 (but not by default).

Do you have time for the lengthy reviews that I expect on this bad boy? 😃 Some code can be dropped because we already have handlers/patterns for GitHub UI changes, some can be improved, and I think this could work better if implemented to look exactly like the label selector (a dropdown instead of a modal)

Comment thread readme.md Resolved
@fregante fregante self-assigned this Feb 12, 2021
@fregante

Copy link
Copy Markdown
Member

I shortened the labels a bit, all that text was hard to parse and understand.

Screen Shot 3

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding a new comment to test part of the feature

@fregante

Copy link
Copy Markdown
Member

@shoter as you can see above, the "special case" is actually well-marked by GitHub. In this case, I added a review with comment to a resolved conversation.

Please update the code accordingly (i.e. drop the "special case" and just detect it as a regular resolved/unresolved review comment)

@fregante

fregante commented Feb 12, 2021 •

Copy link
Copy Markdown
Member

There are a few more improvements to be made:

  • We should add a note at the bottom of the conversation to show that something is being hidden. You can refer to hide-useless-comments for the style/code. "Some events have been hidden. Show all"
  • I think the feature is relatively heavy and should not run on every single page load; i.e. Only call observe('.js-timeline-item' after the user makes the first selection. This may require a slight rethink/rewrite of the feature… 🤭

@fregante fregante removed their assignment Feb 12, 2021
@fregante fregante changed the title Filter pull request timeline Add conversation-timeline-filter feature Feb 12, 2021
}

// We need to hide whole thread group if we have hidden all comments inside.
hasVisibleElement = hasVisibleElement || !threadContainer.hidden;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think checking whether a whole review is resolved is easier than keeping track this way.

Before this loop you can probably just check “select.exists(unresolved review threads, item)”, and if not, just hide the whole item and return; No need to loop at that point.

@fregante

Copy link
Copy Markdown
Member

I'll rewrite the missing parts in a new PR. No worries, the idea is good, but it required/s a lot of work.

@fregante fregante closed this Feb 24, 2021
@fregante fregante mentioned this pull request Feb 27, 2021
2 of 3 tasks
@shoter

shoter commented Feb 28, 2021

Copy link
Copy Markdown
Contributor Author

@fregante Thanks for that. Lately I could not find some time to have more look into it. I hope it makes it into repo :).

@helmer

helmer commented May 18, 2021 •

Copy link
Copy Markdown

Looks extremely useful, how do I enable this, 3 months in?

EDIT: Nevermind, for some reason I thought this was a PR against GitHub and not a PR for browser plugin. Installed, works wonders, thanks for this @shoter!

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

Development

Successfully merging this pull request may close these issues.

Option to hide all resolved/outdated comments in the conversation view Toggle/Hide TimelineItem elements (e.g. added label etc)

4 participants