-
Notifications
You must be signed in to change notification settings - Fork 293
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
Fixed changing background image based on light/dark theme #8744
Fixed changing background image based on light/dark theme #8744
Conversation
packages/renderer/src/lib/recommendation/ExtensionBanner.svelte
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screencast.from.2024-09-04.16-34-14.mp4
When trying to very quickly change the theme, I am able to have some opposite result
The podman-desktop/packages/renderer/src/lib/recommendation/ExtensionBanners.svelte Lines 11 to 15 in aba56f0
|
6db3c75
to
76a3160
Compare
@axel7083 try it now! |
We might need to either, get the |
The listener would be probably good, now it should get the boolean value each time user enters the dashboard |
it looks like ApperanceUtil isDark or getTheme should be removed and it should be a state (v5) or store v4 being updated/refreshed when configuration is changing |
The ApperanceUtil is doing some hacky stuff to determine the theme
Looking at the api of MediaQueryList there is a But since we are using a configuration value (light / dark / system), we might want to deprecate the AppearanceUtil and have a store as suggested by @benoitf |
Should I convert it to v5 then? I've done something like this 6db3c75 |
This comment was marked as off-topic.
This comment was marked as off-topic.
76a3160
to
3339c8d
Compare
There would be a need to improve system change detection (similar problem in MonacoEditor) |
3339c8d
to
320efb2
Compare
</script> | ||
|
||
{#each $extensionBannerInfos as banner (banner.extensionId)} | ||
<ExtensionBanner banner={banner} isDark={$isDark} /> | ||
<ExtensionBanner banner={banner} isDark={isDarkTheme} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand svelte reactivity, it seems to me that the changes in this file are not necessary, we are just adding a layer of reactivity.
(and testing without these changes, it works the same)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thank you, I thought that I've forgot to use subscribe here
6d9acd0
to
68f1dd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice to see using also the new svelte5 syntax
Signed-off-by: Evzen Gasta <[email protected]>
68f1dd3
to
09918d1
Compare
What does this PR do?
Fix changing background image based on light/dark theme
Screenshot / video of UI
Screen.Recording.2024-09-04.152535.mp4
What issues does this PR fix or reference?
Close #8526
How to test this PR?
Switch between light/dark theme and check if the recommendation banners reflect the change