The current site may not be displayed in the sidebar
Expected behavior
We display a maximal number of SidebarView.displayedSiteLimit sites on the sidebar. The sites on the sidebar contains (in priority order) the current site, other recently used sites, and the rest of the user's sites.
Actual behavior
The issue with current implementation is SidebarView.displayedSiteLimit is hard-coded as exactly the same as RecentSitesService.maxSiteCount.
The current site may not be displayed if we change SidebarView.displayedSiteLimit to be a smaller number.
Steps to reproduce the behavior
- Change
SidebarView.displayedSiteLimitto be a number smaller thanRecentSitesService.maxSiteCount. - Make sure there are at least
RecentSitesService.maxSiteCountsites in a WP.com account. - Create a site named "Zoo" (any name that comes last in alphabetical order) in the WP.com account.
- Launch the Jetpack app and switch to a few different sites.
- Select the "Zoo" site.
- Open the sidebar, and check if "Zoo" is displayed in the sidebar.
Tested on [device], iOS [version], Jetpack iOS / WordPress iOS [version]
Thanks for reporting! 👍
That's a good point. I'd suggest changing RecentSitesService so that it doesn't artificially limited the number of most recent sites. It should be UI's job to determine how many to display.
I'm changing the tag to "Tech Debt" since there is no defect at the moment.