Closed bprusinowski closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
visualization-tool | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 3, 2024 3:11pm |
I think the button to display the filters and the filters themselves should be decoupled. I find the position: absolute solution too fragile, and the it ties together too much the components (one has to know that another one is in position: relaive, and a height needs to be put for the container).
I think we see here that the buttons to toggle and the display of what they toggle is too intertwined.
@ptbrowne I refactored a bit to separate ChartDataFiltersToggle
and ChartDataFiltersList
; it looks that they two share a lot of common state that probably makes more sense in useState
that zustand store, where I'd expect more high-level things like open
, setOpen
, and not things needed to render the inners of the component, especially if we share one store for two components, like e.g. "useChartControlsStore".
Let me know if it looks better now; otherwise I can move it one step further and actually refactor into a common zustand store 👍
I think it would make sense, but then it should probably be renamed to something like "chartControlsStore" that would keep the state of both interactive filters, data filters element and metadata panel? All in a way "control" the chart 😅
I also wonder if we should simply keep state of UI elements there for data filters and metadata panel (open
, setOpen
), leaving the actual state close to the components?
I think this could be a part of technical improvements in the next sprint :)
Closes #1528
How to test