Skip to content

Let windows follow the toolbar visibility preference - #4460

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:toolbar-visibility-preference
Oct 13, 2026
Merged

vogella merged 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

   867 files     867 suites   47m 17s ⏱️
 8 447 tests  8 205 ✅ 242 💤 0 ❌
21 219 runs  20 536 ✅ 683 💤 0 ❌

Results for commit f23ad41.

♻️ 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.

@vogella
vogella force-pushed the toolbar-visibility-preference branch 2 times, most recently from 2872421 to 1ac5c78 Compare October 9, 2026 14:45
@vogella
vogella requested a balanced review from Copilot October 9, 2026 14:45

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.

🟢 Approval recommended

The implementation is focused, lifecycle-aware, and adequately covered by UI tests.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

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. This relies on the
platform default being visible; a product that ships the bar hidden by
default gets its restored windows pinned hidden.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the toolbar-visibility-preference branch from 1ac5c78 to f23ad41 Compare October 13, 2026 04:49
@vogella
vogella merged commit 860a77e into eclipse-platform:master Oct 13, 2026
18 checks passed
@vogella
vogella deleted the toolbar-visibility-preference branch October 13, 2026 11:05
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