Skip to content

Commit 35d140f

Browse files
fix(notify): optimize developer notification card copy and button layout (#1129)
- Use distinct symbols for steps (❶❷❸) vs rewards (✅) to avoid confusion - Clarify points-to-credits conversion (up to 2000 pts = $20 nexu credits) - Fix "Github" → "GitHub"; remove dangling "详情请看群公告" - PR card: developer-facing title; add 24h review SLA in transition copy - Issue card: standardize field labels to Chinese (提交者/标签/描述) - Both cards: 3 footer buttons (Good First Issue / 贡献者指南 / 查看全部 Issue) - Update test assertions to match new copy Made-with: Cursor Co-authored-by: caiqiling958-cmd <>
1 parent 4c9bd2d commit 35d140f

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

scripts/notify/developer-notify.mjs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const CONTRIBUTOR_GUIDE_URL = "https://docs.nexu.io/zh/guide/first-pr";
44
const GOOD_FIRST_ISSUE_URL =
55
"https://github.com/nexu-io/nexu/labels/good-first-issue";
6+
const ALL_ISSUES_URL = "https://github.com/nexu-io/nexu/issues";
67
const WEBHOOK_TIMEOUT_MS = 30_000;
78

89
function createTimeoutSignal(timeoutMs) {
@@ -126,11 +127,12 @@ function createButtonColumns(actions) {
126127

127128
function createRewardCopy() {
128129
return [
129-
"只需 3 步💥,1️⃣选任务 2️⃣ 认领 3️⃣ 提交",
130-
"🎁 即可同时获得以下奖励🎉 (详情请看群公告)",
131-
"1️⃣ 最高价值 20 美金的 nexu 使用额度积分奖励",
132-
"2️⃣ GitHub README 公开致谢",
133-
"3️⃣ Github 社区徽章。",
130+
"只需 3 步💥:❶ 选任务 ❷ 认领 ❸ 提交 PR",
131+
"",
132+
"🎁 合并后即可获得以下奖励:",
133+
"✅ 最高 2000 积分,可兑换价值 $20 的 nexu 使用额度",
134+
"✅ GitHub README 贡献者公开致谢",
135+
"✅ GitHub 社区徽章",
134136
].join("\n");
135137
}
136138

@@ -145,7 +147,7 @@ export function buildDeveloperPrPayload({ author, labels, prUrl }) {
145147
header: {
146148
title: {
147149
tag: "plain_text",
148-
content: "🎉 又新增 1 位贡献者给 Nexu 提 PR 啦~ 立即派出奖励💰!",
150+
content: "🎉 又有新贡献者给 Nexu 提 PR 啦!你也来试试?",
149151
},
150152
template: "purple",
151153
},
@@ -160,13 +162,14 @@ export function buildDeveloperPrPayload({ author, labels, prUrl }) {
160162
{
161163
tag: "markdown",
162164
content: [
163-
"Nexu 准备好一批对新手友好任务的 Good First Issue 👇",
165+
"Nexu 还准备了一批新手友好的 Good First Issue 等你来领 👇 提交后 24 小时内审核回复",
164166
createRewardCopy(),
165167
].join("\n"),
166168
},
167169
createButtonColumns([
170+
createButton("Good First Issue", GOOD_FIRST_ISSUE_URL),
168171
createButton("贡献者指南", CONTRIBUTOR_GUIDE_URL),
169-
createButton("立即贡献", GOOD_FIRST_ISSUE_URL),
172+
createButton("查看全部 Issue", ALL_ISSUES_URL),
170173
]),
171174
],
172175
},
@@ -202,7 +205,7 @@ export function buildDeveloperIssuePayload({
202205
elements: [
203206
{
204207
tag: "markdown",
205-
content: `**标题:** ${safeTitle}\n**Author:** ${safeAuthor}\n**Labels:** ${safeLabels}\n**Bug description:** ${safeBody}`,
208+
content: `**标题:** ${safeTitle}\n**提交者:** ${safeAuthor}\n**标签:** ${safeLabels}\n**描述:** ${safeBody}`,
206209
},
207210
createButtonColumns([
208211
createButton("查看 issue", issueUrl, "primary"),
@@ -212,8 +215,9 @@ export function buildDeveloperIssuePayload({
212215
content: createRewardCopy(),
213216
},
214217
createButtonColumns([
215-
createButton("领取新手友好 issue", GOOD_FIRST_ISSUE_URL),
218+
createButton("Good First Issue", GOOD_FIRST_ISSUE_URL),
216219
createButton("贡献者指南", CONTRIBUTOR_GUIDE_URL),
220+
createButton("查看全部 Issue", ALL_ISSUES_URL),
217221
]),
218222
],
219223
},

tests/notify/developer-notify.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe("developer-notify", () => {
3535
prUrl: "https://github.com/nexu-io/nexu/pull/10",
3636
});
3737

38-
expect(payload.card.header.title.content).toContain("新增 1 位贡献者");
38+
expect(payload.card.header.title.content).toContain("又有新贡献者给 Nexu 提 PR");
3939
expect(payload.card.body.elements[0]).toMatchObject({
4040
tag: "markdown",
4141
content: expect.stringContaining("**Author:** alice"),
@@ -64,10 +64,10 @@ describe("developer-notify", () => {
6464
payload.card.body.elements[3].columns.map(
6565
(column) => column.elements[0].text.content,
6666
),
67-
).toEqual(["贡献者指南", "立即贡献"]);
67+
).toEqual(["Good First Issue", "贡献者指南", "查看全部 Issue"]);
6868
expect(payload.card.body.elements[2]).toMatchObject({
6969
tag: "markdown",
70-
content: expect.stringContaining("只需 3 步💥,1️⃣选任务 2️⃣ 认领 3️⃣ 提交"),
70+
content: expect.stringContaining("只需 3 步💥:❶ 选任务 ❷ 认领 提交 PR"),
7171
});
7272
});
7373

@@ -76,7 +76,7 @@ describe("developer-notify", () => {
7676
issueUrl: "https://github.com/nexu-io/nexu/issues/99",
7777
});
7878

79-
expect(payload.card.header.title.content).toContain("刚新增 1 条 issue");
79+
expect(payload.card.header.title.content).toContain("刚新增 1 条 issue 等你来领取");
8080
expect(payload.card.body.elements[1]).toMatchObject({ tag: "column_set" });
8181
expect(
8282
payload.card.body.elements[1].columns.map(
@@ -88,11 +88,11 @@ describe("developer-notify", () => {
8888
payload.card.body.elements[3].columns.map(
8989
(column) => column.elements[0].text.content,
9090
),
91-
).toEqual(["领取新手友好 issue", "贡献者指南"]);
91+
).toEqual(["Good First Issue", "贡献者指南", "查看全部 Issue"]);
9292
expect(payload.card.body.elements[2]).toMatchObject({
9393
tag: "markdown",
9494
content: expect.stringContaining(
95-
"1️⃣ 最高价值 20 美金的 nexu 使用额度积分奖励",
95+
"✅ 最高 2000 积分,可兑换价值 $20 nexu 使用额度",
9696
),
9797
});
9898
});

0 commit comments

Comments
 (0)