Skip to content

[Tree widget]: adjust how parent elements visibility is changed on next#1687

Open
JonasDov wants to merge 35 commits into
tree-widget/nextfrom
JonasD/phase3c
Open

[Tree widget]: adjust how parent elements visibility is changed on next#1687
JonasDov wants to merge 35 commits into
tree-widget/nextfrom
JonasD/phase3c

Conversation

@JonasDov
Copy link
Copy Markdown
Contributor

@JonasDov JonasDov commented May 21, 2026

Phase 3c. of #1678.
Closes #1561.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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.

@JonasDov JonasDov marked this pull request as ready for review May 22, 2026 09:20
@JonasDov JonasDov requested review from a team as code owners May 22, 2026 09:20
Copilot AI review requested due to automatic review settings May 22, 2026 09:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.changeElementsVisibilityStatus to 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 parentElementsIdsPath and categoryOfTopMostParentElement into 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.

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