iTwin / appui

Monorepo for iTwin.js AppUi
MIT License
8 stars 2 forks source link

Overriding features from outside desyncs local override state #427

Open AntanasBuk opened 11 months ago

AntanasBuk commented 11 months ago

Describe the bug Overriding categories or models displayed in the view with tool buttons from StandardContentToolsUiItemsProvider keeps a local state of overridden feature ids and changes to features from outside of AppUI's API would not modify this state hence disrupting functionality and displaying of these buttons.

To Reproduce Steps to reproduce the behavior of one of the bugs:

  1. Hide a category of elements through.
  2. Observe as StandardContentToolsUiItemsProvider buttons do not change.

Expected behavior clearHideIsolateEmphasizeElements button should appear.

Screenshots HideModelsTree

MissingButton

Desktop (please complete the applicable information):

Additional context Issue discussed in https://github.com/iTwin/appui/issues/264 comments and https://github.com/iTwin/itwinjs-core/discussions/5772#discussioncomment-6532862.

raplemie commented 11 months ago

Shouldnt that be handled through a ConditionalBooleanValue on the isHidden prop of the toolbar ? (And listening to syncEvents)

AntanasBuk commented 11 months ago

I've added events in https://github.com/iTwin/appui/pull/425 that would make isHidden prop to be recalculated. The problem is the events do not give any information about what changed: what category/model was hidden or shown or overridden in some way, and only api for tracking individual hidden elements (not categories or models) exists in itwin-core (neverDrawn).