sfbrigade / bats-server

Routed is an app to help ambulances direct non-critical patients to hospital emergency rooms with the most availability.
https://routedapp.org/
GNU Affero General Public License v3.0
18 stars 11 forks source link

Maintain collapsed state of Ringdowns list when switching tabs in ER view #274

Open kretzbryan opened 1 year ago

fwextensions commented 1 year ago

Thanks for this, @kretzbryan. I'm not sure writing the state to localStorage is the best approach, as we'd be leaving behind the title of each ringdown in the browser, and there's no guarantee they'd be unique. Seems like the app itself would need to maintain the state. Or the tab could just be hidden, instead of torn down, so the expanded state would be maintained in the DOM.

kretzbryan commented 1 year ago

I'm not sure if we're going to have other ui features related to the ringdown sections, so I structured the state so we can add more values to each section. If you think all we're expecting is to expand them, then I can simplify the state a little more.