Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Group resolved comments #2117

Merged
merged 11 commits into from
May 7, 2019
Merged

Group resolved comments #2117

merged 11 commits into from
May 7, 2019

Conversation

vanessayuenn
Copy link
Contributor

Description of the Change

Screenshot/Gif

Kapture 2019-04-29 at 18 08 38

Alternate Designs

I experimented with using filter toggle but the user experience feels clunky, and with the current design, there isn't really a natural placement for the toggle.

Benefits

Resolved comments are moved out of the way, further encouraging the use of review comments as a to-do list behaviour model.

Possible Drawbacks

It might confuse users slightly when the resolved comment gets moved to another location. The highlighting should mitigate this confusion, but the problem can still exist for cases where there are many comments. However, the current implementation of collapsing comments immediately after resolving is probably just as confusing, so I don't see this feature making the experience worse.

Applicable Issues

#2078

Metrics

Tests

TBD: still working on them!

Release Notes

Group resolved review comments into its own list.

@codecov
Copy link

codecov bot commented May 2, 2019

Codecov Report

Merging #2117 into master will decrease coverage by 0.01%.
The diff coverage is 92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2117      +/-   ##
==========================================
- Coverage   92.65%   92.63%   -0.02%     
==========================================
  Files         207      207              
  Lines       12045    12040       -5     
  Branches     1764     1747      -17     
==========================================
- Hits        11160    11153       -7     
- Misses        885      887       +2
Impacted Files Coverage Δ
lib/controllers/reviews-controller.js 100% <100%> (ø) ⬆️
lib/views/reviews-view.js 87.8% <81.81%> (+4.57%) ⬆️
lib/containers/user-mention-tooltip-container.js 0% <0%> (-100%) ⬇️
lib/containers/issueish-tooltip-container.js 14.28% <0%> (-85.72%) ⬇️
lib/models/issueish.js 83.33% <0%> (-0.46%) ⬇️
lib/helpers.js 89.95% <0%> (-0.05%) ⬇️
lib/items/issueish-detail-item.js 98.36% <0%> (-0.03%) ⬇️
lib/items/changed-file-item.js 100% <0%> (ø) ⬆️
lib/views/issue-detail-view.js 100% <0%> (ø) ⬆️
lib/views/pr-detail-view.js 100% <0%> (ø) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a36da88...200dcc2. Read the comment docs.

@vanessayuenn vanessayuenn marked this pull request as ready for review May 6, 2019 20:18
@vanessayuenn vanessayuenn requested a review from a team May 6, 2019 20:18
Copy link
Contributor

@smashwilson smashwilson left a comment

Choose a reason for hiding this comment

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

👍 LGTM!

return {commentSectionOpen: true, scrollToThreadID: initThreadID};
}, () => {
setTimeout(() => this.setState({scrollToThreadID: null}), FLASH_DELAY);
Copy link
Contributor

Choose a reason for hiding this comment

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

I wish we had a way to collapse the setState updater functions from here and highlightThread into a single, atomic transaction. I'm pretty sure that's how it's working anyway and this is much cleaner but still 😛

return null; // shh, eslint
});
}
this.scrollToThread(scrollToThreadID);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -308,7 +299,8 @@ export default class ReviewsView extends React.Component {
return null;
}

const resolvedThreads = commentThreads.filter(pair => pair.thread.isResolved).length;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hah, should have called this resolvedThreadCount or something before. 👍

if (threadHolder) {
threadHolder.map(element => {
element.scrollIntoViewIfNeeded();
return null; // shh, eslint
Copy link
Contributor

Choose a reason for hiding this comment

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

I really need to make a RefHolder::forEach method to make these cases nicer...

}
}

async resolveUnresolveThread(thread) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We keep hitting situations where we need to name methods that toggle something without having a good word for the toggling action. There isn't really a good alternative for this:

  • resolveOrUnresolveThread()
  • toggleThreadResolution()
  • ... ?

@vanessayuenn vanessayuenn merged commit 20ebd0f into master May 7, 2019
@vanessayuenn vanessayuenn deleted the vy/review-comments-grouping branch May 7, 2019 14:16
@smashwilson smashwilson mentioned this pull request May 8, 2019
11 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants