Skip to content

Fix empty page tree in pre-filtered preference dialog#4044

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:fix-4041-prefilter-dialog
Open

Fix empty page tree in pre-filtered preference dialog#4044
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:fix-4041-prefilter-dialog

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Jun 1, 2026

Forward fix for #4041 on master (the 4.40 maintenance branch gets the plain revert in #4043).

The native search field rework in #3925 stopped maintaining the inherited initialText sentinel, so the hint that addFilter() wrote into the field was applied as a real filter pattern and hid every preference page. This keeps the sentinel in sync and no longer writes the hint into the field, so a pre-filtered dialog (for example Preferences from a Java editor context menu) shows its pages again. The native search field is preserved, and the now-redundant "type filter text" placeholder is dropped since the search icon already indicates the field purpose.

The native search field rework (PR eclipse-platform#3925) overrode setInitialText to only
set the placeholder message and stopped maintaining the inherited
initialText sentinel. The pre-filter path addFilter() still wrote the hint
"type filter text" into the field, which was then applied as a real filter
pattern (since it no longer equalled initialText), matching no preference
pages and leaving the tree empty.

Keep the initialText sentinel in sync in the override and stop writing the
hint into the field in addFilter(). The search icon now signals the field's
purpose, so the "type filter text" placeholder is dropped; initialText is
kept only for the empty-filter check and the field's accessible name.

Fixes eclipse-platform#4041
@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Jun 1, 2026

@wahlbrink FYI, I also tested your example and it works fine.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Test Results

   864 files  ±0     864 suites  ±0   53m 0s ⏱️ - 1m 27s
 7 989 tests ±0   7 746 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 421 runs  ±0  19 766 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit 6ef9331. ± Comparison against base commit 55391d7.

Copy link
Copy Markdown
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

With this change, the filterered trees in preference dialogs don't have any hint on the filter field at all anymore. Is that intended?

For the filtered preference dialog one might argue that it's okay because the filter text was only presented as ordinary filter text input when opening the dialog, so it might be somehow okay to remove that:
Image

But the ordinary preferences dialog now looks like this:
Image

While it used to contain a proper hint:
Image

Edit: just saw that there is the search symbol in front of the text now. Still I thought that there is a possibility to show a hint in such a search box, isn't it? I would rather expect that to be shown (like it was in the preferences dialog before). Otherwise it becomes less obvious that this is filter field rather than a search field.

getViewer().addFilter(filter);

if (filterText != null) {
setFilterText(WorkbenchMessages.FilteredTree_FilterMessage);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't this removal make other places using that NLS obsolete or maybe kind of incompatible, such as ... ?

|| previousFilterText.equals(WorkbenchMessages.FilteredTree_FilterMessage)

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