Skip to content

fix: keep the composer draft when the commit dialog closes - #502

Open
SanderMuller wants to merge 2 commits into
dev-null-sh:productionfrom
SanderMuller:fix/composer-dialog-keeps-draft
Open

SanderMuller wants to merge 2 commits into
dev-null-sh:productionfrom
SanderMuller:fix/composer-dialog-keeps-draft

Conversation

@SanderMuller

Copy link
Copy Markdown
Contributor

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, press c, 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:

  • useStash shares 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.
  • useDraftPart shares the rest, including the "restored draft" label and the pending issue request. So the other composer cannot open the same issue twice.
  • A post or drop in one composer resets the other, preview mode included.

Reply, quote and remote composers now also share a live body per commit or conversation.

The new cases in DraftStash.test.tsx and ComposerDraft.test.tsx fail on production. 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

SanderMuller and others added 2 commits October 18, 2026 22:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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