New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support dark mode and light mode syncing with OS theme setting #15975
Comments
I would like to work on this issue. |
Hi @kishore007k, happy new year! Are you still working on this issue or should I reopen it for someone else? |
hi @esethna I was working on this issue but now I've got my semester exams going on and it might take some time. So i can't working on this |
No problem @kishore007k, I will reopen the feature up for grabs |
I have some considerations according this issue and would know your opinion. Existing users who never changed themeFigma file states:
Can we ease this rule to this: Default setting for ‘Sync with OS appearance’: ? Not supported devicesWhen user has allowed theme sync, but opens application on other device which doesn't support it - how should we fallback? Use light theme? Store users' theme preferencesCurrently, theme is stored as serialized json in preferences table with I would add these new preferences "types":
Detect if theme is light or darkWhen user has custom theme and is switching sync on, we need to detect if theme is light or dark. My proposition: |
@komik966 yes if we can reliably know if a user has edited their theme then I think that's a great proposal. @hmhealey might have thoughts here
Yes I think light theme is a good fallback
I will refer to @hmhealey or @devinbinnie on this one, but your proposal sounds reasonable
Sounds reasonable to me unless dev has objections. @komik966 would you like me to assign this ticket to you! Thanks for the interest! |
Yes, please assign me to this ticket |
I'm rethinking how to store theme preferences and I'm seeing some defects in my proposal. I'll describe my thoughts soon. |
I'm not sure if this is what you were trying to fix, @komik966, but the proposal for storing the themes wouldn't quite work since we use the If we're defaulting to the light theme though for unsupported devices, we could continue to use the existing names for light themes and add
Alternatively, we could have two categories |
When writing first proposal, I wasn't aware of team-specific themes. If we continue to use My proposition is to deprecate
example value:
It feels easier to maintain one "atomic" theme preference. |
@hmhealey on the above if you have thoughts? |
I'd be worried that combining those all together would unfortunately cause problems. Working with a JSON object in Preferences can be tricky, particularly if we ever have to do a database migration since it's hard to work with JSON in the dataabase, and I'd also be worried that we might run out of space in the database column by putting all the themes together. Also, for compatibility, we'd need to maintain the old I like the idea of being able to update them atomically, but I think we can mostly achieve that even if they're in separate preferences. We already have to update multiple preferences at once with the current system for the team-specific ones, so we could continue to use that API to store the dark/light themes at the same time. As for storing the unsynchronized theme, I don't think we actually need to store it separately. When the user enables syncing, we can figure out if the unsynced theme is dark or light as you've suggested, and when the user disables syncing, I think we can just pick one of the themes and use that. If the user wants something different, they can change it before saving and closing their settings. The only time the unsynchronized theme will matter when the setting is enabled is if they're using an older client that doesn't support it, but I think it's still fine to just pick one of the light/dark themes (which will be the one stored in the |
@hmhealey Agree that json in db may cause problems.
|
Or maybe third option, without adding additional preference category: 🤔 |
Thanks @komik966. My thought is that it's fine as is to start and we can improve that separate from this scope of work. Excited that you've picked this back up, let us know if we can help. This is such a high impact change! |
@komik966 nice!!! |
scaled.mp4Webapp is implemented. Now, I'm testing edge cases and need to make minor fixes. Above screen recording shows how it works: theme switching, form synchronization across devices, modal window closing confirmation when we have unsaved changes. Things worth noticing:
|
@komik966 this is phenomenal work, SO stoked for this! |
The mobile app themes will be updated to match webapp with this ticket: https://mattermost.atlassian.net/browse/MM-37553 (not started yet) |
@komik966 will you be submitting a webapp PR for this as well? Let us know so we can consolidate our testing efforts cc// @jgilliam17 on the server and mobile PRs already submitted ^ |
@esethna Yes, I'll. But first I need to make requested changes to server because it results in changes to the webapp. |
Cool. @komik966 as long as the branch names are the same on the webapp and server PRs our test servers will pick up the changes together. We usually test the server and webapp changes together for features, so let us know if that works for you? |
Hi @laneycs, @esethna If you find it useful, feel free to use the work I've done so far. I hope that it will contribute to easier delivery of this feature :) |
Is there any news about supporting the synchronization of the theme with the operating system? |
Closing this issue as it is being worked on right now internally by @AshishDhama (for webapp/desktop), we may reopen the mobile tickets after that's complete |
So, there are several issues and tickets floating around about syncing dark/light mode with the os theme, but they all seem closed atm, with https://mattermost.atlassian.net/wiki/spaces/GLOAB/pages/2281046017/Settings+Revamp being said being the offender here for blocking this issue. |
@EtzBetz Thanks for your patience. Some bigger changes are happening right now, focusing on mono-repo, which will affect a lot of open PRs, and then there is focus on quality. That being said, there is another big effort going on to revamp UX of all the Modals, and this will be revamped with that effort, mostly next month. You will see this shipped with our 8.0 release if everything goes as it says in the plan. |
This ticket should be ready again for Help Wanted. |
Have these changes been made at this point? Is it safe to work on this feature without work getting thrown into the bin? And also, where do I start? I'm familiar with web dev etc., but mostly with angular and vue, not react. Could you give me a list of pointers what would need to be done? |
I would sincerely appreciate this feature. |
@afroeagle I couldn't wait for this feature so I installed the DarkReader browser extension on Chrome. It works nicely (even when Mattermost is in a chrome App). |
Summary
Other things to consider
Prototypes
Design File
Technical implementation notes:
If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
JIRA: https://mattermost.atlassian.net/browse/MM-23853
The text was updated successfully, but these errors were encountered: