metacatui icon indicating copy to clipboard operation
metacatui copied to clipboard

Standardize activation behaviour of sections in ToolbarView

Open robyngit opened this issue 1 year ago • 0 comments

The current implementation of ToolbarView in our Cesium map has highlighted a need for more predictable control over section activation behaviour. Two main ideas have been considered:

  1. Lazy Rendering of Views: Currently, views within ToolbarView are rendered irrespective of their visibility (most sections are hidden initially). Lazy rendering of views, where a view is rendered only when it becomes visible/activated, not only avoids running code we don't need to, but is also a more predictable pattern for developers.

  2. Combining Default and Custom Actions: There's a need to streamline the activation of sections that require both a default action (rendering a sub-view) and a custom action (e.g. focusing an input). This behaviour is currently required for the Viewfinder section of the toolbar, but is likely applicable to sections we add in the future.

For more discussion on this, see https://github.com/NCEAS/metacatui/pull/2258#discussion_r1488324742

robyngit avatar Feb 14 '24 15:02 robyngit