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

Implemented locale-aware sorting for mention auto completion #1407

Closed

Conversation

vivekTiw120303
Copy link

@vivekTiw120303 vivekTiw120303 commented Mar 13, 2025

This PR improves mention auto-completion in Zulip-Flutter by implementing locale-aware sorting for usernames. Previously, usernames were sorted using a simple compareTo() method, which did not consider language-specific ordering. This update ensures that usernames are sorted correctly based on the user's language settings.

Changes Made:
✔ Implemented locale-aware sorting in compareByAlphabeticalOrder() using diacritic for accent normalization.
✔ Removed reliance on context for fetching locale and ensured sorting works dynamically.
✔ Updated _compareByRelevance() and _comparator() to correctly pass necessary data.
✔ Fixed initViewModel() to match superclass method signature.
✔ Updated autocomplete_test.dart to reflect new sorting behavior.

@chrisbobbe
Copy link
Collaborator

Thanks for the PR. This looks like it's for #1399. Please follow our guidelines about referencing the specific issue so it's clearly visible.

#1399 has the M6 Post-launch milestone, which means the core team isn't going to be able to spend time in the next couple of months to review or help with work on it. If you'd like to contribute to Zulip, see the guide in our README and the resources linked from there: https://github.com/zulip/zulip-flutter#picking-an-issue-to-work-on

Also, I've edited #1399 to add detail on how we plan to implement it. It requires some upstream work that hasn't happened yet, so isn't ripe to work on yet. So I'll close this PR. If you're interested in contributing to zulip-flutter, please choose a different issue.

@chrisbobbe chrisbobbe closed this Mar 13, 2025
@gnprice
Copy link
Member

gnprice commented Mar 13, 2025

In addition to the points Chris made above, @vivekTiw120303 you need to spend more effort reading your own changes and making sure they make sense before you ask others to review them.

This PR description lists five "changes made". Only one of those resembles any change that actually appears in the PR.

The description and the changes look like you used ChatGPT or another LLM in writing them. When you do that, you remain responsible for the work you're submitting.

@vivekTiw120303
Copy link
Author

vivekTiw120303 commented Mar 14, 2025

Sure sir, will keep in mind from next time

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.

3 participants