Skip to content

Use UserScope instead of ConfigurationScope for default theme#3875

Merged
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:use-userscope-for-default-theme
Apr 8, 2026
Merged

Use UserScope instead of ConfigurationScope for default theme#3875
vogella merged 1 commit intoeclipse-platform:masterfrom
vogella:use-userscope-for-default-theme

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Apr 8, 2026

Changes the default theme preference storage from ConfigurationScope to UserScope.

UserScope is more appropriate as it represents a per-user setting that roams with the user across installations, while ConfigurationScope is shared across all users of an installation.

Changes

  • E4Application.java: Read default theme from UserScope instead of ConfigurationScope
  • ViewsPreferencePage.java: Write default theme to UserScope instead of ConfigurationScope

Based on commit a7e91a0 which introduced the default theme feature.

The default theme preference is now stored in user scope instead of
configuration scope. UserScope is more appropriate as it represents
a per-user setting that should roam with the user across installations,
while ConfigurationScope is shared across all users of an installation.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Test Results

   852 files  ±0     852 suites  ±0   52m 13s ⏱️ - 2m 41s
 7 894 tests ±0   7 651 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 184 runs  ±0  19 529 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit 7d3d409. ± Comparison against base commit 06b47e7.

@vogella vogella marked this pull request as ready for review April 8, 2026 12:33
@merks
Copy link
Copy Markdown
Contributor

merks commented Apr 8, 2026

So all different rcp and ide applications and all installations of those can only have one theme and there is no possibility to specify otherwise? Is that really a good idea? It seems like a loss of flexibility and a source of conflicting needs doesn’t it?

@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Apr 8, 2026

So all different rcp and ide applications and all installations of those can only have one theme and there is no possibility to specify otherwise? Is that really a good idea? It seems like a loss of flexibility and a source of conflicting needs doesn’t it?

No, the override is possible per workspace, this has not changed.

@iloveeclipse
Copy link
Copy Markdown
Member

No, the override is possible per workspace, this has not changed.

Could you elaborate how this override works? Changed code seem to use only user scope?

@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Apr 8, 2026

The logic to use either a workspace specific theme or a default theme was added in 75599e0

During theme switch the user can now set the selected theme as default This setting is saved as configuration scope and loaded for new workspaces unless the user has a theme set for this specific workspace. Add 'Use as default theme' checkbox to theme restart dialog

And on commit a7e91a0 which introduced the default theme feature but I assume that was clear as it was in the PR description,

@merks
Copy link
Copy Markdown
Contributor

merks commented Apr 8, 2026

but I assume that was clear as it was in the PR description,

Imagine being on vacation getting 100 emails about all kinds of changes. After a while I think things are only clear to the email generators, which seem to produce higher volume with ever increasing frequency on so many different themes it feels like being on a freeway with oncoming traffic.

It still feels like having a theme preference shared across all different applications is not necessarily ideal, but I suppose users affected could choose not to use it, though it’s not as if one could unset the default once set. I just imagined that different products/applications could choose different defaults. I was not aware a default was not possible previously. I thought products could specify default. Hard to investigate from an iPhone.

@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Apr 8, 2026

@merks to give the full picture in short words:

Current situation: Theme can be set by workspace and via product customization (second one I guess, never used it).

New situation: During theme switch user can decide that the selected theme becomes the default theme for workspaces without an explicit theme set. Preference has a way to set or remove the default via a button (will be in tomorrows I-build) beside the theme selection.

image image

Examples:

10 workspace never set a theme, user selects dark theme as default -> all go dark
10 workspace with 5 of them set to rainbow theme, the other ones never touched, switch default to dark theme you end up with 5 rainbow themes and 5 dark themes)
New workspace would use default if set. Otherwise light theme which is selected by default if nothing is set as default (like always light theme is selected if nothing else is set, no change here)

@merks
Copy link
Copy Markdown
Contributor

merks commented Apr 8, 2026

In principle it has useful aspects, but I keep mentioning all kinds of diverse eclipse applications and your answers always sound like talking about the eclipse IDE.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR changes where the “default theme” preference is persisted and read, moving it from a shared installation-level scope (ConfigurationScope) to a per-user scope (UserScope) so the setting is user-specific and can roam with the user.

Changes:

  • Persist the chosen default theme ID into UserScope from the Views preference page.
  • Read the default theme ID from UserScope during workbench startup when no explicit theme argument/URI is provided.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java Writes the “use as default” theme selection to UserScope instead of ConfigurationScope.
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java Reads the default theme from UserScope instead of ConfigurationScope when no theme is provided via args/URI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +320 to 323
IEclipsePreferences userScopeNode = UserScope.INSTANCE
.getNode("org.eclipse.e4.ui.css.swt.theme");
String defaultThemeId = configurationScopeNode.get("themeid", DEFAULT_THEME_ID);
String defaultThemeId = userScopeNode.get("themeid", DEFAULT_THEME_ID);
context.set(E4Application.THEME_ID, defaultThemeId);
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

Switching the default theme preference from ConfigurationScope to UserScope will cause existing installations that already stored themeid in ConfigurationScope to silently fall back to DEFAULT_THEME_ID until the user re-saves the preference. Consider reading from UserScope first and falling back to ConfigurationScope when the key is absent (and optionally migrating/copying the value into UserScope) to preserve backwards compatibility.

Copilot uses AI. Check for mistakes.
@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Apr 8, 2026

Copilot suggest to add migration code, as this feature was only implemented yesterday I merge it now to avoid this migration need.

@vogella vogella merged commit f1a031a into eclipse-platform:master Apr 8, 2026
22 checks passed
@vogella vogella deleted the use-userscope-for-default-theme branch April 8, 2026 14:30
@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Apr 8, 2026

In principle it has useful aspects, but I keep mentioning all kinds of diverse eclipse applications and your answers always sound like talking about the eclipse IDE.

Ah, I did not see that comment. Must be the 100 email issue you mentioned. I think that is a valid concern. While the user may want to use the same theme for his Java IDE he may use a different theme for the C++ IDE.

Shall this theme default set by product or application?

@HannesWell
Copy link
Copy Markdown
Member

Shall this theme default set by product or application?

Per product is probably better since it reflects the 'branding' and users might not know that the product/app they are using is based on Eclipse.
And one application can be used by many products, e.g. the IDE-apllication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants