metacatui
metacatui copied to clipboard
Standardize activation behaviour of sections in ToolbarView
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:
-
Lazy Rendering of Views: Currently, views within
ToolbarVieware 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. -
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