-
Notifications
You must be signed in to change notification settings - Fork 225
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 channel names the same way as Zulip web #1165
Comments
Web's left sidebar has three headered groups: "Pinned", "Active", "Inactive", in that order. Within a group, non-muted channels come before muted ones. After that, sorting is done on channels' names with this compare function: // If we can, use a locale-aware sorter. However, if the browser
// doesn't support the ECMAScript Internationalization API
// Specification, do a dumb string comparison because
// String.localeCompare is really slow.
export function make_strcmp(): (x: string, y: string) => number {
try {
const collator = new Intl.Collator();
return collator.compare.bind(collator);
} catch {
// continue regardless of error
}
return function util_strcmp(a: string, b: string): number {
return a < b ? -1 : a > b ? 1 : 0;
};
}
export const strcmp = make_strcmp(); I assume the Dart doesn't have an analog of
|
Thanks, that's helpful! Yeah, I think using an ICU library via FFI is probably the full solution. That could be something we do ourselves once FFI support is more mature, as the Flutter roadmap calls for next year. Or it looks like people are working on building such a thing for everyone (and for the full scope of ICU functionality): (And that is indeed using FFI; here's the Dart code implementing In the meantime let's do this:
I'll file a separate issue for that nearer-term hack, and edit this issue to focus on the full solution. (Revising the plan I said above.) |
This part will also require essentially the same data, so I'll leave it out of the near-term issue. The emoji portion of the ordering is in CLDR here: We do have a separate plan to get a version of that emoji ordering data, from the server: So once we've done that, we might revisit the hack to use that information, if this issue for the full solution is still open. |
OK, filed: And I'll push this back to M7 Future. |
On the subscriptions / channels page, the sorting of channels by name doesn't fully match the behavior we have in the Zulip web app. In particular, we got a user report that names starting with an emoji are being sorted to the end, while they appear at the beginning in Zulip web.
We should match the ordering of Zulip web, so that people see their channels in the same order when they move between using Zulip on one platform vs. another.
If doing so exactly is impractical or difficult, then we should (a) do a hack that at least handles an emoji at the start of the name, matching Zulip web's ordering for emoji vs. non-emoji and for emoji vs. other emoji; and (b) file a follow-up issue for matching the ordering exactly.
Implementation
The name isn't the only key that the subscriptions / channels list is sorted by; it's also sorted by the channel's status as pinned and/or muted. The role of pinning and muting should remain unchanged.
This issue applies to everywhere a list of channels appears. That means:
The text was updated successfully, but these errors were encountered: