Skip to content
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

fix: update themeId settings after theme change #1988

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Mar 31, 2023

Motivation

In Theia, the current theme ID is not always in sync with the persisted workbench.colorTheme preference value. For example, one can preview a theme with the CtrlCmd+K + CtrlCmd+T key chords. The theme changes on quick pick selection change events, but the change is persisted only on accept (user presses Enter).

IDE2 has its way of showing and managing different settings in the UI. When the theme is changed outside the IDE2's UI, the model could get out of sync. This PR ensures that on workbench.colorTheme preference change, IDE2's settings model is synchronized with persisted Theia preferences.

The theme does not revert on interface scale change:

1987_01.mp4

The theme <select> reflects the current theme when the dialog is open:

  • Clicking OK in the settings dialog does not revert the theme:
1987_02.mp4
  • Clicking Cancel in the settings dialog reverts the theme:
1987_03.mp4
  • Previewing a theme but not selecting it does not change the theme <select> in the settings dialog:
1987_04.mp4

Change description

Other information

Closes #1987

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Mar 31, 2023
@kittaakos kittaakos self-assigned this Mar 31, 2023
Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

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

LGTM

@kittaakos kittaakos force-pushed the fix-update-settings-model-on-theme-change branch from a90a6c7 to cd43a75 Compare April 4, 2023 14:31
In Theia, the theme ID is not always in sync with the persisted
`workbench.colorTheme` preference value. For example, one can preview a
theme with the `CtrlCmd+K` + `CtrlCmd+T` key chords. On quick pick
selection change events, the theme changes, but the change is persisted
only on accept (user presses `Enter`).

IDE2 has its own way of showing and managing different settings in the
UI. When the theme is changed from outside of the IDE2's UI, the model
could get out of sync. This PR ensures that on `workbench.colorTheme`
preference change, IDE2's settings model is synchronized with persisted
Theia preferences.

Closes #1987

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos force-pushed the fix-update-settings-model-on-theme-change branch from cd43a75 to a431456 Compare April 13, 2023 12:39
@per1234 per1234 added the topic: theme Related to GUI theming label Apr 14, 2023
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks Akos!

@kittaakos kittaakos merged commit cb2a371 into main Apr 14, 2023
@kittaakos kittaakos deleted the fix-update-settings-model-on-theme-change branch April 14, 2023 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: theme Related to GUI theming type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IDE2's settings model gets out of sync from the persisted values of the Theia preferences
3 participants