Desktop to Mobile View Banner

AI-generated summary

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.

:information_source: Summary This theme component adds a warning banner on a mobile device if it’s using the desktop view.
:eyeglasses: Preview Theme Creator
:hammer_and_wrench: Repository GitHub - VaperinaDEV/desktop-to-mobile-view-banner · GitHub
:question: Install Guide How to install a theme or theme component
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Hello :wave:

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.

There is a setting to change the desktop icon and translation (HTML format allowed) to change the text…

11 Likes

Very nice, thank you.

1 Like

Would it be possible to change to mobile view on narrow screens view without user action?

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)

3 Likes

Absolutely, thanks David!

Okay great thank you!

Already did! :smiley:

2 Likes