Don introduced the Desktop to Mobile View Banner theme component, designed to warn users on mobile devices who are accidentally viewing the site in desktop mode. The component provides a clickable link to switch to the mobile view, improving user experience. Heliosurge praised the component, while thoka suggested an automatic switch for narrow screens.
However, Roi raised concerns about maintenance, noting a deprecation notice regarding the use of the .hbs extension instead of .gjs. David clarified that Discourse no longer supports separate desktop and mobile views, rendering the component obsolete. Consequently, the topic was marked with the end-of-life tag. Don acknowledged this update, and Roi confirmed they had already removed the component from their site.
This theme component adds a warning banner on a mobile device if it’s using the desktop view.
A common issue can be where a user accidentally uses the site on desktop view while using a mobile device. It can catch people unaware, the site won’t work as expected, and it hurts their general user experience.
This banner will warn those users they’re using the desktop view on a mobile device and offer them a link to click on to quickly rectify it.
Is this component still maintained? I’m seeing this after upgrading Discourse today:
[THEME 9 'Desktop to Mobile View Banner'] DEPRECATION NOTICE: The file 'theme-9/discourse/templates/connectors/below-site-header/desktop-to-mobile-view-banner.hbs' uses the deprecated .hbs extension. Refactor it to use '.gjs' instead. [deprecation id: discourse.hbs-extension] [info: https://meta.discourse.org/t/398896]
Discourse no longer has separate desktop/mobile views, so I don’t think there’s a use-case for this component any more. Probably best to remove it from your site.
I’ll mark it end-of-life (please correct me if I’m wrong @don)