Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

The list of Stack Exchange sites within more Stack Exchange communities are sorted in ascending order in the dropdown like below.

Enter image description here

Whereas in the Stack Exchange Android app, it is not sorted in ascending order.

First I thought it was sorted based on "live" and "beta" sites. But after scrolling down I found a few more "live" sites are in between the "beta" sites.

Here is a screenshot from the app.

Enter image description here

While writing this question I found the sort pattern is quite similar as of in all sites in Stack Exchange. But this doesn't make any sense in app.

Can we follow a common sorting approach in both site and app?

share|improve this question

The sites are currently displayed in the default order from the API call which is by site id.

It might make more sense to display them in alphabetic order like the websites. However I personally think searching on mobile devices is a bit more bothersome than searching on computers, so it might be better to leave it as is so that the most-used (AKA oldest) sites are higher up in the list before someone searches.

I'll be reading any comments that appear here closely to see what would be the best thing to do.

share|improve this answer
1  
You have filters for All/Main/Meta. Why not have sorting too? – mhlester Apr 7 '14 at 16:03
    
@mhlester maybe, i cant quite imagine how to display that without getting a confused UI though. – Kasra Rahjerdi Apr 7 '14 at 16:06
    
Yeah, me neither. Good luck! :-P – mhlester Apr 7 '14 at 16:06
    
The seemingly random order really bothers me and makes it especially hard to find sites by scrolling through the list. Ordering by an invisible ID is really bad UX. Please change this to a default alphabetic order. – atticae Dec 4 '14 at 15:49
    
Not to mention it's inconsistent with the way the sites are shown on the desktop browser (alphabetically). – atticae Dec 4 '14 at 15:50

The ordering preferences of "Your sites" left menu list on the app is saved as a number (the order that you have) concatenated with the name of the site, for example "1_meta", "0_stackoverflow" or "12_meta.gaming". The lowest order number is 0.

To order, that string is simply ordered, without taking in account that it should be ordered as numbers. When you order like that (and ignoring the site name part), for 13 items, instead of having an ordered list of "0 1 2 3 4 5 6 7 8 9 10 11 12" you get "0 10 11 12 1 2 3 4 5 6 7 8 9". That's because 0 < 10 < 11 < .. < 19 < 1 < 20 < 2, I mean, 10 is after 0, but before 1 and 20 would be before 2.

The problem only happens when you have more than 10 sites.

The answer was posted in a different question on this site “Your Sites” in Android left sidebar shown in unpredictable order, in this answer and it's a bug. Here's the full answer:

This will be fixed in 1.0.84.

Andrew's description was right on the nose. When preferences are saved, they are stored in a HashSet<String> (who knows why?) which would look something like this:

1_meta
9_hermeneutics
8_patents
10_coffee
2_math
11_photo
0_stackoverflow
4_bricks
12_meta.gaming
5_ja.stackoverflow
7_pt.stackoverflow
3_cooking
6_meta.ja.stackoverflow

A naïve Collections.sort was applied which gets us the incorrect ordering:

0_stackoverflow 10_coffee 11_photo
12_meta.gaming 1_meta 2_math 3_cooking 4_bricks
5_ja.stackoverflow 6_meta.ja.stackoverflow 7_pt.stackoverflow
8_patents 9_hermeneutics

Now instead I'm breaking the list into (int, String) pair, sorting by the index, and returning the name:

return Bite.from(siteNamesAndIndexes)
    .map(SiteIndexPair::new)
    .sortBy(SiteIndexPair::getIndex)
    .map(SiteIndexPair::getName).toArrayList();
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .