Skip to content

Let windows follow the toolbar visibility preference - #4460

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:toolbar-visibility-preference
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:toolbar-visibility-preference

Conversation

@vogella

@vogella vogella commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Workbench windows copied the coolbar and perspective bar visibility preferences into their persisted state when they were created, so the preference was read once and never again. A theme therefore had no reliable way to hide the main toolbar: a widget rule on the trim bar is re-imposed on every styling pass and makes Window > Appearance > Show Toolbar silently revert.

Now the persisted state holds a per-window choice only when the user toggles a window away from the preference, and that choice survives later preference changes; windows without one follow the preference at runtime. Themes can set the visibility through the existing preference channel with IEclipsePreferences#org-eclipse-ui-workbench:my-theme { preferences: 'coolBarVisible=false' 'perspectiveBarVisible=false'; }, where EclipsePreferencesHandler already arbitrates between theme and user values. Per-window toggling from bug 403461 keeps working. Values persisted by earlier versions are migrated, so a restored window does not pin a copied preference against the theme.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   864 files  ± 0     864 suites  ±0   51m 44s ⏱️ + 3m 31s
 8 411 tests + 7   8 169 ✅ + 7  242 💤 ±0  0 ❌ ±0 
21 102 runs  +21  20 425 ✅ +21  677 💤 ±0  0 ❌ ±0 

Results for commit 2872421. ± Comparison against base commit 0cf5104.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Legacy persisted visibility snapshots are misidentified as explicit overrides, preventing themes from controlling restored windows.

1 open finding
What changed in this PR

Updates workbench trim visibility so windows follow toolbar preferences while preserving explicit per-window choices.

Changes:

  • Reacts to toolbar and perspective-bar preference changes.
  • Persists only differing per-window choices.
  • Adds UI tests for preference-following behavior.
File Description
WorkbenchWindow.java Implements preference listeners and per-window overrides.
TrimVisibilityPreferenceTest.java Tests trim preference and override behavior.
InternalTestSuite.java Registers the new test class.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +2990 to +2994
String override = getModel().getPersistedState().get(key);
if (override == null) {
return preferred;
}
boolean visible = Boolean.parseBoolean(override);
WorkbenchWindow copied coolBarVisible and perspectiveBarVisible into the
window's persisted state at creation, so the preference was read once and
never again, and themes had no way to hide the toolbar.

The persisted state now holds a per-window choice only when the user
toggles a window away from the preference, and that choice survives later
preference changes. Windows without one follow the preference at runtime,
so themes can set both keys through the IEclipsePreferences CSS element.
Per-window toggling from bug 403461 keeps working. Values persisted by
earlier versions are migrated: a hidden bar stays a per-window choice, a
visible one was a copy of the preference and is dropped.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the toolbar-visibility-preference branch from 52e6cfc to 2872421 Compare October 9, 2026 05:28
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.

2 participants