Separate document and document view stores
I think it would be nice if the current DocumentStore
would be split in:
-
DocumentStore
, containing just the open document. -
DocumentViewStore
, containing view state for the open document (currently onlyfocus
, but in the future viewport, zoom, etc).
Let's ignore undo/redo here.
I tried this, but didn't succeed because of the following.
Issue: auto-focus on added member
After adding a member, focus should be on that member. I would imagine that both stores listen for ADD_MEMBER
actions and DocumentViewStore
could gently wait for the member to be created using waitFor([
DocumentStore])
before setting the focus. However, DocumentViewStore
has no way of knowing the key of the added member.
I don't think it's a good thing to trigger some SET_FOCUS
action from the DocumentStore
after adding the member (perhaps it's not even possible with our dispatcher). Workaround would be to keep a lastAddedMember
key in DocumentStore
for the DocumentViewStore
to read, but that doesn't feel right.