Skip to content

Conversation

@ljmnoonan
Copy link
Contributor

Now you can either enable by user with Classic Theme Persistent setting, or toggle it on and off like dark mode. It uses a cookie to remember your preference between reloads.

Screenshots image image image

Toggle Hidden because Classic Theme Persistent turned on

image

@OCA-git-bot
Copy link
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@ljmnoonan
Copy link
Contributor Author

Closes #3234

@ljmnoonan ljmnoonan force-pushed the 18.0-web_theme_classic branch from 6122b17 to a9eb091 Compare December 16, 2025 00:41
Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature looks disabled by défaut. Or did i missed something ?

@ljmnoonan
Copy link
Contributor Author

@legalsylvain yes, I left the persistent option disabled by default so that the toggle on the user menu would be visible and individual users can make a choice whether to turn it on or not, and what mode to use.
I can change it though if you think it makes more sense to enable persistent mode for all users at install by default

@legalsylvain
Copy link
Contributor

@legalsylvain yes, I left the persistent option disabled by default so that the toggle on the user menu would be visible and individual users can make a choice whether to turn it on or not, and what mode to use.

Well, If someone install this module, he hopes that the feature will be enabled by default. Otherwise, it forces each user to enable it manually. So, yes, please put the value enabled by default. If user want to disable it, he can.
Don't you think ?

@ljmnoonan
Copy link
Contributor Author

@legalsylvain Yes, I see what you mean. I will change it

@ljmnoonan ljmnoonan force-pushed the 18.0-web_theme_classic branch from a9eb091 to 993fb6c Compare December 16, 2025 12:23
@ljmnoonan
Copy link
Contributor Author

@legalsylvain All set!

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks !

@ljmnoonan ljmnoonan force-pushed the 18.0-web_theme_classic branch 2 times, most recently from 6326de0 to 7681743 Compare January 14, 2026 21:22
@ljmnoonan
Copy link
Contributor Author

While working in web_dark_mode, I discovered that res_users_settings.py is already loaded into the user.settings object client side, so we can avoid an unnecessary orm call by using it. This means that persistent_classic_theme is just a related field in res_users.

I also updated the tests to HttpCase, which makes a lot more sense in this context

Now you can either enable by user with Classic Theme Persistent setting,
or toggle it on and off like dark mode. It uses a cookie to remember your
preference between reloads.
@ljmnoonan ljmnoonan force-pushed the 18.0-web_theme_classic branch from 7681743 to 3cfbe2e Compare January 15, 2026 10:03
@legalsylvain
Copy link
Contributor

While working in web_dark_mode, I discovered that res_users_settings.py is already loaded into the user.settings object client side

thanks. good to know.

@ljmnoonan
Copy link
Contributor Author

@jappi00 if you get some time, would you mind reviewing this PR?

@jappi00
Copy link
Contributor

jappi00 commented Jan 25, 2026

@ljmnoonan functional test looks good. Will look into the code now.

Copy link
Contributor

@jappi00 jappi00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Two little nitpicks 💃

This module allows each user to choose whether they would like input fields to be displayed the "classic" way or the new, standard way (as if this module were not installed)

To do this you can either:
+ Check "Classic Theme Persistent" in user preferences. This will enable the classic theme for that user across all devices.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should write "Uncheck" since you enabled the theme by default if the conversation in the pr is right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ofc: nitpick

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should stay "check" as writing "uncheck" would necessitate inverting the whole sentence. It's kind of odd describing a feature by what it doesn't do when it is turned off. The next line describes behavior when unchecked too.


# These fields should be here in order to be accessible via in js
# as user.settings.persistent_classic_theme
persistent_classic_theme = fields.Boolean(default=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: maybe add help for the note from the configure.md, something like: "When switching the theme all users need to reload the page to have a effect."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a pretty verbose tooltip defined in res_users.py, although it does not mention the need to reload. I'm hesitant to add this though as pressing "Save" from the view_users_form_simple_modif modal actually triggers a reload, so it is only in the context of view_users_form that this is relevant. Also, I think it is something that should be rather obvious to any user savvy enough to enable debug mode, which is necessary to see this option in the context of view_users_form in the first place.
If @legalsylvain thinks it is necessary too, I will add it

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ljmnoonan oh, clear!

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@ljmnoonan
Copy link
Contributor Author

@jappi00 Thank you for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants