Currently there is a single shared non-persisted "store" for all post composers (usePostStore). This should be changed to a persisted unshared store (with createPersistedTrackedStore) that holds a map of post drafts.
Opening a composer (NewPublication) should automatically generate a new uuid and create a draft in the persisted post store. The draft uuid should be used as the post metadata id.
The draft should keep track of the state currently in usePostStore as well as all uploaded attachments from usePostAttachmentStore. It must also save the state of the attachment metadata, like title, artist, poster for Audio and state from usePostVideoStore.
The user should be able to view all drafts, open one to edit/publish, and delete.
Drafts should automatically be deleted when the post is published.
Drafts should include a reference to any quoted post, selected group, and parent post.
When opening a draft, if the context doesn't match the current location of the NewPublication component, a new modal should be used. For example, if a user drafts a post for the group "Lens", then later opens that draft in the context of a comment on a post not in the "Lens" group, a new modal should be used, rather than resuming the draft as the comment.
Drafts should be autosaved after a few seconds of being idle (using a debounced input listener).
Currently there is a single shared non-persisted "store" for all post composers (
usePostStore). This should be changed to a persisted unshared store (withcreatePersistedTrackedStore) that holds a map of post drafts.Opening a composer (
NewPublication) should automatically generate a new uuid and create a draft in the persisted post store. The draft uuid should be used as the post metadataid.The draft should keep track of the state currently in
usePostStoreas well as all uploaded attachments fromusePostAttachmentStore. It must also save the state of the attachment metadata, liketitle,artist,posterfor Audio and state fromusePostVideoStore.The user should be able to view all drafts, open one to edit/publish, and delete.
Drafts should automatically be deleted when the post is published.
Drafts should include a reference to any quoted post, selected group, and parent post.
When opening a draft, if the context doesn't match the current location of the
NewPublicationcomponent, a new modal should be used. For example, if a user drafts a post for the group "Lens", then later opens that draft in the context of a comment on a post not in the "Lens" group, a new modal should be used, rather than resuming the draft as the comment.Drafts should be autosaved after a few seconds of being idle (using a debounced input listener).