Skip to content

[WebProfilerBundle] Improved the light/dark theme switching #41432

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

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

javiereguiluz
Copy link
Member

@javiereguiluz javiereguiluz commented May 28, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -

Note: I think this is a bug fix ... but maybe you prefer to consider it a new feature.


The current Symfony Profiler works like this:

  • If you don't set the theme, it selects it automatically form light/dark to match your OS
  • But you can also select "light" or "dark" explicitly

The problem is that when you choose a theme explicitly, the "auto" theme is no longer available. You need to delete the local storage of your browser.

This PR makes it explicit the "auto theme" already available in the Profiler. That way, you can set "light", "dark" or "auto" explicitly:

Captura de pantalla 2021-05-28 a las 11 01 21

It also changes the "theme listener" to respond instantly to OS changes, without having to refresh the page.

@OskarStark
Copy link
Contributor

I would go with a bugfix based on your explanation

@fabpot
Copy link
Member

fabpot commented May 31, 2021

The title says it all, it's an improvement, so this should target 5.4.

@javiereguiluz javiereguiluz added Feature and removed Bug labels May 31, 2021
@javiereguiluz javiereguiluz force-pushed the profiler_auto_theme branch from c93f986 to f5e19a1 Compare May 31, 2021 06:53
@javiereguiluz javiereguiluz modified the milestones: 4.4, 5.4 May 31, 2021
@javiereguiluz javiereguiluz changed the base branch from 4.4 to 5.4 May 31, 2021 06:54
@javiereguiluz
Copy link
Member Author

Rebased to 5.4. Thanks!

@javiereguiluz
Copy link
Member Author

Please, tell me if I should make any other change or improvement here. Thanks!

@fabpot fabpot force-pushed the profiler_auto_theme branch from f5e19a1 to a9fb853 Compare June 23, 2021 09:26
@fabpot
Copy link
Member

fabpot commented Jun 23, 2021

Thank you @javiereguiluz.

@fabpot fabpot merged commit 25c9bd3 into symfony:5.4 Jun 23, 2021
This was referenced Nov 5, 2021
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.

6 participants