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

More consistent ordering of autocomplete results #237

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

redrun45
Copy link
Collaborator

@redrun45 redrun45 commented Aug 4, 2024

As discussed with admins (and with thanks to Peter/TheBanjo for suggesting it), this adjusts the order of autocomplete suggestions. This seems small enough to go live. 👍

  • Pseudonyms are now properly sorted (an edge case remains when both the "real" name and pseudonym are suggested at once)
  • We ignore leading spaces, for the purpose of sorting
  • We sort by firstname, lastname in most cases. We reverse that order when searching by first name only.

In case someone's leery of COALESCE(), I can confirm that it does NOT mix separate data rows here. It returns the first not-null argument that is fed to it, as it is run on each individual row.
For example, if I were to call COALESCE( A, B ) on a table like this:

A B
null 1
2 null
3 4

...then the result would be this:

Result
1
2
3

No fear of mixing the rows!

- Pseudonyms are now properly sorted (an edge case remains when both the
    "real" name and pseudonym are suggested at once)
- We ignore leading spaces, for the purpose of sorting
- We sort by firstname, lastname in most cases.  We reverse that order
    when searching by first name _only_.

Co-authored-by: peterjdann <[email protected]>
@redrun45 redrun45 linked an issue Aug 4, 2024 that may be closed by this pull request
@notartom notartom merged commit 4322428 into LibriVox:master Aug 4, 2024
1 check passed
@redrun45 redrun45 deleted the author-autocomplete-ordering branch August 4, 2024 19:29
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.

Be able to narrow down the author choice in Template Generator
2 participants