Repository navigation
Keep a stashed draft's photos and poll - #96
Merged
Merged
Conversation
The stash only held the body, so closing the composer sheet threw away its photos (deleting them from the phone) and its poll. Each draft now keeps its photos with their descriptions and its poll with its length, and the sheet opens on all of it again. Photos stay on the phone while a stashed draft or an outbox commit holds them, rather than going after a day. Drop, sign-out and the 50-draft limit delete them. A reply's draft is shared with the commit page's reply bar, so the bar now shows "N photos" under the field when the draft has some. Tapping it opens the sheet, and Reply from the bar sends them. Cancel on Android also hands the draft back to the bar now, since Android never reports that the sheet has gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The stash only kept a draft's text. Closing the composer sheet threw away its photos, deleting them from the phone, and its poll. Now a draft keeps its photos (with their descriptions) and its poll (with its length), and the sheet opens on all of it again, marked stash@{0}. The web stashes photos too. It doesn't stash polls, but losing a half-written poll was the same complaint, so the app keeps them.
How it works:
Stashstores aStashedDraft(body, photos, poll, poll length) instead of a string. A draft kept as a plain string before this still reads as text.DraftImagesused to delete every photo older than a day. Now it skips any photo a stashed draft or an outbox commit still holds, so a stashed photo isn't lost overnight. Photos nothing holds still go after a day./featureor/bugissue deletes its photos, since the issue doesn't take them.The reply bar shares its draft with the reply sheet, so it now has to deal with photos. When the draft has some, a row under the field says "1 photo" or "2 photos" and opens the sheet when tapped, and Reply from the bar sends them with the text. A reply from the bar that devnull turns down comes back to the bar with its photos.
One fix along the way: on Android, Cancel in the reply sheet never handed the draft back to the bar, because Android doesn't send
@dismisswhen PHP closes the sheet. The bar kept its old text, and typing there overwrote what you'd written in the sheet. With photos in the draft that would have lost them, sohideCommitSheet()now hands the draft back straight away.Things to look at:
forgetAttachments()no longer deletes photos unless asked. Every way photos leave a draft (✕ on a photo, drop, sent, issue, sign-out, eviction) now deletes them explicitly, or hands them to the outbox.Screenshots
Android only. These were taken on an emulator against a local devnull API with seeded data. iOS is missing because I couldn't drive a simulator for it in this session.
compose: New commit: write some text, attach a photo, Cancel, open the composer again.
quote-poll: Quote with a poll: write a take, add a poll with two options, Cancel, quote again. The after shot is also after force-quitting the app.
reply-bar: Reply bar: type a reply, expand it, attach a photo in the sheet, press Back.
🤖 Generated with Claude Code