23

I can't work out how members of teams are ordered on the team's home page.

For example, if you look at the Charcoal team, there are 6 members. Here they are in order, with their names, IDs and join dates.

|  Username  |   ID    |        Join Date        |
|------------+---------+-------------------------|
| ArtOfCode  | 3160466 | May 21 '16 at 15:40:20Z |
| Yvette     | 3956566 | May 21 '16 at 15:44:38Z |
| hichris123 | 2581872 | Nov 09 '15 at 21:04:37Z |
| Undo       | 1849664 | Nov 09 '15 at 19:00:14Z |
| Andy       |  189134 | Nov 09 '15 at 19:43:35Z |
| ProgramFOX | 2619912 | Nov 09 '15 at 19:45:40Z |

If you can figure out what order those are in, you're doing better than I am.

5
  • 11
    Note that you don't appear first when I view it...
    – jonrsharpe
    May 21, 2016 at 16:25
  • I see yvette, artofcode, hicris, andy, undo, programfox
    – TZHX
    May 21, 2016 at 17:14
  • what is meant with team?
    – dhein
    May 23, 2016 at 11:53
  • @Zaibis the Teams beta feature. Follow the link for an example.
    – ArtOfCode
    May 23, 2016 at 11:54
  • 2
    You order the team members, they take about 6-8 weeks to dispatch. May 24, 2016 at 10:24

2 Answers 2

42

Users are sorted by "being the current user" and then by Last Access Date. Here's the code:

var members = t.Members
               .Where(tm => tm.User != null)
               .OrderBy(tm => tm.UserId != Current.User.Id)
               .ThenByDescending(tm => tm.User.LastAccessDate)
               .ToList();
5
  • 1
    What was the reasoning for sorting this way rather than, say, alphabetically or most recently joined?
    – TylerH
    May 24, 2016 at 1:44
  • 8
    @TylerH Pure speculation, but maybe because the most active would be the most reachable if you wanted to contact someone?
    – jpmc26
    May 24, 2016 at 6:36
  • 2
    @jpmc26 the most active isn't the same as the last active, don't you think ? May 24, 2016 at 8:43
  • 4
    @ThomasAyoub Most of the time, the people who were most recently on will be the most active people, simply by virtue of them being on the most. It's a "good enough" heuristic that avoids having to build an entire framework around analyzing the user's history of activity. It's a pretty good trade off, imo. ;)
    – jpmc26
    May 24, 2016 at 9:26
  • @jpmc26 It's my understanding that this is the most recent member to visit the Team page, not the most recent member to log onto the site. It would be a little more useful (though not much) if it were the most recent member to log into the site.
    – TylerH
    May 24, 2016 at 13:20
24

As rene pointed out in comments, it's ordered on the last seen timestamp. In the moment of writing it looks like this:

  • hichris123, last seen 9 mins ago
  • ArtOfCode, last seen 33 mins ago
  • Andy, last seen 37 mins ago
  • Undo, last seen 2 hours ago
  • Yvette, last seen 3 hours ago
  • ProgramFOX, last seen May 18 at 17:43

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