feat: post draft support with persisted store, autosave, and context-aware resumption#25
Draft
Copilot wants to merge 3 commits into
Draft
feat: post draft support with persisted store, autosave, and context-aware resumption#25Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Deploying palus with
|
| Latest commit: |
33c4e55
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://50a76e8c.palus.pages.dev |
| Branch Preview URL: | https://copilot-add-post-draft-suppo.palus.pages.dev |
…unced postContent in draft Agent-Logs-Url: https://github.com/iPaulPro/palus/sessions/6eb3e9b0-b334-4b50-8f3c-5f7b125fbb17
Copilot
AI
changed the title
[WIP] Add support for post drafts with persisted store
feat: post draft support with persisted store, autosave, and context-aware resumption
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the single shared non-persisted composer state with a persisted draft system. Drafts are keyed by UUID, autosaved on debounced input, deleted on publish, and opened in a context-aware modal when the draft's parent post/group doesn't match the current composer location.
New modules
types/draft.ts—PostDrafttype capturing all composer state.DraftAttachmentomits the non-serializableFilefield fromNewAttachment. IncludestoDraftAttachment/toNewAttachmentconverters.store/persisted/useDraftStore.ts—createPersistedTrackedStoreholdingRecord<string, PostDraft>withsaveDraft/removeDraftactions.store/non-persisted/modal/useDraftModalStore.ts— Controls the draft context-mismatch modal.components/Composer/DraftList.tsx— Renders saved drafts sorted byupdatedAt, with delete and context-aware open (matching context → main modal, mismatch → dedicated draft modal).Modified modules
NewPublication— Generates a draft UUID on mount (draftIdprop or new UUID). Autosaves via debounceduseEffect(1s text, 2s attachments/audio/poll). CallsremoveDraftinonCompleted.NewPost— Renders<DraftList>below the composer trigger.GlobalModals— Adds draft modal withDraftModalContentthat hydrates all post stores from the draft viauseEffect, then rendersNewPublicationwith the draft's group/parent context.data/storage.ts— AddsDraftStorekey.Draft state captured
Post content, attachments (sans
File), audio metadata (artist,title,cover), video thumbnail/duration, quoted post, parent post, group, content warning, poll config, collect action, license, and post rules.