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

Sort users in groups more consistently with Excel #648

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

jsharkey13
Copy link
Member

This isn't the right fix, which would involve using collations correctly and working out what language we wanted to sort using. But assuming most people are using Excel in English, this fixes the most common case where sort does not match; apostrophes in names. Just removing the character does not lead to a consistent sort, however, so it may be worth reviewing that if people notice.

This goes back to the in-place approach from the original PR, since comparator chaining like this is nicer.

Neaten the tests, add more test cases for the apostrophe cases.

This isn't the _right_ fix, which would involve using collations
correctly and working out what language we wanted to sort using. But
assuming most people are using Excel in English, this fixes the most
common case where sort does not match; apostrophes in names.
Just removing the character does not lead to a consistent sort, however,
so it may be worth reviewing that if people notice.

This goes back to the in-place approach from the original PR, since
comparator chaining like this is nicer.

Neaten the tests, add more test cases for the apostrophe cases.
This still won't help with names identical except in an apostrophe in
the first name, but that is both much less likely and would make the
sorting still more expensive to compute (because the comparators are
nested in reverse order).
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.16%. Comparing base (63de1a5) to head (ed7e0af).
Report is 11 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #648   +/-   ##
=======================================
  Coverage   34.15%   34.16%           
=======================================
  Files         520      520           
  Lines       23244    23246    +2     
  Branches     2849     2849           
=======================================
+ Hits         7939     7941    +2     
  Misses      14504    14504           
  Partials      801      801           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@axlewin axlewin merged commit bc90b39 into master Oct 21, 2024
3 checks passed
@axlewin axlewin deleted the improvement/sort-users-like-excel branch October 21, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants