Force Mobile Homepage

Since this component has been marked broken, I put together a replacement that works with current Discourse versions: Mobile Latest Homepage

It avoids the deprecated site.mobileView entirely, using window.matchMedia for viewport detection and Ember’s service:router for the redirect. It also remembers the user’s last choice between Latest and Categories for the duration of their session, so navigating back to the homepage respects their preference.

Repository: GitHub - shortmort37/discourse-mobile-latest-homepage: A theme component that redirects mobile users to Latest instead of Categories on the homepage · GitHub

Tested on iPhone (lands on Latest), iPad landscape (two-column Categories+Latest unchanged), and desktop (unchanged).

4 Likes

great stuff … but really, in a perfect world we shouldn’t have to be loading one route and redirecting to another.

this is a layout issue now, not a route issue.

Instead, the approach I’ve been experimenting with is add a Categories column in a Bars left sidebar on Latest, which is absent on mobile.

So you load Latest on both devices, but the Categories column is simply missing on mobile :partying_face:

the solution is open source, but a bit unfinished and not documented. If you take a look at my github account, you might be able to find the pieces :wink:

3 Likes

Are you still maintaining this component? The topic seems not to exist anymore. :thinking:

The repo is online and was worked on 2 weeks ago.

I’m asking because I want/need to replace “Force Mobile Homepage”.

1 Like

@tshenry I’ve added some fixes to get this working again if you can approve & merge when you have a chance

3 Likes

Thank you! I’ve merged the fix and updated the OP a little.

I have such a hard time getting around to maintaining my personal components these days so I really appreciate the PR.

As an aside, @Moin I’m going to try very hard to get to reviewing and testing the PRs you’ve submitted on some of my other components ASAP. I’m really sorry it’s been taking ages.

2 Likes