Optional mobile title switch component

theme-component

(Sam Saffron) #1

Repo link:

https://github.com/discourse/discourse-optional-title-mobile-header

Installation instructions: How do I install a Theme or Theme Component?

What this does?

This component makes the new Discourse 2.2 feature where header switches to mobile title optional for both users and sites.

When disabled per user prefs -> interface:

User will see the standard header unconditionally:

image

When enabled the behavior of “switch to title on scroll down” remains:

image

As an admin in the theme component section you can control if this is default off or on:

Current Caveats

  1. User setting is only persisted per device in local storage.

  2. User must reload site after changing setting

  3. Not properly localized or localizable.


I dislike the new mobile topic header behavior in 2.2.0.beta5
I dislike the new mobile topic header behavior in 2.2.0.beta5
I dislike the new mobile topic header behavior in 2.2.0.beta5
#2

Do hosted discourse instances have the option to install this component? I sent this to the admin of the site I use, but he’s having trouble getting the setting to show up for users.


(Joshua Rosenfeld) #3

There is no restriction on the use of this theme component (or any theme component) on hosted sites. I can take a look shortly.


(Viet Hoang) #4

To follow-up on @seanblue. The theme component installs without issue. I can see the component on the Theme list in Admin. We aren’t seeing the User > Preference > Interface option as seen in the quote.


(Joshua Rosenfeld) #5

Have you added the theme component to the active theme(s)? Theme components do nothing themselves unless they’re part of a theme.


(Viet Hoang) #6

Nope. I did not. Adding them to the active themes did it! Thanks for the assistance and education.


(Dylan Hunt) #7

Hmm, this doesn’t seem to be working, anymore.

I installed it fine, I see the component, I added it successfully to all themes >> Nada.

image


(Sam Saffron) #8

@david can you test this out?


(David Taylor) #9

@dylanh724 what issue are you seeing here? This theme does nothing on Desktop, so you’ll only see the new option on mobile.

Previously it was necessary to manually refresh the site for the setting to take effect, but I just fixed that.


(Dylan Hunt) #10

Users cannot select this in options because the field does not exist.
image

image


(David Taylor) #11

Are they looking for the setting on mobile, or on desktop? Are you able to share a link to the community?


(Dylan Hunt) #12

There’s also supposed to be an admin option, right?

Are they looking for the setting on mobile, or on desktop? Are you able to share a link to the community?

Tried both


(David Taylor) #13

I just signed up quickly, and I can see the setting in the user preferences on mobile:

Yep, that is located in the themes area. Find the page for the component, and then find the “theme settings” section at the bottom of the page. There’s a screenshot of it in the OP:


(Dylan Hunt) #14

I can’t see it all – I wonder if this only works for new accounts? There’s a friend helping me test and he can’t see the option, either. I’m testing desktop, he’s testing mobile.

I did, however, find the theme option within the component (thanks):
image


(David Taylor) #15

It definitely will not appear on Desktop. Is it possible that your friend has switched to Desktop view on his mobile?


(Dylan Hunt) #16

You keep saying this as if the option doesn’t show on desktop – or is this intended that you can only selection this OPTION when on mobile (rather than the event happening only on mobile, which I understand)?


(David Taylor) #17

Correct, you can only toggle the setting when using the mobile device. The theme component does absolutely nothing on Desktop.