Skip to content

feat(email): allow editing and sending email drafts when there is no thread#1005

Merged
dev-rb merged 34 commits intomainfrom
rahul/fix-editing-email-draft-with-no-thread
Jan 15, 2026
Merged

feat(email): allow editing and sending email drafts when there is no thread#1005
dev-rb merged 34 commits intomainfrom
rahul/fix-editing-email-draft-with-no-thread

Conversation

@dev-rb
Copy link
Copy Markdown
Contributor

@dev-rb dev-rb commented Jan 14, 2026

Summary

This PR adds the ability to edit and send a draft created during the email compose step. Going to "Email" and filtering by drafts, you can open the draft in the email thread view and edit the draft and send from there.

TODO in a separate PR:

  • Refactor email/draft form management
  • Consolidate draft collection and saving logic

Screenshots, GIFs, and Videos

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 14, 2026

@dev-rb dev-rb marked this pull request as ready for review January 15, 2026 16:14
@dev-rb dev-rb requested a review from a team as a code owner January 15, 2026 16:14
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jan 15, 2026

Code Review

Found 2 bugs that need to be fixed:

Issue 1: Missing assignment in createEmailFormState.ts

Location: js/app/packages/block-email/component/createEmailFormState.ts line 82

The return value of getDraftForMessageReply is not being assigned to the draft variable.

Current:

} else if (purpose?.type === 'replying_to') {
  options?.getDraftForMessageReply(purpose?.messageID);
}

Should be:

} else if (purpose?.type === 'replying_to') {
  draft = options?.getDraftForMessageReply(purpose?.messageID);
}

Impact: When replying to a message, any existing draft data (body, subject, recipients, attachments) will not be loaded.

Code context


Issue 2: Incorrect null check in EmailInput.tsx

Location: js/app/packages/block-email/component/EmailInput.tsx line 45

Using !== null instead of != null for an optional prop.

Current:

isEditingExisting={props.replyingTo() == null && props.draft !== null}

Should be:

isEditingExisting={props.replyingTo() == null && props.draft != null}

Impact: The condition will incorrectly evaluate to true when draft is undefined, causing isEditingExisting to be true even when there's no draft.

Code context

@peterchinman
Copy link
Copy Markdown
Contributor

three different drafts got saved?
CleanShot 2026-01-15 at 14 49 10@2x

@dev-rb dev-rb merged commit f5ec767 into main Jan 15, 2026
21 checks passed
@dev-rb dev-rb deleted the rahul/fix-editing-email-draft-with-no-thread branch January 15, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants