AtomMaterialUI / material-theme-issues

Issues Repository for the Material Theme UI plugin for JetBrains
Other
62 stars 4 forks source link

[Bug]: Custom themes completely broken on v9.2.1 #501

Closed JoeriThissen-Simplicate closed 3 months ago

JoeriThissen-Simplicate commented 3 months ago

Describe the bug

I am unable to configure any custom theme. When updating the plugin, my custom theme wasn't migrated at all. Now when I try to customise the colors, it keeps reverting back to the defaults.

This happens both in Datagrip and in PHPStorm.

To Reproduce

  1. Open settings
  2. Go to material custom theme
  3. Try to select your previously saved custom theme (from before the update). Nothing happens.
  4. Try to change colours manually. It ppears to work, but when you apply the settings, close the settings window and open it again, it reverts back to the defaults.

Expected behavior

Custom themes should be configurable and themes saved before the update should still work.

Material Theme Version

v9.2.1

IDE

PHPStorm, DataGrip

System Info

PhpStorm 2024.1
Build #PS-241.14494.237, built on March 27, 2024
Licensed to Joeri Thissen
Subscription is active until August 9, 2024.
Runtime version: 17.0.10+8-b1207.12 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.1.1
GC: G1 Young Generation, G1 Old Generation
Memory: 20000M
Cores: 10
Metal Rendering is ON
Registry:
  ide.balloon.shadow.size=0
  debugger.new.tool.window.layout=true
  run.processes.with.pty=TRUE
  ide.new.editor.tabs.vertical.borders=true
  ide.animate.toolwindows=true
  ide.experimental.ui=true
  ide.editor.tab.selection.animation=true
Non-Bundled Plugins:
  com.github.leomillon.uuidgenerator (4.5.1)
  com.godwin.json.parser (1.7.1)
  com.pyfips.intellij.custominspections (2.0.2)
  String Manipulation (9.12.0)
  Key Promoter X (2024.1.0)
  org.intellij.RegexpTester (2.2.0)
  ru.adelf.idea.dotenv (2024.1)
  com.kalessil.phpStorm.phpInspectionsEA (5.0.0.0)
  de.espend.idea.php.annotation (10.0.0)
  com.aurimasniekis.phppsr4namespacedetector (1.0.1)
  com.github.copilot (1.5.2.5345)
  com.chrisrm.idea.MaterialThemeUI (9.2.1)

Logs/Screenshots

No response

mallowigi commented 3 months ago

Can you provide your old custom theme xml file?

JoeriThissen-Simplicate commented 3 months ago

Hey, thanks for you reply!

I'm a bit tired and I'm currently unable to find the xml-files 🙈 I may be looking over something obvious. Do you know where they are stored on a mac?

I tried again just now, and it's partly working, sometimes. I've made a screen recording: https://www.youtube.com/watch?v=bp8yJoArblk

As you can see switching themes is not changing any of the preview colours in the settings window. And the themes - even default/bundled ones - are only partly applied to the UI. Different elements are skipped on every switch, it seems.

The problem does seem less obnoxious than when I first updated the plugin earlier today in both IDEs. Earlier this morning I couldn't get any colours to change in the UI when changing themes. It appears disabling the plugin for a bit and having a few restarts inbetween resolved something.

Here are some logs when I switch to a custom theme:

2024-04-23 22:08:39,454 [1714666]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2024-04-23 22:08:39,455 [1714667]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files
2024-04-23 22:08:40,489 [1715701]   INFO - #c.i.s.GitSettingsLog - Applying settings changes to branch ide: colors/_@user_Arc Dark _Material_.icls
2024-04-23 22:08:40,514 [1715726]   INFO - #c.i.s.GitSettingsLog - Advancing master@8401ee28. Need merge of ide@3439ea39 and cloud@8401ee28
2024-04-23 22:08:40,520 [1715732]   INFO - #c.i.s.GitSettingsLog - Merge of master&ide@3439ea39 with cloud@8401ee28: Merge of revisions 3439ea39fad965d1bfc67bddacffddeccf9d5992, 8401ee2835e782f94311786293c5417b371a8410 with base 8401ee2835e782f94311786293c5417b371a8410 using strategy recursive resulted in: Already-up-to-date. 
2024-04-23 22:08:40,738 [1715950]   INFO - #c.i.s.CloudConfigServerCommunicator - Pushing setting snapshot to the cloud config server...
2024-04-23 22:08:41,484 [1716696]   INFO - #c.i.s.SettingsSyncBridge - Result of pushing settings to the cloud: SUCCESS
2024-04-23 22:08:41,493 [1716705]   INFO - #c.i.s.GitSettingsLog - Updated position of cloud from 8401ee28 to 3439ea39: FORCED
2024-04-23 22:08:46,715 [1721927]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,715 [1721927]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,715 [1721927]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,715 [1721927]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,715 [1721927]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,715 [1721927]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,715 [1721927]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,716 [1721928]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,722 [1721934]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,723 [1721935]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,723 [1721935]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,723 [1721935]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,723 [1721935]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,723 [1721935]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,723 [1721935]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:46,723 [1721935]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,727 [1722939]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,728 [1722940]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,729 [1722941]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:47,729 [1722941]   WARN - #c.i.u.i.FilteredIcon - Do not create FilteredIcon for EmptyIcon
2024-04-23 22:08:54,082 [1729294]   INFO - #c.i.i.u.e.t.ExperimentalToolbarSettings - Dispatching UI settings change.
2024-04-23 22:08:54,150 [1729362]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.balloon.shadow.size' has changed to '0'
2024-04-23 22:08:54,151 [1729363]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.editor.tab.selection.animation' has changed to 'true'
2024-04-23 22:08:54,151 [1729363]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.new.editor.tabs.vertical.borders' has changed to 'true'
2024-04-23 22:08:54,151 [1729363]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.animate.toolwindows' has changed to 'true'
2024-04-23 22:08:54,151 [1729363]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'editor.distraction.free.mode' has changed to 'false'
2024-04-23 22:08:54,153 [1729365]   INFO - #c.i.i.u.e.t.ExperimentalToolbarSettings - Dispatching UI settings change.
2024-04-23 22:08:54,212 [1729424]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.balloon.shadow.size' has changed to '0'
2024-04-23 22:08:54,212 [1729424]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.editor.tab.selection.animation' has changed to 'true'
2024-04-23 22:08:54,212 [1729424]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.new.editor.tabs.vertical.borders' has changed to 'true'
2024-04-23 22:08:54,212 [1729424]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.animate.toolwindows' has changed to 'true'
2024-04-23 22:08:54,212 [1729424]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'editor.distraction.free.mode' has changed to 'false'
2024-04-23 22:08:56,952 [1732164]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.balloon.shadow.size' has changed to '0'
2024-04-23 22:08:56,952 [1732164]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.editor.tab.selection.animation' has changed to 'true'
2024-04-23 22:08:56,952 [1732164]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.new.editor.tabs.vertical.borders' has changed to 'true'
2024-04-23 22:08:56,952 [1732164]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'ide.animate.toolwindows' has changed to 'true'
2024-04-23 22:08:56,953 [1732165]   INFO - #c.i.o.u.r.RegistryValue - Registry value 'editor.distraction.free.mode' has changed to 'false'
2024-04-23 22:08:57,257 [1732469]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2024-04-23 22:08:57,257 [1732469]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files
2024-04-23 22:08:57,268 [1732480]   INFO - #c.i.a.o.PathMacrosImpl - Saved path macros: {}
2024-04-23 22:08:58,283 [1733495]   INFO - #c.i.s.GitSettingsLog - Applying settings changes to branch ide: options/colors.scheme.xml
2024-04-23 22:08:58,297 [1733509]   INFO - #c.i.s.GitSettingsLog - Applying settings changes to branch ide: options/laf.xml
2024-04-23 22:08:58,308 [1733520]   INFO - #c.i.s.GitSettingsLog - Applying settings changes to branch ide: options/material_theme_new.xml
2024-04-23 22:08:58,322 [1733534]   INFO - #c.i.s.GitSettingsLog - Advancing master@3439ea39. Need merge of ide@2a5cd36f and cloud@3439ea39
2024-04-23 22:08:58,326 [1733538]   INFO - #c.i.s.GitSettingsLog - Merge of master&ide@2a5cd36f with cloud@3439ea39: Merge of revisions 2a5cd36f25ab03b81343e81a998b80dae209cdc5, 3439ea39fad965d1bfc67bddacffddeccf9d5992 with base 3439ea39fad965d1bfc67bddacffddeccf9d5992 using strategy recursive resulted in: Already-up-to-date. 
2024-04-23 22:08:58,579 [1733791]   INFO - #c.i.s.CloudConfigServerCommunicator - Pushing setting snapshot to the cloud config server...
2024-04-23 22:08:59,066 [1734278]   INFO - #c.i.s.SettingsSyncBridge - Result of pushing settings to the cloud: SUCCESS
2024-04-23 22:08:59,067 [1734279]   INFO - #c.i.s.GitSettingsLog - Updated position of cloud from 3439ea39 to 2a5cd36f: FORCED

I also encounter another annoyance when working with custom themes, although I guess it's not directly related. If I enable a custom theme, then go to "Appearance & Behavior -> Appearance" to select an other theme, it keeps asking me if I want to activate the custom theme every time I click apply. I guess it's best to create a new issue for that one?

mallowigi commented 3 months ago

No no, you're mistaken... in the video you're showing that you're switching the Color Scheme of the custom theme, not the custom theme itself...

If you want to apply predefined presets, you can use the button with the three dots/gear at the top. But this will override your custom changes to use the predefined themes' colors.

As per your second question, this is due to a conflict of triggered events. You see, when you modify the custom theme, be it any color or the associated color scheme, it registers a flag to prompt you whether you want to activate the Custom theme (because it makes sense, since you edited it).

But then, once you have the custom theme enabled, it listens to another event: whenever the color scheme is changed (because a custom theme is not tied to a particular color scheme unlike other themes), the custom theme will modify it's associated color scheme. So for example if you are using the Custom Theme with the color scheme Darcula, if you switch to, say, Gradianto, it will register it, so if you switch to another Theme and go back to Custom Theme you'll get back the latest color scheme you chose.

So what happens here? You enabled the Custom Theme with whatever color scheme it is set in the settings page. But when you switch to another theme, before switching to that theme, it will first change the Custom Theme's color scheme to the scheme of that theme, and therefore the flag will activate that the custom theme's color scheme has changed. Then you press OK, the IDE will understand that the flag is ON, and that the current theme is NOT "Custom Theme" since you changed it, and thus, prompt you to change.

Normally if you reopen the settings and switch to another theme, it won't happen again, since you won't be currently using the Custom Theme, unless you go back to the Custom Theme Settings and change something again.

Hope it clears it up

JoeriThissen-Simplicate commented 3 months ago

So why are the colour schemes only partially being applied in my screen recording? That can't be intended behavior. And why do the colours in the settings panel not change with the preset I selected?

It's still unclear to me how this would be intended behavior. Your explanation hasn't really cleared it up for me 😅

If you look at the screen recording, the colour changes that happen to the UI are very clunky. It's pretty clear that not all colours of a colour scheme are being applied. Especially towards the end of the video.

So what happens here? You enabled the Custom Theme with whatever color scheme it is set in the settings page. But when you switch to another theme, before switching to that theme, it will first change the Custom Theme's color scheme to the scheme of that theme, and therefore the flag will activate that the custom theme's color scheme has changed. Then you press OK, the IDE will understand that the flag is ON, and that the current theme is NOT "Custom Theme" since you changed it, and thus, prompt you to change.

When I conciously switch to another non-custom theme, I simply do not expect that question tot pop up. Especially not repeatedly.

mallowigi commented 3 months ago

First of all, if you haven't read it yet, take a look at the official documentation: https://material-theme.com/docs/configuration/custom-themes/#color-scheme

I'll try to explain a bit better in the hopes it will help.

Color schemes are the colors that are applied to the editors, not to the App UI. In contrast, Themes are affecting the UI only, and not the editor.

Now when defining a theme, you can (but are not required to) associate the theme with a color scheme, so that both the UI and the Editors match. Most themes in the Marketplace do that, but not all. Some themes only provide a UI theme, and some only provide a Color Scheme.

But the Material custom theme are, well, custom. So they are not bound to a specific color scheme in particular, since they only affect the UI. As a result, the plugin provides an option to associate the custom theme with a color scheme of your choice, which is most likely something you configured yourself via the IDE settings in the Color Scheme Settings.

In your video, you first go to the Custom Theme Settings. There you are already having a custom theme defined, which is something Dark Blue apparently as seen in the color preview tiles.

Next, you are selecting a COLOR SCHEME in the list. That list displays all the color schemes found in your setup (as well as the modifications of the bundled color schemes), and you select the color scheme named "OLED" something.

When you pressed apply, first it asked you if you wanted to switch to the Custom Theme since you were on a different theme at that moment, and as I explained earlier, when you modify anything in the Custom Theme settings, it triggers a flag that will ask you whether you want to switch to it.

At that point everything works as expected, you have your bluish theme associated with the OLED color scheme that you can see a preview in the background.

But then you select another COLOR SCHEME, e.g. Material Volcano. Doing that will NOT change the CUSTOM THEME colors! It will just change the associated Color Scheme. And actually, it did. You can see in the background that the editor now is having the Material Volcano colors!

Then you go to Darcula, same thing.

Now if you DO want to change the CUSTOM THEME COLORS, you have to use the Gear button at the top, that's what it is for.


And regarding the other issue, I understand that it's a bit weird to being asked that. This is something that could be improved, I concur. But this is something we can live with, especially since people rarely change themes every day. Besides, the preferred way of switching theme is via the Quick Switch Window or the Material Theme Actions, and there is no popup there.

Hope that helps

Custom Themes - Material Theme UI Documentation
Create your own custom theme
JoeriThissen-Simplicate commented 3 months ago

Ah wow, thanks for the extensive reply.

I get you now. Part of the confusion for me is that I could have sworn I had both a color scheme and a custom theme named "OLED v2" before the update. I guess I misremembered, and it was only a colour scheme.

I'm still unsure as to why the custom theme I set up disappeared after the update, but I guess that's going to remain a mystery. Re-entering the colours manually has done the job now, and I've saved the xml just in case.

Anyway, thanks for your time and explanations here!