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

Messy quick selection bar in contacts list #186

Open
7 tasks done
antodc opened this issue May 9, 2024 · 10 comments · Fixed by #292
Open
7 tasks done

Messy quick selection bar in contacts list #186

antodc opened this issue May 9, 2024 · 10 comments · Fixed by #292
Labels
enhancement New feature or request

Comments

@antodc
Copy link
Contributor

antodc commented May 9, 2024

Checklist

  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected app version

1.2.0

Affected Android/Custom ROM version

Android 11

Affected device model

Oscal C60

How did you install the app?

GitHub releases

Steps to reproduce the bug

I do not know whether the name is correct, but by 'quick selection bar' I mean the list of letters A-Z on the right side of the contacts panel

1 Unselect 'start name with surname' from preferences, if selected
2 Go to the contacts panel
3 Change the sort order to 'surname'
4 The quick selection bar gets messy

In addition, when selecting a letter from that bar you do not go to the first surname starting with that letter in the contact list but to the first name starting with that letter

Expected behavior

The quick selection bar should always go from A to Z in alphabetical order and should allow the user to jump to the first item starting with that letter according with the selected order mode

Actual behavior

The quick selection bar seems to report the letters in the order they first appear in the contact list.

For instance, my contacts are shown in the 'Name Surname' format. So, when they are sorted by surname, they look like

FirstName America
SecondName Brazil
ThirdName China
FourthName France
LastName Italy
...

and the quick selection bar looks like

F
S
T
L
...

So, if I want to jump to surname 'France' I have to find where the 'F' has been placed in that crazy order. Most importantly, if I push 'F' I am shown 'FirstName America' because it is the first item starting with 'F' although I would expect to go to 'FourthName France', as mny sort mode is by surname and that is the first item with a surname starting with 'F'.

Screenshots/Screen recordings

No response

Additional information

No response

@antodc antodc added bug Something is not working needs triage Issue is not yet ready for PR authors to take up labels May 9, 2024
@Aga-C Aga-C added enhancement New feature or request and removed needs triage Issue is not yet ready for PR authors to take up bug Something is not working labels May 9, 2024
Honk2 added a commit to Honk2/Phone that referenced this issue Jan 5, 2025
@Honk2 Honk2 mentioned this issue Jan 5, 2025
4 tasks
naveensingh added a commit that referenced this issue Jan 12, 2025
@antodc
Copy link
Contributor Author

antodc commented Jan 14, 2025

@naveensingh @Honk2 Thanks a lot to both for making this app better and better. In version 1.3.1 speed select letters are indeed ordered correctly (ie from A to Z) and work as expected when sorting by name or surname, but not if other sorting rules are chosen. In my case, when sorting by full name I get A-F-S-D-...
Maybe I misunderstood something, but I would expect those letters to remain always in the A-Z order and, when tapped, lead to the first item beginning with that letter according to selected criteria.

@naveensingh
Copy link
Member

I can reproduce it but only when sorting by date created. Full name seems to work fine.

@naveensingh naveensingh reopened this Jan 14, 2025
@naveensingh
Copy link
Member

But it doesn't make much sense for the index letters to be sorted alphabetically when the contacts are sorted by date. It seems valid for that case.

@antodc
Copy link
Contributor Author

antodc commented Jan 14, 2025

Do you have some contacts with a prefix? In my case I have some with "Doctor". So, I have "Doctor Name1 Surname1", "Doctor Name2 Surname2", and so on. When I sort by full name, the "doctors" are put in the "D group", say between David Something and Dwaine SomethingElse.

@antodc
Copy link
Contributor Author

antodc commented Jan 14, 2025

Assume the following contacts, where "Avv" and "Doctor" are prefixes. The full name sorting would be the following.

Anna Lastname
Avv Zorro Lastname
Barbara Lastname
Doctor Carl Lastname
Zanon Lastname

The speed letters would show up as A-Z-B-C, as they seem to reflect the first letter of the name (not the full name) in which the contacts are shown. So, in addition to be difficult to find the right letter, if I would tap "Z" I would go to "Avv Zorro Lastname", while I would expect to go to "Zanon Lastname".

@Honk2
Copy link
Contributor

Honk2 commented Jan 16, 2025

The problem is that all display/sorting functions use commons/src/main/kotlin/org/fossify/commons/models/contacts/Contact.kt getNameToDisplay. This functions adds the prefix to the full name, which is correct, but will result in the prefix treat as name to sort and not a name part to ignore for sorting. Instead we need a function like getFullName, that omits the prefix when sorting for full name. Also getBubbleText would need to use getFullName instead of getNameToDisplay and some other places.

@antodc
Copy link
Contributor Author

antodc commented Jan 17, 2025

For what it matters, I do not understand. If the prefix is part of the full name, as you also admit, it should be used when sorting by full name.

The issue is not the sorting of the contacts, which in my view is correct, but the sorting of the quick select letters, which is still based on the name while you are sorting by full name.

@antodc
Copy link
Contributor Author

antodc commented Jan 17, 2025

Just found another issue with the sorting. When one changes the option "Start name with surname" in the settings, the sorting mode is also changed (to "First name" or "Surname", depending on what you selected for "Start name with surname").

In my opinion, this is not the expected behaviour. The option "Start name with surname" in the settings should only change the way in which contacts are shown, not the way in which they are sorted. Appearance and sorting should be completely independent of each other.

@naveensingh @Aga-C If indeed the current behaviour is not the proper one, should I open a different ticket for this?

@naveensingh
Copy link
Member

Let's keep it here, I'll take a 'closer look' when I'm back to work on Phone.

@Honk2
Copy link
Contributor

Honk2 commented Jan 17, 2025

For what it matters, I do not understand. If the prefix is part of the full name, as you also admit, it should be used when sorting by full name.

It is quite easy. Lets talk about Gordon Freeman. He got a Phd in physics, so his full name to display is: Dr. Gordon Freeman.
But for sorting, he must be listed under G if sorted by firstname or under F if sorted by surname. But never under D. That is what is happening in this app. For full name he is listed as D but for the quick letters as G or F. That is the reason the letters get mixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants