Skip to content

Preview hidden comments - #1755

Merged
fregante merged 16 commits into
refined-github:masterfrom
dertieran:preview-hidden-comments
Feb 12, 2019
Merged

fregante merged 16 commits into
refined-github:masterfrom
dertieran:preview-hidden-comments

Conversation

@dertieran

@dertieran dertieran commented Feb 7, 2019 •

Copy link
Copy Markdown
Contributor

Fixes #1731

I'm not to sure if we should preview all type of comments (e.g. Spam, Abuse).
image

Also the preview is handled by css right now ("one line ellipsis").
image

Open for any improvements or features that could be added.

@dertieran

Copy link
Copy Markdown
Contributor Author

Implemented @bfred-it suggestions.

In #1731 there was also the suggestion to add the whole comment as a hover card.
I'm also not fully sure if it is that useful (it's just one click away 😄), but I will still explore it a bit.

@fregante

fregante commented Feb 9, 2019

Copy link
Copy Markdown
Member

add the whole comment as a hover card

No no the point of this feature is to just have comments visible at a glance. No need to complicate it with hover cards 👍

Comment thread source/content.css Resolved
@dertieran

dertieran commented Feb 9, 2019 •

Copy link
Copy Markdown
Contributor Author

Okay, now this also works for discussion comments and review comments in commits.
E.g. in PR Conversation, PR Files or Commits.

I also detected a style issue cause by a .bg-white selector on .review-comment-contents.
image

I also ditched the idea of using the hovercard to preview the comment.
We would need to position it correctly and everything and as @bfred-it correctly mentioned it will over complicate this feature.

And sorry for the bad code in 1d571e3, I should have done it the next day 😄

Comment thread source/content.css Resolved
@fregante

fregante commented Feb 11, 2019 •

Copy link
Copy Markdown
Member

I changed to use “ — “ instead of “: “ because with these previews it looks a bit busy. The dash helps give it a little more space.

screenshot 2019-02-11 at 11 21 50

@fregante

fregante commented Feb 11, 2019 •

Copy link
Copy Markdown
Member

The last issue is deferred resolved review conversations:

They're loaded later and are not currently affected by this feature. Can you look into GitHub's code to see if they fire any events when loading the conversation?

@dertieran

Copy link
Copy Markdown
Contributor Author

Okay I found out that they are loaded via an include-fragment-element.

So it should be easy to add an load listener to them.

Not to sure which parent selector I should use though, right now I would use details.outdate-comment > include-fragment and add it to on-new-comments.ts

Not sure if there are other comments that are loaded that way, but I think it could be easily extended.

@fregante

Copy link
Copy Markdown
Member

Oh, does that actually work? If so, do the events bubble up? i.e. can we use a single delegated load event listener?

@dertieran

dertieran commented Feb 12, 2019 •

Copy link
Copy Markdown
Contributor Author

Oh, does that actually work?

Yes 😄
Took me a while to find it because they preload it when you hover the details element.

If so, do the events bubble up?

Thought about that too, but the event isn't initialized with "bubbles".

Comment thread source/libs/on-new-comments.ts Resolved
@fregante
fregante merged commit b23ddfb into refined-github:master Feb 12, 2019
@fregante

Copy link
Copy Markdown
Member

Awesome new feature! Thanks @dertieran 🍰

@dertieran
dertieran deleted the preview-hidden-comments branch February 12, 2019 11:02
@dertieran

Copy link
Copy Markdown
Contributor Author

🎉 Thanks @bfred-it for helping out and getting this merged so fast.
It was a lot of fun digging into Github's code. 🤓

@fregante fregante mentioned this pull request Mar 30, 2019
@fregante fregante mentioned this pull request Jun 22, 2020
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.

2 participants