Refined-github: Resolving comments

Created on 31 Jan 2018  路  20Comments  路  Source: sindresorhus/refined-github

With long threads on pull requests and issues, there's often feedback that you'd want resolve as either taken care of or no longer relevant.

GitHub will already collapse comments on diffs that have since been updated:

screen shot 2018-01-31 at 10 20 16 am

It would be awesome if we could mark any comment as "resolved" in order to clean up threads and make them easier to review later

New "resolve" button in dropdown menu
screen shot 2018-01-31 at 10 22 54 am
A resolved comment
screen shot 2018-01-31 at 10 34 44 am

In order to do this without an API from GitHub, I figure a convention could be used in the comment body.

Could you just add some tests?

#resolved

Refined GitHub could automatically collapse comments with #resolved in the body, and add a button to automatically edit the comment to tack on #resolved at the end.

Thoughts?

Please! 鈾ワ笌 enhancement help wanted under discussion

Most helpful comment

Alternatively, we could just save the comment ID as resolved in chrome.storage.local.

All 20 comments

I like it. Often when I come back to a PR for a second review, I feel I waste a lot of time rereading comments because I don't realize right away that they're already resolved.

Thanks for opening an issue here! This was previously discussed in #372 and marked as wontfix. Even though your suggestion could work, it would only work for teams where everyone is using the RG extension, but then external collaborators could be confused about the changed comment body.
I still don't think it's worth the hassle to handle all cases in RG.

it would only work for teams where everyone is using the RG extension, but then external collaborators could be confused about the changed comment body

I think it is acceptable that it'd only work for people with the extension and I don't think external collaborators would be that confused by it. But in case they are, there is another option: You can wrap the comment with <details>

<details>
 <summary>Comment marked as resolved by @thejameskyle</summary>
 <br>

Could you just add some tests?
</details>

Which appears as:



Comment marked as resolved by @thejameskyle

Could you just add some tests?


If Refined GitHub then wanted to add some UI around it, that would be really nice.

Alternatively, we could just save the comment ID as resolved in chrome.storage.local.

I'd be thrilled to have that, but it'd also be nice if you could communicate that you've resolved it with other people.

I usually add another comment that the above comment is resolved. Usually just saying "Resolved." or "Done." or "Addressed.".

We could just use that which would also send an email to the reviewer and we can collapse based on the comment body similar to how GitHub close/fix/resolve words work with issues.

That would break if there are 20 different comments in the thread and you want to mark one of them in the middle as resolved.

IMO this would need to be native to GitHub to have any sense. I'm not gonna mark a comment as "resolved" for my own later use. Sharing this info with others would likely require a whole GitHub app + storage. Either way I don't think this belongs to RGH

With long threads on pull requests and issues, there's often feedback that you'd want resolve as either taken care of or no longer relevant.

In a way this is already there, via reviews: anyone can leave positive/negative reviews and mark them as resolved or dismissed. If some feedback _needs_ to be addressed, it _should_ be sent as a review. The rest of comments are just bound to be lost to anyone who TL;DRs

Just to mention that I realise the pain of leaving an inline comment on the code which is addressed from a commit and then is not collapsed because the commit doesn't change that line. However, I also think handling that is better to be handled ultimately by GitHub or at least a dedicated extension.

  • I agree that GitHub should build this feature, but I'd say that about (almost) all of the features in Refined GitHub.
  • There are ways of implementing this without GitHub implementing it themselves.
  • I don't see why taking actions like editing comments is out of bounds for Refined GitHub,
  • The experience for people not using Refined GitHub is not degraded in any way
  • The experience for people not using Refined GitHub is improved if using the <details> strategy.
  • There is a clear problem that needs solving

The experience for people not using Refined GitHub is improved if using the <details> strategy.

Yeah, that solution would not need an external GH App and it could be easy to implement. However I'd rather not hide the comment in a details. Maybe some thing like:

Comment marked as resolved by @thejameskyle


old comment dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

I would be happy with that, but implementation-wise it may be a bit more complex to create a block quote with the same content maintained than to wrap it in <details>

The content inside <details> will render it exactly the same on GitHub as if it weren't wrapped in <details>:


<details>
  <summary>Click to expand</summary>

# old content

</details>


Click to expand

old content


I can't tell you what off the top of my head, but I'm fairly certain there are things that will render differently if they are inside of a block quote with >

Although it looks like you can use <blockquote> the same way as long as you leave those empty newlines:

<blockquote>

# old content

</blockquote >

old content


<blockquote>
# old content
</blockquote >

old content

That looks good. We could also do away with the blockquote altogether and just leave a line + <hr>

@jamiebuilds would you be able to send a PR? I see this as having two parts:

  • Buttons to edit a comment
  • Detecting+hiding resolving comments like in your mockup

I think this could work because maintainers can mark comments as resolved and everyone can see this.

@bfred-it doesn't the new GitHub feature also close #1154. Maybe?

Either way it wasn鈥檛 gonna happen, but yeah no off-topic comments can be collapsed.

Now that GH has released the ability to minimize comments, I think making the options a bit more accessible would be great. It takes 5 clicks to resolve a comment. I have opened a proposal here: https://github.com/sindresorhus/refined-github/issues/1396

GitHub has quietly rolled out a new Resolve conservation button, as mentioned here:

Based on this news, it seems that GitHub are aware of this shortcoming and are working to resolve it. Hopefully their next step will be to make it clearer in the UI which comments are resolved and which ones still need resolving, so that it can start to catch up with Gerrit. This would probably be good news for most of us, but bad news for their partners like https://reviewable.io/ though, who currently rely on this kind of feature to justify their existence. In the meantime, maybe refined-github could even implement that?

Was this page helpful?
0 / 5 - 0 ratings