Repository navigation
fix: keep the composer draft when the commit dialog closes - #502
Open
SanderMuller wants to merge 2 commits into
Open
SanderMuller wants to merge 2 commits into
SanderMuller wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closing the commit dialog remounted the log composer, through a counter used as its
key. That remount dropped everything but the stored body: the poll, the schedule, the link card choice and the issue command. A body with a secret went too, because it is never stored. For example: start a poll on the log, scroll down, pressc, close the dialog, and the poll is gone.Now the log composer and the dialog share one live draft in memory, so a close needs no remount:
useStashshares the body, like the draft images already do. Storage is unchanged, so a secret is still never written. Once no composer shows the draft, the body is read from storage again.useDraftPartshares the rest, including the "restored draft" label and the pending issue request. So the other composer cannot open the same issue twice.Reply, quote and remote composers now also share a live body per commit or conversation.
The new cases in
DraftStash.test.tsxandComposerDraft.test.tsxfail onproduction. In Chrome, a close keeps the poll and the scroll position. A post from the dialog empties the log composer and takes it out of preview.#451 also changes the composer, so one of the two may need a small rebase.
🤖 Generated with Claude Code