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

Redesigning the sorting toolbar #618

Merged
merged 27 commits into from Apr 9, 2019

Conversation

chel-seyy
Copy link
Contributor

Fixes #601

There are many sorting and grouping options for users to choose from, 
e.g. group by author/repo/none, sort by name/repo/contribution.

When grouped by repo, sorting is done within the group. Whereas, when 
grouped by none, sorting is done without any group.

Let's make it clearer for users to choose each sorting option (within
groups or by groups) by having 2 drop-down select menus.

Contribution and variance is not allowed for sorting by repos/author, because additional methods are required to add up the total contribution/variance for each group. Perhaps this can be continued from #486?

Note: Name sorting is performed on usernames, not display names.

@chel-seyy chel-seyy requested a review from a team March 23, 2019 09:44
Copy link
Member

@fzdy1914 fzdy1914 left a comment

Choose a reason for hiding this comment

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

image
The block is not long enough

Copy link
Member

@fzdy1914 fzdy1914 left a comment

Choose a reason for hiding this comment

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

image

Why do we have a sort within group by repo/branch when group by none and sort group byrepo/branch ?

Copy link
Member

@fzdy1914 fzdy1914 left a comment

Choose a reason for hiding this comment

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

image
This part should have reverse too if you decided to delete reverse checkbox.

@chel-seyy
Copy link
Contributor Author

Why do we have a sort within group by repo/branch when group by none and sort group byrepo/branch ?

To make it clearer, I have disabled sort within group by.

This part should have reverse too if you decided to delete reverse checkbox.

Reversed options are already available here:
image

@chel-seyy chel-seyy requested a review from a team March 23, 2019 14:30
@chel-seyy chel-seyy requested review from a team and removed request for a team March 26, 2019 06:02
Copy link
Member

@eugenepeh eugenepeh left a comment

Choose a reason for hiding this comment

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

Looks good to me,

Just wondering, is there a way where the option model can directly set the isSortingDesc etc?

@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #618 into master will increase coverage by 1.44%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #618      +/-   ##
============================================
+ Coverage     79.44%   80.89%   +1.44%     
+ Complexity      553      545       -8     
============================================
  Files            71       68       -3     
  Lines          1868     1795      -73     
  Branches        199      190       -9     
============================================
- Hits           1484     1452      -32     
+ Misses          287      249      -38     
+ Partials         97       94       -3
Impacted Files Coverage Δ Complexity Δ
src/main/java/reposense/git/GitLog.java 88.88% <0%> (-5.23%) 1% <0%> (-1%)
src/main/java/reposense/system/CommandRunner.java 69.23% <0%> (-1.61%) 5% <0%> (+2%)
...osense/git/exception/InvalidFilePathException.java
src/main/java/reposense/util/SystemUtil.java
src/main/java/reposense/git/GitLsTree.java
src/main/java/reposense/report/RepoCloner.java 63.15% <0%> (+4.42%) 10% <0%> (ø) ⬇️
src/main/java/reposense/git/GitClone.java 60.86% <0%> (+5.69%) 3% <0%> (ø) ⬇️
src/main/java/reposense/git/GitUtil.java 97.14% <0%> (+5.76%) 13% <0%> (-6%) ⬇️
...main/java/reposense/authorship/model/FileInfo.java 70% <0%> (+6.36%) 9% <0%> (ø) ⬇️
src/main/java/reposense/util/StringsUtil.java 90% <0%> (+20.76%) 6% <0%> (ø) ⬇️

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 fed3758...bf8d971. Read the comment docs.

@chel-seyy chel-seyy requested a review from a team March 27, 2019 06:18
@chel-seyy chel-seyy requested a review from a team April 1, 2019 09:37
@chel-seyy chel-seyy requested a review from a team April 4, 2019 06:12
@chel-seyy chel-seyy requested a review from eugenepeh April 4, 2019 07:29
}
},
getOptionWithOrder() {
[this.sortingOption, this.isSortingDsc] = this.sortGroupSelection.split(' ');
this.isSortingDsc = this.isSortingDsc === 'dsc';
Copy link
Member

Choose a reason for hiding this comment

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

doesn't seems very nice to reassign the variable to become boolean.
Would something like this work?

name and name dsc

if just name, the this.isSortingDsc will automatically be null,
hence can just use if (this.isSortingDsc) to do the logic check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that will be much simpler.

@chel-seyy chel-seyy requested a review from eugenepeh April 4, 2019 13:41
option(value="totalCommits", v-if="filterGroupSelection === 'groupByNone'") &uarr; contribution
option(value="totalCommits dsc", v-if="filterGroupSelection === 'groupByNone'") &darr; contribution
option(value="variance", v-if="filterGroupSelection === 'groupByNone'") &uarr; variance
option(value="variance dsc", v-if="filterGroupSelection === 'groupByNone'") &darr; variance
Copy link
Member

Choose a reason for hiding this comment

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

just noticed this.

It seems that variance and totalCommits are only enabled when authors wasn't grouped.
Was this the supposed functionality?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally intended to continue off from #486, but I can implement it here as well. Is sorting by variance is taken at average?

Copy link
Member

Choose a reason for hiding this comment

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

Originally intended to continue off from #486, but I can implement it here as well. Is sorting by variance is taken at average?

I see. I guess we can continue in #486.

Copy link
Contributor

@ongspxm ongspxm left a comment

Choose a reason for hiding this comment

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

minor nits

frontend/src/static/js/v_summary.js Show resolved Hide resolved
@chel-seyy
Copy link
Contributor Author

@eugenepeh can this be merged soon, to continue with #486?

@eugenepeh
Copy link
Member

eugenepeh commented Apr 9, 2019

Nits to the proposed message:

When the ramp charts are grouped together, the sorting is only
performed within the group. This may differs from the expectation of
some users, who may wish to sort them by groups e.g. to list them
accordingly to the group's combined contribution. 

Also, the `reverse` option is not well-presented nor intuitive to the
users enough to understand that it is meant to reverses the sorted
listing. 

Let's fix the mentioned problems by adding another drop-down select
menu to allow the sorting of groups, and include direction arrows in
menu items to replace the need of reverse option.

Note that you should mention the problems more precisely.

@eugenepeh eugenepeh merged commit b8033c1 into reposense:master Apr 9, 2019
eugenepeh pushed a commit that referenced this pull request Jun 16, 2019
Unused code was found in v_summary.js; specifically code associated
with the variable, filterSortReverse. They are remnants left behind by
the improvement of sort controls introduced in #618.

The unused code was originally bind to the reverse checkbox in the
older version of RepoSense. As the checkbox was replaced by the
introduction of ascending and descending options in #618, the code is
now unused and redundant. This is also partially due to the complexity
brought upon by new sorting group, the reversing has to be done within
the code of descending's logic, rendering those code not reusable.

Let's remove the unused code associated to the variable, 
filterSortReverse and it's implementations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants