10

In the Android app, left sidebar, there is an editable list of "Your Sites". In the editing pane, the sites are re-orderable (although awkwardly), and the order one places the sites in there is preserved, even after quitting the app and returning to this pane. One expects that order to be reflected in the "Your Sites" portion of the left sidebar when the editing pane is closed, but it is not.

I'm not sure what is determining the order of the sites in the left sidebar, it doesn't seem to be by date they were "pinned" into the list one wants to show, either.

| improve this question | | | | |
  • What was the order in which the sites were displayed? – user262481 Jun 21 '14 at 17:21
  • SO, Android Enthusiasts meta, meta SU, Theo CS meta, Math meta, Meta, Tex Latex meta... I have almost 20 of them. That's the top of the list shown in the sidebar. Is neither the order added, nor the order manually imposed, nor alphabetical. – dubiousjim Jun 21 '14 at 17:27
  • It is supposed to be ordered by reputation. I do not know what is going on. Perhaps someone more experienced can help you, not a mathematician like me! :-) – user262481 Jun 21 '14 at 17:33
  • It's not in my reputation order either. Thanks for prompting that observation. – dubiousjim Jun 21 '14 at 17:34
  • Sites below 200 rep are usually shown in random order. Are all these sites below 200 rep? – ChrisF Jun 21 '14 at 18:54
  • All of the ones I listed above besides SO are probably below 200, but other sites with higher rep occur later in the list. (What is the point of the reordering tabs in the editing pane if it doesn't determine the order in the side panel?) – dubiousjim Jun 21 '14 at 19:35
  • @ChrisF By default, sites above 200 rep are shown by decreasing rep, then the rest are shown alphabetically. The order can be customized (it couldn't in the first few months of the new top bar). I just installed the app, and it initially showed the default site list (decreasing rep). I tapped “EDIT”, which loaded the list I'd set up on the desktop site. After going back to the menu, I see the same thing as dubiousjum: the right selection of top sites, but in a random-looking order. – Gilles 'SO- stop being evil' Jun 21 '14 at 19:45
  • @SanathDevalapurkar Reputation is the default order, but it can be customized. dubiousjim and I have done that, and the app is showing our chosen top sites but not in the order we selected. – Gilles 'SO- stop being evil' Jun 21 '14 at 19:46
  • @Gilles Ah, didn't know that. Thanks! – user262481 Jun 21 '14 at 19:49
  • @Gilles - Ah. There is somewhere the sub 200 sites are shown randomly though. – ChrisF Jun 21 '14 at 20:31
  • This is in App version 1.0.42 – dubiousjim Jun 22 '14 at 10:44
4
+50

This is bizarre.

The bug only occurs if you set more than 10 sites. The reason is, the app sorts the order as string literal, not as a number. The order starts from "0" (treated as string).

When there are only 10 sites, the app shows the order correctly according to string sorting (i.e. character code: "0" < "1" < "2" < ... < "9"). However, when you add another site (i.e. 11th site), its order is "10", which is after "0" and before "1". (Naturally, it should be "0" < "1" < "10" < "11" < "2"; nevertheless, it's wrong to sort as string)

In the end, the app (as of current writing, v1.0.82 beta) will order the sites in this pattern:

0 10 11 12 ... 18 19 1 20 21 22 ... 28 29 2 30 31 32 ... 38 39 3 ...
| improve this answer | | | | |
  • Ha! This is exactly the problem as my screenshot. There is a method to the madness. – Caleb Feb 18 '16 at 6:04
3

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();
| improve this answer | | | | |
  • I see that this is now fixed on the android app, thanks for getting this out and making the menu more sane. – Joe W Apr 7 '16 at 13:30
0

The "Your Sites" list in the app is by default the 7 sites you have the most rep on, in order. If you edit them in the app, or edit them in the site, they will change their order (and persist it). Have you perhaps edited your sites list on the website? The same exact order of items in "Your Communities" when you tap on the Stack Exchange logo at the top right of any of our websites, are the items in the "Your Sites" list in the app.

| improve this answer | | | | |
  • 3
    I can confirm that app is not displaying the intended behavior when sites are custom sorted. Last attempt to post this comment also resulted in app crashing and permanent black screen upon restart, even if forced killed. Had to uninstall/reinstall to be able to use again. – dubiousjim Jun 24 '14 at 0:20
  • 1
    Had never custom sorted in website, and website did nor display either the order I had manually selected in app edit pane, nor the order shown in app sidebar. – dubiousjim Jun 24 '14 at 0:22
  • Editing order in website seemed to persist on website. But then I quit the android app and reloaded, and the app sidebar did not reflect that change. It may have reordered some other, unrelated site. Are others not seeing this erratic behavior too? – dubiousjim Jun 24 '14 at 0:24
  • @dubiousjim the app periodically checks with the site, but it force updates from the site's settings when you hit the "Edit" button, does that work for you? – Kasra Rahjerdi Jun 24 '14 at 0:29
  • No, it looks like the edit pane in the android app still displays the order I manually selected, which is different from the order displayed in android app sidebar, and different also from order displayed in website. – dubiousjim Jun 24 '14 at 0:31
  • 2
    Months later, the order in the app is still random (stable, but looks nothing like what I have on the site). I've edited the list a couple of times on the site; the set is updated in the app but the order remains unrelated. – Gilles 'SO- stop being evil' Nov 21 '14 at 1:48
  • Please see this answer as this is still a problem and the details of the bug have been found externally. – Caleb Feb 18 '16 at 6:02

You must log in to answer this question.

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