laravel-schematics
laravel-schematics copied to clipboard
[Feature] Make layout persistent
Thanks for your time! Nice work!
Would be nice to have a persistent layout (diagram).
- Open http://localhost:8080/schematics
- Move around some objects
- Open a icognito browser http://localhost:8080/schematics
- Diagram layout has lost.
Hi again @robsontenorio! :)
Thanks!
The diagram saving relies on the localStorage which gets lost when you open a incognito screen. You could use the export / import to restore it though.
Maybe in the future I could save the diagrams somewhere else so they'll go along with incognito or browser switching. I'll have to think of a implementation.
I think you could use a database, or Redis to save the layout.
@ArtNous Yeah, could definitely be an option. I went for localStorage to make it the least "intrusive" as it could be.
Thinking about it I'm actually leaning towards using backend caching.
Will be a heavy change since pretty much everything you do gets stored in it (dragging positions etc.)
You could keep all current logic using localStorage. But just send back to backend and save all changes on dedicated table.
In fact would be necessary to have a persitent mechanism, like a table.
EDIT: or maybe a simple file on proper location.
That's right, It would be a big change, but I think it is necessary, we're here to support and help.
Thanks guys! All contributions will be fully credited of course. Just have to make a nice section for it in the README as I didn't thought this would happen so fast. :)
I'll take the suggestions with me.
At the moment I'm working on a "hybrid" solution for this. I'm thinking of a save button in the right upper corner which will cache the localStorage. With that, if the localStorage is empty, it could fill it with it. This way we'll prevent a request bombardment. :)