Skip to content

Comments

Sort users in groups more consistently with Excel#648

Merged
axlewin merged 2 commits intomasterfrom
improvement/sort-users-like-excel
Oct 21, 2024
Merged

Sort users in groups more consistently with Excel#648
axlewin merged 2 commits intomasterfrom
improvement/sort-users-like-excel

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).
@codecov
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
@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