Repository navigation
Support Gmail send-as identities and reply sender defaults - #156
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c71d506355
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (input.senderEmail !== undefined) { | ||
| db.prepare('UPDATE outbox SET sender_email = ? WHERE account_id = ? AND id = ?').run( | ||
| normalizeEmailKey(input.senderEmail) === normalizeEmailKey(accountId) ? null : input.senderEmail, | ||
| accountId, | ||
| id | ||
| ) |
There was a problem hiding this comment.
Preserve sender-only reply edits on close
When a reply or reply-all has no user edit except choosing another From address, this stores sender_email and increments the revision, but shouldMirrorDraft still classifies the draft as untouched because isUntouchedThreadDraft ignores the sender and only interprets later revisions for forwards. Save & close therefore takes closeDraft's discarded branch, deleting the local row—and any mirrored Gmail draft—so the selected identity does not survive restart or draft sync.
Useful? React with 👍 / 👎.
| fromName: 'Me', | ||
| fromEmail: account ?? accountId, | ||
| fromEmail: row.sender_email ?? account ?? accountId, |
There was a problem hiding this comment.
Treat confirmed alias messages as self-authored
For a reply or forward sent through an alias, the pending projection now carries the alias address while labeling it Me, but once Gmail's confirmed message replaces that projection, readConversation recognizes only the account's primary address as self-authored. The same message consequently changes from Me to the alias display name after synchronization; confirmed messages from cached send-as identities need the same self-address treatment.
Useful? React with 👍 / 👎.
| const identity = resolveSendAs(this.db, row.account_id, senderEmail) | ||
| const accountName = | ||
| senderEmail === row.account_id | ||
| ? await this.senderDisplayName(row.account_id, provider, signal) | ||
| : (identity.displayName ?? '') |
There was a problem hiding this comment.
Refresh the primary identity before reading Reply-To
On a fresh or upgraded profile without a cached sendAsIdentities value, resolveSendAs returns the synthesized primary identity without its configured Reply-To. senderDisplayName may then successfully refresh the full send-as list, but options.replyToAddress is still read from the stale object, so that first primary-address message omits the configured Reply-To and responses can go to the wrong mailbox. Resolve the identity again after the refresh, or refresh before resolving it.
Useful? React with 👍 / 👎.
Attn currently sends only from the signed-in account's primary address. This change adds a From menu for verified Gmail “Send mail as” identities in new messages and inline replies, including external addresses configured through Gmail.
New messages use the cached Gmail default identity. Replies and forwards preserve an owned From address or match the source message's To, Cc, then Bcc addresses. If none match, they use the default identity. The initial signature follows that choice; manually changing From preserves the existing body and signature.
The selected identity survives autosave, restart, Gmail draft sync, undo-send, and send recovery. Outgoing messages use its display name and Reply-To. Replies exclude verified aliases from self-recipients. A revoked identity produces an error instead of silently switching senders.
The picker uses Attn's theme colors and supports keyboard navigation. Schema version 30 adds the sender address through an automatic migration that preserves existing drafts. Identity management and SMTP configuration remain in Gmail.
Validation
npm run verifypassed: type checks, lint, 1,667 unit tests, production build, and 392 E2E tests.The previously observed window-reopen focus test passed in this full run.