Skip to content

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

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:fix-4041-prefilter-dialog
Jun 8, 2026
Merged

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

Conversation

@vogella

@vogella vogella commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

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 "type filter text" hint is kept as the placeholder message so the field still signals that it filters the pages.

@vogella

vogella commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Test Results

   861 files  ±0     861 suites  ±0   54m 23s ⏱️ + 2m 44s
 8 034 tests ±0   7 791 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 541 runs  ±0  19 886 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit e783f80. ± Comparison against base commit cb556ad.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare left a comment

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.

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.

@vogella

vogella commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

The search icon is the hint. I can add the text back if you prefer.

@HeikoKlare

Copy link
Copy Markdown
Contributor

In the current master state, we have the icon via hint and still a proper message (hint) about the filter functionality:
image

As said, in my opinion only having the search icon is wrong, as this is not a search field but a filter field. One may even argue that the search icon is not correct as it would need to be a filter icon.

@vogella vogella force-pushed the fix-4041-prefilter-dialog branch 2 times, most recently from 5b5ddc5 to be72249 Compare June 5, 2026 08:28
@vogella

vogella commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

I restored the text hint

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 placeholder hint is still shown via
setMessage so the field keeps signalling that it filters the pages, but it
is never written into the field as an active pattern.

Fixes eclipse-platform#4041
@vogella vogella force-pushed the fix-4041-prefilter-dialog branch from be72249 to e783f80 Compare June 5, 2026 08:56
@vogella vogella merged commit 02c9b79 into eclipse-platform:master Jun 8, 2026
18 checks passed
@vogella vogella deleted the fix-4041-prefilter-dialog branch June 8, 2026 09:02
@HeikoKlare

Copy link
Copy Markdown
Contributor

Is there a specific reason why my review comment was left uncommented and the PR was merged without responding to it?

@HeikoKlare

Copy link
Copy Markdown
Contributor

Due to lack of response to my review comment, merging the PR despite the open review comment and ignoring my comment left after merging the PR, I plan to revert this change. @vogella fyi

@vogella

vogella commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

In the current master state, we have the icon via hint and still a proper message (hint) about the filter functionality:

I thought I did adjust the pr based on your request. Is it now in sync with the master in the release, was that not your request @HeikoKlare ?

@vogella

vogella commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

I restored the text hint

I assumed that was your suggestion.

@HeikoKlare

Copy link
Copy Markdown
Contributor

As said, my review comment is completely unanswered: #4044 (comment)

@vogella

vogella commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

As said, my review comment is completely unanswered: #4044 (comment)

I restored the message based on your request, hence this feedback was outdated as we do not remove this text.

Technical we have this:

The message is not obsolete. FilteredTree_FilterMessage is still used at FilteredTree.java:294 and the comparison at line 619 still applies to the base FilteredTree and the subclasses that write the message into the field content. In FilteredPreferenceDialog we now keep the field empty instead of writing the message into it, but narrowingDown evaluates identically: with previousFilterText empty, getFilterString().startsWith("") is always true, which is the same result the equals(FilteredTree_FilterMessage) branch produced before. So no usage becomes dead and there is no behavioral change in that path.

@vogella

vogella commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

I think you said two things in your feedback: "We should not remove the text" and "If we remove the text, this NLS becomes obsolete" so I assumed "I restored the text" answered both, I should have been more explicit about it, to avoid misunderstanding.

@HeikoKlare

Copy link
Copy Markdown
Contributor

I restored the message based on your request, hence this feedback was outdated as we do not remove this text.

That's not correct. You restored the message, but not the text. The question I asked refers to the text being compared.

So with this change the filtered preference dialog behaves different in terms of UX for filtered trees than all other filtered trees (they still provide the message as initial text, which is why the code I asked for probably needs to stay). Is that intended? Don't we want to have consistent UX thoughout the usages of filtered trees?

@vogella

vogella commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

On the inline question: the FilteredTree_FilterMessage NLS isn't obsolete. It's still used at FilteredTree.java:294 and the comparison at line 619 still applies to the base FilteredTree and subclasses that write the message into the field value. In FilteredPreferenceDialog we now keep the field empty, but narrowingDown evaluates identically (with an empty previousFilterText, getFilterString().startsWith("") is always true, matching the old equals(FilterMessage) branch). So nothing becomes dead and there's no behavioral change.

On the hint itself: the intention of #3925 was to move the filter field away from the initial-text-in-value pattern, which is a recognized UX anti-pattern (e.g. https://www.nngroup.com/articles/form-design-placeholders/): screen readers can treat it as a real value, and it needs clear-on-focus handling. setMessage gives the same visible hint without those problems, and the hint is now restored that way.

I agree we should be consistent. My preference is to move the remaining places that still push the hint into the field value over to setMessage too, rather than reintroducing the old behavior here. Changing the global default is harder to land in this project, so I'd treat that separately. That said, if you feel strongly that the old initial-text behavior should be restored, I'm happy to do it. Let me know.

@HeikoKlare

Copy link
Copy Markdown
Contributor

I agree we should be consistent. My preference is to move the remaining places that still push the hint into the field value over to setMessage too, rather than reintroducing the old behavior here. Changing the global default is harder to land in this project, so I'd treat that separately. That said, if you feel strongly that the old initial-text behavior should be restored, I'm happy to do it. Let me know.

No, I do not want to propose to move back. I fully agree that properly embedding the hint via setMessage is the right thing to do. My question was rather meat to ask if we shouldn't move forward with the FilteredTree implementation itself as well. I currently don't see why we need to keep the message as initial field text there and cannot remove it just like it was removed here.

@vogella

vogella commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

I currently don't see why we need to keep the message as initial field text there and cannot remove it just like it was removed here.

I agree. I will create a PR for that and add you as reviewer to have the discussion there.

@vogella

vogella commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

FYI - AbstractFilteredViewerComposite is the place to do this, not FilteredTree, will be visible in the upcoming PR.

@vogella

vogella commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

#4074

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