Open moontrip opened 6 months ago
My 2 cents: I think we should keep the isVisible
property and get rid of activeVisualizationId
. There have been discussions about allowing multiple floating visualizations, and this will put us in a better position to deliver that.
Separated from https://github.com/VEuPathDB/web-monorepo/issues/935 as a tech debt
isVisible
tech debtAt the moment, both
visualizationPanelConfig
andstudyDetailsPanelConfig
(in appState.ts) are of typePanelConfig
which isThe
SubStudies
(list of sub-studies) floater is conditionally rendered based onappState.studyDetailsPanelConfig?.isVisible
but theDraggableVisualization
(supporting plot) is rendered based on the truthiness of various variables, ultimately dependent on the truthiness of itsactiveVisualizationId
prop.There is currently logic setting/unsetting
visualizationPanelConfig.isVisible
but it is not used to conditionally render the panel.We could either a) remove
isVisible
as a prop fromvisualizationPanelConfig
and remove the logic setting/unsettingisVisible
or b) standardise the behaviour and makeDraggableVisualization
conditional rendering make use ofvisualizationPanelConfig.isVisible
Given that the
showControls
work could involve changing the props ofvisualizationPanelConfig
- maybe a) is the better option?Bob said he preferred to have outer conditional rendering so this ticket will be set to remove internal conditional rendering. Note that my initial attempt revealed that there existed many type issues if removing internal condition.