iTwin / presentation

Monorepo for iTwin.js Presentation Library
https://www.itwinjs.org/presentation/
MIT License
4 stars 0 forks source link

Hilite issues after selecting a class grouping node with many grouped instances #329

Closed grigasp closed 11 months ago

grigasp commented 11 months ago

Repro:

  1. Open https://qa-connect-imodelweb.bentley.com/imodeljs/?projectId=684860b3-e9bc-47cb-82fc-c243178000fa&iModelId=c47d8e40-6890-4dfb-b390-27e5bd933c93&ChangeSetId=9f570e69ab6278e61736d15ff91383d191959b44.
  2. Open "Search" widget.
  3. Enter "cell" in the search, wait for search to complete.
  4. Select the "Physical Object" class grouping node.
### Issues:
- [x] It takes a long time to hilite the grouped elements. Investigate why.
- [x] The requests to get the grouped elements are being sent even after the class grouping node is deselected. Could we cancel that if selection changes during the process?
- [x] The class grouping node says it's grouping 42552 elements. However, the `getPagedContent` and `getPagedContentSet` requests think there are 1000341 items in the content set. Needs investigation.
- [x] Hilite fails if the hilite set has more than 65536 items (see image below). Need to avoid this.

Image

saskliutas commented 11 months ago

The class grouping node says it's grouping 42552 elements. However, the getPagedContent and getPagedContentSet requests think there are 1000341 items in the content set. Needs investigation.

When loading content items for hilite set we traverse ElementOwnsChildElements relationship recursively and that results in 1000341 elements when selecting that specific class grouping node.

grigasp commented 11 months ago

It takes a long time to hilite the grouped elements. Investigate why.

Performance improved with https://github.com/iTwin/imodel-native/pull/550.

grigasp commented 11 months ago

Hilite fails if the hilite set has more than 65536 items (see image below). Need to avoid this.

Fixed with https://github.com/iTwin/itwinjs-core/pull/6221

grigasp commented 11 months ago

The requests to get the grouped elements are being sent even after the class grouping node is deselected. Could we cancel that if selection changes during the process?

Part of the change is in https://github.com/iTwin/itwinjs-core/pull/6221. When that gets released, a change in @itwin/presentation-components will be needed to stop loading hilite set upon unified selection change. That feature will be included in the 5.0 major release.

Update: The change was completed with https://github.com/iTwin/presentation/pull/354.