Open dglazkov opened 1 month ago
Maybe this could be in the graph metadata? I could write an API
That would be ideal, I think, because we currently store it per open tab in the editor, which isn't persistent. I suspect a window
property on the graph metadata's visual
property would be a good place to start? If it stores x
, y
, width
, and height
I can figure out the transform needed when we load the graph.
We now have GraphMetadata.visual.window
!
Not sure what to do next though. It sounds like if we save last window position, then the graph will be edited/saved every time I zoom/pan/scroll. That sounds ... excessive maybe? Or not? Not sure.
Well, we could differentiate saves based on visualOnly
, but yeah currently every change triggers a save action. For local changes this is relatively immaterial, but for remote board servers it could get a bit chatty. We currently debounce the save so that we wait for a bit before attempting it just in case we get a burst of activity in a short space of time.
ok, let's try it :D
Especially with the larger graphs, the default starting view is too zoomed out, and it's cumbersome to keep zooming in every time I reload the page (especially noticeable in vite autoreload)
Also wondering if we coul remember the last position of the node in the board, so that restoring/reloading brings you right where it was. Maybe this could be in the graph metadata? I could write an API.