feat: append default mail send signatures#1341
Conversation
Add send-only default signature lookup with --no-signature opt-out and plain-text signature rendering. sprint: S1
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds automatic default send signature selection to mail send with a ChangesDefault Send Signature with Plain-Text Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@77d4383742080bbfe4e72d38b1a5147a0e5470a1🧩 Skill updatenpx skills add bubbmon233/cli#feat/eb56b12 -y -g |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shortcuts/mail/signature_compose.go`:
- Around line 176-220: In appendHTMLNodeText, skip non-rendered elements so
their contents are not included in the plain-text output: detect element tags
like "style", "script", "noscript", and "template" (inside the
nethtml.ElementNode switch in appendHTMLNodeText) and simply return without
descending into children; this prevents the recursive fallback from walking into
those nodes and emitting their literal text.
- Around line 98-107: resolveDefaultSendSignatureID currently only considers the
caller-provided senderEmail and mailboxID, so when senderEmail is empty it never
falls back to the primary send-as address; update resolveDefaultSendSignatureID
to first resolve the primary sender (call resolveSenderInfo or equivalent to
obtain the sender email when senderEmail == "") before building candidates, then
pass that resolved email (plus mailboxID handling as before) into
defaultSendSignatureIDFromUsages; keep the existing signature.ListAll call and
error handling and only change how candidates is populated.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7a111deb-0902-43ac-8476-d55e92318dd4
📒 Files selected for processing (5)
shortcuts/mail/mail_send.goshortcuts/mail/mail_send_signature_test.goshortcuts/mail/signature_compose.goskills/lark-mail/references/lark-mail-send.mdskills/lark-mail/references/lark-mail-signature.md
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1341 +/- ##
==========================================
+ Coverage 71.58% 71.63% +0.05%
==========================================
Files 689 689
Lines 65521 65666 +145
==========================================
+ Hits 46901 47042 +141
+ Misses 14972 14969 -3
- Partials 3648 3655 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…on-rendered nodes Address CodeRabbit review on PR larksuite#1341: - resolveDefaultSendSignatureID now falls back to the primary send-as address (via resolveSenderInfo) when senderEmail is empty, so the default signature is still matched. - appendHTMLNodeText skips script/style/head/template/noscript so their contents no longer leak into --plain-text signature output. Change-Type: ci-fix
Generated by the harness-coding skill.
Sprints
Source specs
This MR was created autonomously. Quality gates were enforced by the repo's own pre-commit hooks.
Summary by CodeRabbit
New Features
--no-signatureto skip automatic signature appending when sending mail.Improvements
--no-signatureand--signature-id.Documentation
Tests