Skip to content

Reveal the selection when a FilteredTree filter is widened - #4490

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:vogella/filteredtree-reveal-selection
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:vogella/filteredtree-reveal-selection

Conversation

@vogella

@vogella vogella commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Widening or clearing the filter of a FilteredTree collapses the whole tree, so a selected element ends up hidden inside a collapsed parent and the user has to search for it again. Both the workbench and the e4 FilteredTree now remember the selection before the refresh and reveal it afterwards, re-selecting it only if the collapse dropped it. This fixes the behaviour for every client at once, including preference dialogs, the e4 model editor and the views that use FilteredTree, instead of each client working around it.

@vogella
vogella force-pushed the vogella/filteredtree-reveal-selection branch from 96817cd to 56174c5 Compare October 14, 2026 21:27
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ± 0     867 suites  ±0   53m 47s ⏱️ - 6m 21s
 8 473 tests + 8   8 231 ✅ + 8  242 💤 ±0  0 ❌ ±0 
21 297 runs  +24  20 614 ✅ +24  683 💤 ±0  0 ❌ ±0 

Results for commit 0690da6. ± Comparison against base commit 3faf11c.

♻️ This comment has been updated with latest results.

@vogella
vogella requested a balanced review from Copilot October 15, 2026 05:03

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

Clearing a filter in quick-selection mode still leaves nested selections hidden.

1 open finding
What changed in this PR

Preserves selection visibility when a FilteredTree filter is widened or cleared.

Changes:

  • Saves and reveals selections after refresh in both FilteredTree implementations.
  • Adds regression tests for nested selections, repeated elements, and multiple selected paths.
File Description
tests/​org.eclipse.ui.tests/​Eclipse UI Tests/​org/​eclipse/​ui/​tests/​filteredtree/​FilteredTreeTests.java Adds selection-visibility regression tests.
bundles/​org.eclipse.ui.workbench/​eclipseui/​org/​eclipse/​ui/​dialogs/​FilteredTree.java Restores selection visibility outside quick-selection mode.
bundles/​org.eclipse.e4.ui.dialogs/​src/​org/​eclipse/​e4/​ui/​dialogs/​filteredtree/​FilteredTree.java Restores selection visibility after widening filters.

🧠 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 vogella/filteredtree-reveal-selection branch from 56174c5 to 3dba775 Compare October 15, 2026 05:53
@vogella
vogella force-pushed the vogella/filteredtree-reveal-selection branch 2 times, most recently from 80d2f2d to 8662852 Compare October 15, 2026 17:12
@vogella

vogella commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Fixes the issue that e4 model looses its selection if the filter is removed

after-clear

@vogella
vogella force-pushed the vogella/filteredtree-reveal-selection branch from 8662852 to 4cf727a Compare October 16, 2026 18:38
Widening or clearing the filter collapses the whole tree, so the selected
element ended up hidden inside a collapsed parent. Both FilteredTree
implementations now reveal the selection again after the refresh, which
also lets quick-selection mode keep a selection that still matches.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the vogella/filteredtree-reveal-selection branch from 4cf727a to 0690da6 Compare October 16, 2026 18:58
@vogella
vogella requested a balanced review from Copilot October 16, 2026 19:01

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.

🔵 Needs a closer look

Cross-platform SWT selection behavior still needs UI-test validation and human review; tests were not executed.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

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