Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-08-11 02:52:27

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,196
Website

Odd behaviour when toggling between two admin themes

affected: TXP 4.8.2 and TXP 4.9.0-dev

preliminary: install Sandspace theme if you haven’t (although it doesn’t really matter)

STR

  1. install the Japanese language pack and set it to be the front-end language.
  2. head over to the Preferences panel, Admin section
  3. change admin theme from Hive to another theme: Sand space or Hive (flat neutral) or…
  4. save

observe, after saving but without changing to another admin panel, a change of fonts in use for the Preferences > Admin panel.
(on my Mac, running macOS10.15, the font in use is now Hiragino Sans instead of San Francisco, aka system-ui; the font change is not noticeable when switching from Sand space to another theme, due to the way Sand space builds the font-stack )

view source, or inspect page, your will notice that the html tag now specifies lang="ja".

tested on localhost and on the TXP demo site.

annoyance level: mild, but might be less nice for people using AT – the change to the lang attribute might affect the voice / pitch / … used by their screen reader


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#2 2020-08-11 13:01:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: Odd behaviour when toggling between two admin themes

Good find. When switching admin theme we could maybe detect that and do a double-refresh (like we do when switching languages) so the change is total and immediate, instead of changing it and seeing the old theme on the Prefs panel until you navigate away.

I think that’s better UX all round, agree?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2020-08-11 13:06:02

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,196
Website

Re: Odd behaviour when toggling between two admin themes

Bloke wrote #325296:

I think that’s better UX all round, agree?

yes !


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2020-08-11 13:26:44

etc
Developer
Registered: 2010-11-11
Posts: 5,194
Website GitHub

Re: Odd behaviour when toggling between two admin themes

Should be fixed in 4.8.3, but yep, the immediate theme update would be nice.

Edit: actually, it was not really related to admin-theme switch but happened on prefs save.

Offline

#5 2020-08-11 13:37:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: Odd behaviour when toggling between two admin themes

etc wrote #325300:

Should be fixed in 4.8.3

Nice!

but yep, the immediate theme update would be nice.

Can we stash the ‘current’ admin theme as a hidden value in the prefs form, and check it on save? If it’s changed compared to the one just saved, trigger a full page refresh from the save step instead of letting it continue to fall through with the stale value intact? That way, we’re not always doing a double refresh on every save, only when the theme name changes.

Last edited by Bloke (2020-08-11 13:39:33)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2020-08-11 13:51:17

etc
Developer
Registered: 2010-11-11
Posts: 5,194
Website GitHub

Re: Odd behaviour when toggling between two admin themes

Bloke wrote #325301:

Can we stash the ‘current’ admin theme as a hidden value in the prefs form …?

Should we? It is already in $prefs and in db, just check it before prefs update?

Offline

#7 2020-08-11 14:10:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: Odd behaviour when toggling between two admin themes

etc wrote #325302:

Should we? It is already in $prefs and in db, just check it before prefs update?

D’oh, of course. That would also work and is way simpler!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2020-08-12 02:03:58

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,196
Website

Re: Odd behaviour when toggling between two admin themes

etc wrote #325300:

Should be fixed in 4.8.3, but yep, the immediate theme update would be nice.

And now with instant theme switching, lovely, thank you.

As far as I can tell, it works nicely so far.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB