Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor toolbar and GraphInterface's state #1

Open
dburian opened this issue May 24, 2024 · 1 comment
Open

Refactor toolbar and GraphInterface's state #1

dburian opened this issue May 24, 2024 · 1 comment

Comments

@dburian
Copy link
Owner

dburian commented May 24, 2024

Toolbar

The toolbar should be:

  • reusable with configurable buttons and orientations to be used in more than just one place
  • floating above the content

The current toolbar has also some problems:

  • no animations
  • sticky slider -- e.g. too much graph should be interpreted as a full-screen graph

GraphInterface's state

Spaghetti code of mixing url-based state and persistent state. The current toolbar needs to understand GraphInterface's state to work.

@dburian
Copy link
Owner Author

dburian commented May 28, 2024

With 8fecae8:

  • more reusable
  • not floating -- If it was floating above the graph, it wouldn't be visible with full-screen note.

The state management is hard:

  • we need to coordinate the URL with the correct state, suggesting URL should be the source of truth
  • but we also need to persist some states between pages
  • it is doable within the component, but the code becomes very messy
  • I tried (99bdf3e) to extract the logic to a store, but this introduced another source of truth (URL and store), which has led to flashes of content

Currently, I've settled for a simple Toolbar without any slider, as I don't really need it. I'll add some animations and see what we end up with. Maybe then I'll include the slider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant