Skip to content

Improve draft logic and enable draft resume on startup#2057

Merged
hjiangsu merged 1 commit intodevelopfrom
feat/restore-post-comment-creation
Feb 20, 2026
Merged

Improve draft logic and enable draft resume on startup#2057
hjiangsu merged 1 commit intodevelopfrom
feat/restore-post-comment-creation

Conversation

@hjiangsu
Copy link
Member

Pull Request Description

This PR improves on the existing draft logic and enables drafts to be resumed at startup when Thunder is killed. Additionally, some of the draft logic was re-worked and consolidated:

  • Added a startup method which automatically opens the create post/comment page if a draft was in-progress when Thunder is killed
  • Added additional fields to Draft table (active, accountId, nsfw, languageId). The active field indicates the draft that is currently being edited and is used to restore the draft on startup
  • Added DraftRepository to move and consolidate database-related logic

For the create post/comment pages, the old draft timer logic was also replaced with a debounce logic. Additionally, Thunder should now save the draft state when the AppLifecycleState changes (e.g., when Thunder is backgrounded). These two changes should help reduce cases of lost in-progress work.

Issue Being Fixed

Issue Number: #2050

Screenshots / Recordings

Checklist

  • If a new package was added, did you ensure it uses an appropriate license and is actively maintained?
  • Did you use localized strings (and added appropriate descriptions) where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@hjiangsu hjiangsu merged commit b7b0d94 into develop Feb 20, 2026
1 check passed
@hjiangsu hjiangsu deleted the feat/restore-post-comment-creation branch February 20, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant