feat: Improve UX creating, editing, and deleting drafts#2221
Merged
Conversation
244882e to
3ff28aa
Compare
This depends on breaking the link between network types and everything else.
wip: Send draft as ComposeOption, save draft in ComposeViewModel Make ComposeOptions mandatory Cleanup Use viewmodel's copy of content and contentwarning
- Use notifications to warn user if a draft has failed to send - Clear these notifications in DraftsActivity - Show any sending errors with more space, below the draft - Show the specific error message instead of a generic
If a ComposeActivity exists for a draft move it to the front when re-editing
- Provide checkboxes to select drafts - Selecting 1-N drafts switches to action mode - Shows count of selected drafts - Shows menu item to delete selected drafts - Deleting drafts with menu item shows alertdialog to confirm
Ensure the scheduled status ID is cleared properly if deleting a scheduled status before updating it.
db5d6ef to
eb220bb
Compare
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.
Previously,
ComposeActivitywas started with an optionalComposeOptionsand used that to create a draft as needed. The contentsof the draft (but not the draft itself) were sent to
SendStatusServicewhich constructed and sent the final status.
Change this to pass a draft as part of the
ComposeOptions, so it's theresponsibility of the calling code to create the initial draft. This
draft might be constructed from an existing saved draft, or created
specifically to send in
ComposeOptions.ComposeViewModelexplicitly saves the draft before passing it toSendStatusService, which now constructs the status to send from thedraft.
SendStatusServiceis responsible for deleting the draft if itis sent successfully, otherwise the draft is updated to record the
failure reason.
Access drafts through a new
DraftRepositoryand obsoleteDraftHelper.If a status fails to send the reason is recorded in
DraftEntityand anormal Android notification is shown. Tapping the notification launches
DraftsActivity.This obsoletes all the
DraftsAlertcode, which has been removed.User visible changes
the content, record the cursor position when saving a draft and restore
it when loading a draft.
are cancelled when the user opens the drafts screen.
the same draft twice the existing editor window will be brought to the
front.
(1) select the draft (possibly selecting multiple drafts), (2) tap a
"delete" button, and (3) confirm the deletion in a dialog.
can't be sent the draft is kept.