-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: Fix performance of getting subject models in Models Tree #3666
Merged
grigasp
merged 2 commits into
master
from
ui/models-tree/fix-determining-subject-models-performance
May 24, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...pui-react/ui-models-tree-fix-determining-subject-models-performance_2022-05-24-08-55.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@itwin/appui-react", | ||
"comment": "Models Tree: Fix performance of determining Subject nodes' display state.", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@itwin/appui-react" | ||
} |
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed that the "PhysicalPartition.Model.Content" Json name changes per type of Partition. That is, it can also be "SpatialLocationPartition.Model.Content" or "GeometricPartition3d.Model.Content". It seems the latter two will be missed by the "queryModels" ECSQL above.
I've also seen such piece of Json is not written by all connectors. At least the IFC and Revit connectors don't write it. Maybe only the dgn connectors do. It seems such piece of Json drives some "isHidden" attribute later on.
I believe we should revisit the reasons driving the introduction of such piece of Json and corresponding UX behaviors. Since it is not supported by all connectors, and it has problems with multiple kinds of partitions, it looks to be rather the source of bugs and inconsistencies in the UX.
cc: @grigasp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC The BIS working group recommended the current design. The goal was to add a hint to a Subject element so that presentation rules could know what it is for and how or if to display it. That was preferred to adding an IsPrivate or IsHidden property to the Subject class.
We only need presentation hints like this because connectors create Subjects that are not relevant to the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have so many problems because of the fact that Subjects serve multiple purposes... And, sadly, it seems we're not going to have a concept that we could directly use for creating the hierarchy. Because of that, we have a project to remove the Subjects hierarchy from the Models Tree altogether. The project was on hold lately, I hope we can revive it soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, turns out querying the
PhysicalPartition.Model.Content
was unnecessary - here's a PR to remove it: #3697.It's still used when creating the hierarchy, though. There we use
PhysicalPartition.Model.Content
andGraphicalPartition3d.Model.Content
. Now you're saying we're missing a few others with a possibility that there might be even more than that. Sounds like the list is not definite, because we'd get a new attribute every time a a new subclass of InformationPartitionElement is introduced.@swwilson-bsi says that the sole purpose of this flag is to help create the Models Tree. Then I'd question what's the point of creating so many different attributes and making it difficult to capture all of them for the only component that uses them.
And just to explain what the attribute does in the Models Tree... When an InformationPartitionElement has this attribute, we don't show its Model node and instead show Categories directly under Subject node. So not capturing the attribute would mean the Model node is displayed.