[Tree widget]: adjust how parent elements visibility is changed on next#1687
Open
JonasDov wants to merge 35 commits into
Open
[Tree widget]: adjust how parent elements visibility is changed on next#1687JonasDov wants to merge 35 commits into
next#1687JonasDov wants to merge 35 commits into
Conversation
There was a problem hiding this comment.
Tree-Widget Next benchmark
| Benchmark suite | Current: 2e97d10 | Previous: 2d9a816 | Deviation | Status |
|---|---|---|---|---|
models tree 50k 3D elements search > get search paths |
1272 ms |
1173 ms |
8.44% |
〰️ |
models tree 50k 3D elements search > get search paths (P95 of main thread blocks) |
56 ms |
54 ms |
3.70% |
〰️ |
models tree 50k 3D elements search > load hierarchy from search paths |
105787 ms |
104268 ms |
1.46% |
〰️ |
models tree 50k 3D elements search > load hierarchy from search paths (P95 of main thread blocks) |
37 ms |
25 ms |
48% |
〰️ |
models tree 50k categories > collect nodes |
3077 ms |
2897 ms |
6.21% |
〰️ |
models tree 50k categories > collect nodes (P95 of main thread blocks) |
137 ms |
100 ms |
37% |
〰️ |
models tree 50k categories > validate initial visibility |
1949 ms |
2059 ms |
-5.34% |
〰️ |
models tree 50k categories > validate initial visibility (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
models tree 50k categories > change visibility |
84 ms |
79 ms |
6.33% |
〰️ |
models tree 50k categories > change visibility (P95 of main thread blocks) |
74 ms |
69 ms |
7.25% |
〰️ |
models tree 50k categories > validate changed visibility |
3343 ms |
3756 ms |
-11.00% |
✅ |
models tree 50k categories > validate changed visibility (P95 of main thread blocks) |
32 ms |
25 ms |
28.00% |
〰️ |
models tree 50k 3D elements > collect nodes |
41728 ms |
42240 ms |
-1.21% |
〰️ |
models tree 50k 3D elements > collect nodes (P95 of main thread blocks) |
84 ms |
76 ms |
10.53% |
〰️ |
models tree 50k 3D elements > validate initial visibility |
1655 ms |
1869 ms |
-11.45% |
✅ |
models tree 50k 3D elements > validate initial visibility (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
models tree 50k 3D elements > change model visibility |
19 ms |
21 ms |
-9.52% |
〰️ |
models tree 50k 3D elements > change model visibility (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
models tree 50k 3D elements > validate changed model visibility |
3147 ms |
3659 ms |
-13.99% |
✅ |
models tree 50k 3D elements > validate changed model visibility (P95 of main thread blocks) |
72 ms |
99 ms |
-27.27% |
〰️ |
models tree 50k 3D elements > change category node visibility |
513 ms |
501 ms |
2.40% |
〰️ |
models tree 50k 3D elements > change category node visibility (P95 of main thread blocks) |
61 ms |
63 ms |
-3.17% |
〰️ |
models tree 50k 3D elements > validate changed category visibility |
1819 ms |
1939 ms |
-6.19% |
〰️ |
models tree 50k 3D elements > validate changed category visibility (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
models tree 50k 3D elements > validate per-model category override |
1773 ms |
1925 ms |
-7.90% |
〰️ |
models tree 50k 3D elements > validate per-model category override (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
models tree 50k 3D elements > change element visibility |
32 ms |
34 ms |
-5.88% |
〰️ |
models tree 50k 3D elements > change element visibility (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
models tree 50k 3D elements > validate changed element visibility |
2586 ms |
2620 ms |
-1.30% |
〰️ |
models tree 50k 3D elements > validate changed element visibility (P95 of main thread blocks) |
69 ms |
73 ms |
-5.48% |
〰️ |
models tree 50k 3D child elements with different categories > collect nodes |
41605 ms |
41727 ms |
-0.29% |
〰️ |
models tree 50k 3D child elements with different categories > collect nodes (P95 of main thread blocks) |
80 ms |
65 ms |
23.08% |
〰️ |
models tree 50k 3D child elements with different categories > validate initial visibility |
1592 ms |
1769 ms |
-10.01% |
✅ |
models tree 50k 3D child elements with different categories > validate initial visibility (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
models tree 50k 3D child elements with different categories > change visibility |
52 ms |
51 ms |
1.96% |
〰️ |
models tree 50k 3D child elements with different categories > change visibility (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
models tree 50k 3D child elements with different categories > validate changed visibility |
3780 ms |
4107 ms |
-7.96% |
〰️ |
models tree 50k 3D child elements with different categories > validate changed visibility (P95 of main thread blocks) |
209 ms |
167 ms |
25.15% |
〰️ |
categories tree 50k subCategories search > get search paths |
1798 ms |
1833 ms |
-1.91% |
〰️ |
categories tree 50k subCategories search > get search paths (P95 of main thread blocks) |
41 ms |
42 ms |
-2.38% |
〰️ |
categories tree 50k subCategories search > load hierarchy from search paths |
5600 ms |
5254 ms |
6.59% |
〰️ |
categories tree 50k subCategories search > load hierarchy from search paths (P95 of main thread blocks) |
55 ms |
44 ms |
25% |
〰️ |
categories tree 50k subCategories > collect nodes |
5985 ms |
5705 ms |
4.91% |
〰️ |
categories tree 50k subCategories > collect nodes (P95 of main thread blocks) |
48 ms |
42 ms |
14.29% |
〰️ |
categories tree 50k subCategories > validate initial visibility |
1159 ms |
1215 ms |
-4.61% |
〰️ |
categories tree 50k subCategories > validate initial visibility (P95 of main thread blocks) |
23 ms |
26 ms |
-11.54% |
〰️ |
categories tree 50k subCategories > change visibility |
330 ms |
353 ms |
-6.52% |
〰️ |
categories tree 50k subCategories > change visibility (P95 of main thread blocks) |
0 ms |
24 ms |
-100% |
〰️ |
categories tree 50k subCategories > validate changed visibility |
1037 ms |
1214 ms |
-14.58% |
✅ |
categories tree 50k subCategories > validate changed visibility (P95 of main thread blocks) |
25 ms |
35 ms |
-28.57% |
〰️ |
categories tree 50k categories > collect nodes |
2489 ms |
2471 ms |
0.73% |
〰️ |
categories tree 50k categories > collect nodes (P95 of main thread blocks) |
140 ms |
124 ms |
12.90% |
〰️ |
categories tree 50k categories > validate initial visibility |
4882 ms |
6636 ms |
-26.43% |
✅ |
categories tree 50k categories > validate initial visibility (P95 of main thread blocks) |
154 ms |
128 ms |
20.31% |
〰️ |
categories tree 50k categories > change visibility |
620 ms |
701 ms |
-11.55% |
✅ |
categories tree 50k categories > change visibility (P95 of main thread blocks) |
48 ms |
56 ms |
-14.29% |
〰️ |
categories tree 50k categories > validate changed visibility |
4377 ms |
6173 ms |
-29.09% |
✅ |
categories tree 50k categories > validate changed visibility (P95 of main thread blocks) |
31 ms |
34 ms |
-8.82% |
〰️ |
classifications tree 50k classifications search > get search paths |
2173 ms |
2115 ms |
2.74% |
〰️ |
classifications tree 50k classifications search > get search paths (P95 of main thread blocks) |
129 ms |
127 ms |
1.57% |
〰️ |
classifications tree 50k classifications search > load hierarchy from search paths |
65208 ms |
64458 ms |
1.16% |
〰️ |
classifications tree 50k classifications search > load hierarchy from search paths (P95 of main thread blocks) |
22 ms |
23 ms |
-4.35% |
〰️ |
classifications tree 50k classifications > collect nodes |
35247 ms |
35284 ms |
-0.10% |
〰️ |
classifications tree 50k classifications > collect nodes (P95 of main thread blocks) |
84 ms |
78 ms |
7.69% |
〰️ |
classifications tree 50k classifications > validate initial visibility |
3575 ms |
4173 ms |
-14.33% |
✅ |
classifications tree 50k classifications > validate initial visibility (P95 of main thread blocks) |
64 ms |
115 ms |
-44.35% |
✅ |
classifications tree 50k classifications > change visibility |
26 ms |
30 ms |
-13.33% |
〰️ |
classifications tree 50k classifications > change visibility (P95 of main thread blocks) |
0 ms |
0 ms |
0% |
🟰 |
classifications tree 50k classifications > validate changed visibility |
3787 ms |
4403 ms |
-13.99% |
✅ |
classifications tree 50k classifications > validate changed visibility (P95 of main thread blocks) |
178 ms |
150 ms |
18.67% |
〰️ |
This comment was automatically generated by workflow using github-action-benchmark.
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts tree-widget element visibility changes so that when toggling a parent element “on next”, descendant elements are only forced into always/never drawn sets when their category default visibility does not already match the requested state (addressing #1561).
Changes:
- Refactors
BaseVisibilityHelper.changeElementsVisibilityStatusto compute descendant updates per-category and use always/never-drawn cache clearing vs. descendant ID fetching based on category-default match. - Updates Models/Categories/Classifications tree visibility handlers/helpers to pass
parentElementsIdsPathandcategoryOfTopMostParentElementinto the new element-visibility logic. - Adds/updates tests to validate that only descendants in non-matching categories are forced into
alwaysDrawn.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/itwin/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHelper.ts | Updates grouped-element visibility change API to pass parent-path/top-most category context into base helper. |
| packages/itwin/tree-widget/src/tree-widget-react/components/trees/models-tree/internal/visibility/ModelsTreeVisibilityHandler.ts | Refactors search-result and element visibility change flows to use new descendant/category-aware base helper inputs. |
| packages/itwin/tree-widget/src/tree-widget-react/components/trees/common/internal/VisibilityUtils.ts | Changes element state operator to consume { elementId, matchesDesiredState } instead of computing defaults per element. |
| packages/itwin/tree-widget/src/tree-widget-react/components/trees/common/internal/visibility/BaseVisibilityHelper.ts | Core logic change: descendant visibility updates are now category-aware and use parent-path/top-most category context. |
| packages/itwin/tree-widget/src/tree-widget-react/components/trees/classifications-tree/internal/visibility/ClassificationsTreeVisibilityHandler.ts | Aligns classifications tree element visibility changes with new base helper API and descendant handling. |
| packages/itwin/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHelper.ts | Updates grouped-element visibility change to delegate to base helper with top-most category + parent path context. |
| packages/itwin/tree-widget/src/tree-widget-react/components/trees/categories-tree/internal/visibility/CategoriesTreeVisibilityHandler.ts | Refactors category tree visibility changes (including search-result behavior) to use the updated base helper API. |
| packages/itwin/tree-widget/src/test/trees/models-tree/Utils.ts | Extends test node factory to include categoryOfTopMostParentElement. |
| packages/itwin/tree-widget/src/test/trees/models-tree/internal/ModelsTreeVisibilityHandler.test.ts | Adds coverage for “only descendants in non-matching categories are forced into always drawn”. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3c. of #1678.
Closes #1561.