calband / calchart-redesign

Calchart 4 for the web! 🌐
https://calband.github.io/calchart-redesign/
4 stars 0 forks source link

Need to have a currentlyEditingSheet property of a show #31

Open rmpowell77 opened 4 years ago

rmpowell77 commented 4 years ago

I think we're going to need a currentlyEditingSheet property on the Show model. This will allow us to know what sheet the grapher is currently on so we can have the grapher show that sheet.

MichaelTamaki commented 4 years ago

Maybe not in models (Show model), as we don't need to save currentlyEditingSheet in the show file we are saving. This should be similar to fourStepGrid, where it is kept in the global state, but not something that we need to save. https://github.com/calband/calchart-redesign/blob/master/src/store/index.ts#L13

MichaelTamaki commented 4 years ago

This would be a good issue to actually build out the UI for this as well in the Left Menu. Maybe something simple for now like a number input that controls what StuntSheet is currently being shown.

rmpowell77 commented 4 years ago

With CalChart v3 we found that saving the sheet you were editing was really helpful; if you save, quit, then re-open, you would always start at sheet 1. So the sheet that you are currently editing is actually part of the show editing state that should probably be saved.

Imagine if you were editing a super big document with 100s of pages... if you closed the document and then had to start at the beginning that would be really painful. Saving where you were last editing is a very nice feature, so I would contend that the page currently being edited is part of the show.

MichaelTamaki commented 4 years ago

Yeah, that's true that it'd be very helpful to be save that sort of stuff... Were there other things related to viewing the Show that was saved as well? Maybe some of the undo state?

I'm thinking about making a new model for viewing related data we need to save like currentlyEditingSheet and others. What do you think?

MichaelTamaki commented 4 years ago

After thinking about this some more, I think we should do the following:

I am thinking about the following use case for a STUNT member:

And for a regular bandsmen:

If we follow through with this, it changes the scope of the issue.

rmpowell77 commented 4 years ago

That sounds like a great plan! The idea being per person edit information gets stored in HTML LocalStorage, and the show itself goes somewhere else.

I think maybe there are two types of local storage: Per Show and All Shows.

All Show editing are the things that need to persist across editing several shows. Some people may not want to have 2 step spacing on for their type of editing, so that becomes a All Shows setting, that just gets applied in general to all the show editing. Field color would fall into this.

The per show local storage would include things like what page you're editing, what points are selected).

So we should have this setting be part of a local storage, and have that persist across opening and closing of shows

MichaelTamaki commented 4 years ago

:+1: For now, let's just keep currentlyEditingSheet in the state, and then let's deal with saving the per show and all show settings to local storage in a different issue.

rmpowell77 commented 4 years ago

One more thing about currently editing sheet; because different shows have different states, and people could be editing several shows at once, we actually need a per-sheet local storage. Maybe a table indexed by show?

And perhaps because each show could have the same title (default, if you just use the basic one), maybe we need a UUID scheme for each show so they are in fact unique -- don't rely on "title" as being the unique key.

MichaelTamaki commented 4 years ago

Oh interesting. I was just thinking of only maintaining state of whatever show was last being worked on. This sounds like a good suggestion. Maybe we can split this up into 2 issues?

  1. Save state of the last show opened
  2. Save state of every show that has been opened in the past

Also, when the time comes, it’ll be interesting to see if we can properly open two different tabs, each with a different show. Will have to test in the future.