Skip to content

Style CTabFolder pages that are hidden when they are skinned - #4331

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:ctabfolder-page-initial-styling
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:ctabfolder-page-initial-styling

Conversation

@vogella

@vogella vogella commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

The Search dialog opens unstyled in the dark theme and only picks up the theme once a tab is switched. A CTabFolder exposed only the page of its selected tab to the CSS engine, so a page skinned before it was attached, or while its tab was not yet selected, was skipped, and neither attaching a page to the selected tab nor a programmatic setSelection fires an event that would style it later.

Now only the pages of unselected tabs are hidden from the engine, so a page no tab holds yet is styled as soon as it is skinned, and a skipped page of an unselected tab is styled on the Show event that selecting its tab always sends. This closes the case of an already sized, visible page attached to the selected tab without any further event, and the pages of unselected tabs are still skipped, so styling stays lazy.

New CTabFolderTest cases cover the dialog's sequences, a pre-sized page attached after pending paints are drained, toolbar pages, reparented pages, repeated re-skins and the still-deferred unselected page. The swt-simple test is dropped, since curved tabs are gone and getSimple() always returns true.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files     867 suites   43m 13s ⏱️
 8 413 tests  8 171 ✅ 242 💤 0 ❌
21 108 runs  20 425 ✅ 683 💤 0 ❌

Results for commit d2252ee.

♻️ This comment has been updated with latest results.

@vogella

vogella commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Before:

pr4331-before

After:

pr4331-after-screen

@vogella
vogella marked this pull request as ready for review September 1, 2026 15:27
@vogella
vogella force-pushed the ctabfolder-page-initial-styling branch 2 times, most recently from e7045c4 to 9f90fae Compare September 3, 2026 11:15
@vogella
vogella requested a balanced review from Copilot September 28, 2026 12:35
@vogella

vogella commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author
pr4331-before-large pr4331-after-large

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.

Copilot review overview

🟡 Changes recommended

Deferred listeners need filtering and deduplication to avoid persistent or repeated resize handling.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes delayed CSS styling for hidden CTabFolder pages.

Changes:

  • Defers styling until a hidden page becomes selected or attached.
  • Adds regression tests for both page-creation sequences.
  • Removes the obsolete swt-simple test.
File Description
CSSSWTApplyStylesListener.java Adds deferred page styling listeners.
CTabFolderTest.java Adds regression coverage and removes obsolete coverage.

💡 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 ctabfolder-page-initial-styling branch 7 times, most recently from ec93fb9 to 8036197 Compare September 30, 2026 16:03
@vogella
vogella force-pushed the ctabfolder-page-initial-styling branch 3 times, most recently from e102dfd to 8a07003 Compare October 7, 2026 05:56
@vogella
vogella requested a balanced review from Copilot October 8, 2026 12:34
@vogella
vogella force-pushed the ctabfolder-page-initial-styling branch from 8a07003 to 3d4d5c8 Compare October 8, 2026 12:34

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

Already-sized and reparented pages can still remain unstyled.

2 open findings
1 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment on lines +60 to +70
// the control may have been reparented, and a new skin event watches it again
boolean inFolder = control.getParent() == folder && !folder.isDisposed();
if (inFolder && !isPageOfSelectedTab(folder, control)) {
return;
}
control.removeListener(SWT.Show, this);
control.removeListener(SWT.Resize, this);
control.setData(pendingPageKey, null);
if (inFolder) {
engine.applyStyles(control, true);
}
The Search dialog opened unstyled until a tab was switched.

A CTabFolder exposes only the page of its selected tab to the CSS
engine, and applyStyles skips an element that is not visible. A page
skinned while its tab is not selected, or before it is attached to its
tab, as SearchDialog and its search pages do, is skipped, and neither
the programmatic setSelection nor the attach sends a skin event that would
restyle it.

Watch such a page for the show or resize that makes it the selected
tab's page and style it then.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the ctabfolder-page-initial-styling branch from 3d4d5c8 to d2252ee Compare October 9, 2026 06:04
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