refined-github icon indicating copy to clipboard operation
refined-github copied to clipboard

Add ability to collapse entire comments

Open banagale opened this issue 4 years ago • 8 comments

Description

  • In the top-right of a comment, add a chevron icon that lets you collapse a comment to just the title bar.
  • Preserver collapsed issue comments between pageloads

This is useful in issues where you need to reference only specific issues and are scrolling past intermediary ones.

This is not Hide Comment, which is used to hide comments from everyone. This is a convenience behavior.

I searched around and did not see that this exists yet, and I'm not seeing it somehow. If so, please point me at it.

Screenshot

image

I'd probably put this in the far right, despite the ellipsis begging to be the last item of a list.

Reason is, window management typically puts this minimize type behavior in the corner. Also I don't think its good jam something to the left of where the comment author is located.

Example URL

https://github.com/PostHog/posthog.com/issues/2018

banagale avatar Sep 23 '21 07:09 banagale

One more use case: https://github.com/mdn/content/pull/15112 Here, the bot adds a huge comment in every PR. Getting to the reviews requires a lot of scrolling.

Minimize all and expand all buttons would be really nice.


Till this gets implemented, I've created a Tampermonky script that minimizes and adds a Minimize button to such comments. https://gist.github.com/OnkarRuikar/c323f320b3c858bfac40e577e6b73802

demo

OnkarRuikar avatar Apr 23 '22 05:04 OnkarRuikar

Here, the bot adds a huge comment in every PR.

The bot is made by humans. Tell the humans to tell the bot to wrap it all in a details tag. The UX of that bot is currently atrocious by default.

fregante avatar May 03 '22 03:05 fregante

Tell the humans to tell the bot to wrap it all in a details tag.

The discussion is already underway. Use of the details tag and hide-comment-action has been suggested.

But it's been a long time, and I am afraid if the quorum is not reached they'll not make any changes. Also, every repo we contribute to may not want to change their practices.

@fregante can we add such a feature in refined-github, where we can provide user names in settings and their comments will be minimized?

OnkarRuikar avatar May 03 '22 03:05 OnkarRuikar

where we can provide user names in settings

We don't do feature settings, but we could extend e.g. dim-bots to matching comments. But would that make sense as a default for every user? Not sure about that.

cheap-glitch avatar May 03 '22 05:05 cheap-glitch

e.g. dim-bots to matching comments. But would that make sense as a default for every user? Not sure about that.

Mostly bot comments are tagged with <span class="Label Label--secondary">bot</span> label, e.g. example1, example2, example3. Can we use that?

OnkarRuikar avatar May 03 '22 06:05 OnkarRuikar

@OnkarRuikar your feature request is a nearly-exact duplicate of:

  • https://github.com/refined-github/refined-github/issues/1629
  • https://github.com/refined-github/refined-github/issues/2672

and it's not exactly what's being suggested here. I hid your comments for this reason.

See https://github.com/refined-github/refined-github/issues/2672 for a CSS-only alternative.

fregante avatar Aug 05 '22 09:08 fregante

This is useful in issues where you need to reference only specific issues and are scrolling past intermediary ones.

We can implement this feature as it's similar to easy-toggle-files and toggle-files-button, no extra UI necessary though, just click anywhere to toggle the list. We'd also need this piece of UI though:

  • https://github.com/refined-github/refined-github/pull/5653

fregante avatar Aug 05 '22 09:08 fregante

Thanks for keeping this issue alive. Some clarifying questions:

We can implement this feature as it's similar to easy-toggle-files and toggle-files-button, no extra UI necessary though, just click anywhere to toggle the list.

For reference, here's the UI behavior for easy-toggle-files.

I believe what you're saying is:

  1. Click anywhere in the timeline-comment-header class that is not an existing visible element. ~"the white space".
  2. Visibility of the (suspiciously potentially partially implemented) named edit-comment-hide class is toggled.
  3. Toggle state is maintained between page loads.

We'd also need this piece of UI though:

* [Make `toggle-files-button` unforgettable #5653](https://github.com/refined-github/refined-github/pull/5653)

I believe you're saying add this label:

label

But have the copy read, "Comment Hidden "

banagale avatar Aug 19 '22 18:08 banagale

Too many feature requests, realistically we’ll never get there. I’m closing those I think aren’t worth it.

fregante avatar Feb 16 '23 10:02 fregante

Okay. Thanks for the heads up. Maybe someday!

banagale avatar Feb 16 '23 22:02 banagale