Skip to content

Commit fe001f2

Browse files
committed
fix(mail): remove tip key from default draft-saved envelope
Remove tip field from buildDraftSavedOutput's returned map and flip the test assertions in TestBuildDraftSavedOutputIncludesReferenceOnlyWhenPresent to require tip absence. The compose-family default envelope (+send / +reply / +reply-all / +forward) now stays within the 3-key contract (compose_hint / draft_id / reference) defined in tech-design v1 §4.1.5. hintSendDraft already writes the equivalent guidance to stderr, so no UX regression — the message reaches the user via the dedicated stderr hint channel instead of the structured stdout envelope. sprint: S3
1 parent b919e00 commit fe001f2

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

shortcuts/mail/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2193,9 +2193,9 @@ func buildDraftSendOutput(resData map[string]interface{}, mailboxID string) map[
21932193
// buildDraftSavedOutput formats a successful drafts.create / drafts.update
21942194
// response into the public output map (draft_id + optional preview URL).
21952195
func buildDraftSavedOutput(draftResult draftpkg.DraftResult, mailboxID string) map[string]interface{} {
2196+
_ = mailboxID // retained for caller-signature compatibility; default envelope no longer emits a tip key
21962197
out := map[string]interface{}{
21972198
"draft_id": draftResult.DraftID,
2198-
"tip": fmt.Sprintf(`draft saved. To send: lark-cli mail user_mailbox.drafts send --params '{"user_mailbox_id":"%s","draft_id":"%s"}'`, mailboxID, draftResult.DraftID),
21992199
}
22002200
if draftResult.Reference != "" {
22012201
out["reference"] = draftResult.Reference

shortcuts/mail/mail_send_confirm_output_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ func TestBuildDraftSavedOutputIncludesReferenceOnlyWhenPresent(t *testing.T) {
8787
if withReference["reference"] != "https://www.feishu.cn/mail?draftId=draft_001" {
8888
t.Fatalf("reference = %v", withReference["reference"])
8989
}
90-
if withReference["tip"] == "" {
91-
t.Fatalf("tip should be populated")
90+
if _, ok := withReference["tip"]; ok {
91+
t.Fatalf("tip should be omitted from default envelope, got %#v", withReference["tip"])
9292
}
9393

9494
withoutReference := buildDraftSavedOutput(draftpkg.DraftResult{
@@ -100,8 +100,8 @@ func TestBuildDraftSavedOutputIncludesReferenceOnlyWhenPresent(t *testing.T) {
100100
if _, ok := withoutReference["reference"]; ok {
101101
t.Fatalf("reference should be omitted, got %#v", withoutReference["reference"])
102102
}
103-
if withoutReference["tip"] == "" {
104-
t.Fatalf("tip should be populated")
103+
if _, ok := withoutReference["tip"]; ok {
104+
t.Fatalf("tip should be omitted from default envelope, got %#v", withoutReference["tip"])
105105
}
106106
}
107107

0 commit comments

Comments
 (0)