Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

@vanessayuenn vanessayuenn commented May 2, 2019

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 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
@vanessayuenn vanessayuenn requested a review from May 6, 2019
Copy link
Member

@smashwilson smashwilson left a comment

👍 LGTM!

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

@smashwilson smashwilson May 7, 2019

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
Member

@smashwilson smashwilson May 7, 2019

👍

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

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

@smashwilson smashwilson May 7, 2019

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

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

@smashwilson smashwilson May 7, 2019

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

}
}

async resolveUnresolveThread(thread) {
Copy link
Member

@smashwilson smashwilson May 7, 2019

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
14 checks passed
@vanessayuenn vanessayuenn deleted the vy/review-comments-grouping branch May 7, 2019
@smashwilson smashwilson added this to In progress in Sprint : 4 April 2019 - 8 May 2019 : v0.29.0 via automation May 8, 2019
@smashwilson smashwilson moved this from In progress to Merged in Sprint : 4 April 2019 - 8 May 2019 : v0.29.0 May 8, 2019
@smashwilson smashwilson mentioned this pull request May 8, 2019
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants