From d5b884f07423e311eca8f052b6ced71fab6404bd Mon Sep 17 00:00:00 2001 From: AutoGenUI <231675956+AutoGenUI@users.noreply.github.com> Date: Tue, 13 Oct 2026 20:37:00 +0800 Subject: [PATCH] Release test identities safely and unify subscription card order --- AGENTS.md | 19 ++- components/news/subscription.tsx | 28 ++-- docs/CURRENT_STATE.json | 66 ++++++++ docs/PROJECT_CONTEXT.md | 14 +- .../2026-10-13-normal-subscription.md | 54 +++++++ docs/operations/email-subscriptions.md | 24 ++- lib/news/api.ts | 2 +- lib/news/mail.ts | 64 ++++++-- public/automation.md | 14 +- tests/news.test.mjs | 145 +++++++++++++++++- tests/rendered-html.test.mjs | 4 +- 11 files changed, 390 insertions(+), 44 deletions(-) create mode 100644 docs/iterations/2026-10-13-normal-subscription.md diff --git a/AGENTS.md b/AGENTS.md index 9a3e3d9..187a904 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,9 +45,22 @@ public engineering records with dated evidence, not live configuration. cycle only through fresh valid consent and monotonically newer link clocks; never use public signup to revive suppressed/test identities, historical hard failures or unknown submissions. Do not reset quotas or purchase allowance. - Keep provider submission - distinct from delivery and inbox acceptance. Candidate details are in - [the subscription iteration](docs/iterations/2026-10-13-subscription-polish.md). + A separately authorized owner `mail-test release` may remove only the + server-configured test role after an exact normalized `expectedRecipient` + check. It sends no mail, preserves history and rotates signed-link clocks, + leaving an ordinary unsubscribed recipient who must sign up and confirm + again. It cannot lift suppression, bypass uncertain submissions, reset + quotas, automatically subscribe or choose a sending target. Public signup + cannot perform this release; editorial schedules must never call it. + Keep provider submission distinct from delivery and inbox acceptance. +- Current subscription layout is introduction, capacity, unified feedback, + action form, cancellation/unsubscribe, then privacy. Keep feedback above + the actions it explains across signup and signed management states. + Current candidate details are in + [the normal subscription iteration](docs/iterations/2026-10-13-normal-subscription.md); + [the v14 iteration](docs/iterations/2026-10-13-subscription-polish.md) + records the previous layout and deployment. Do not predeclare deployment, + recipient release or a v1.0.1 tag before their actual evidence/authorization. - Preserve accurate tracking and network disclosures. Anonymous Brevo tracking is not proof that pixels/rewritten links are disabled. Mainland accessibility is not guaranteed. diff --git a/components/news/subscription.tsx b/components/news/subscription.tsx index 1c0dcbf..bc0c0c6 100644 --- a/components/news/subscription.tsx +++ b/components/news/subscription.tsx @@ -35,7 +35,6 @@ function SubscriptionView({ locale, initialLink, onManagementUrl }: { onManagementUrl: (id: string, token: string) => void; }) { const zh = locale === "zh"; - const [confirmationLanding] = useState(initialLink?.action === "confirm"); const [autoAttempted, setAutoAttempted] = useState(false); const [manage, setManage] = useState(initialLink), [subscriber, setSubscriber] = useState(null), @@ -266,7 +265,18 @@ function SubscriptionView({ locale, initialLink, onManagementUrl }: {

{manage ? zh ? "你的邮件订阅" : "Your email subscription" : zh ? "每周精选,送达邮箱。" : "A weekly perspective, by email."}

{zh ? "选择语言与主题,精选事件与研究。仅在有实质更新时发送。" : "Choose a language and topics for selected events and research. No empty editions."}

- {!confirmationLanding && form} +
+ {capacity ? <> +
+
{zh ? "已确认订阅 / 当前容量" : "Confirmed / capacity"}{capacity.confirmedCount} / {capacity.capacity}{zh ? "位订阅者 · 本站设置" : "subscribers · site limit"}
+ {capacity.full ? zh ? "名额已满" : "Capacity reached" : zh ? `剩余 ${capacity.remaining} 个名额` : `${capacity.remaining} places remaining`} +
+ +

{zh ? `仅确认成功占名额。免费限额 ${capacity.dailyLimit} 封/天,周报预算 ${capacity.weeklyLimit} 封/天;确认邮件共用额度,投递可能延迟。` : `Only confirmed subscriptions occupy places. Daily allowance: ${capacity.dailyLimit} emails, including confirmations; digest budget: ${capacity.weeklyLimit}/day. Delivery may be delayed.`}

+ :

{capacityState === "loading" ? zh ? "正在读取已确认人数与剩余名额…" : "Loading confirmed subscribers and remaining places…" : zh ? "订阅人数暂时未知,请重试读取。" : "Subscriber counts are temporarily unknown. Please retry."}

} + {capacityState === "error" &&

{zh ? "名额未能更新,数字为上次结果;仍可管理已生效订阅。" : "Availability failed to refresh; figures are from the last check. Active subscriptions remain manageable."}

} + +
{display && (() => { const [icon, title, body] = content(display); return
@@ -280,20 +290,8 @@ function SubscriptionView({ locale, initialLink, onManagementUrl }: {
; })()} - {confirmationLanding && form} + {form} {manage && !confirmationMode && (subscriber?.status === "confirmed" || subscriber?.status === "pending") &&

{zh ? "取消邮件订阅" : "Cancel email updates"}

{zh ? "停止后续邮件;仍可使用 RSS。" : "Stop future email. RSS remains available."}

} -
- {capacity ? <> -
-
{zh ? "已确认订阅 / 当前容量" : "Confirmed / capacity"}{capacity.confirmedCount} / {capacity.capacity}{zh ? "位订阅者 · 本站设置" : "subscribers · site limit"}
- {capacity.full ? zh ? "名额已满" : "Capacity reached" : zh ? `剩余 ${capacity.remaining} 个名额` : `${capacity.remaining} places remaining`} -
- -

{zh ? `仅确认成功占名额。免费限额 ${capacity.dailyLimit} 封/天,周报预算 ${capacity.weeklyLimit} 封/天;确认邮件共用额度,投递可能延迟。` : `Only confirmed subscriptions occupy places. Daily allowance: ${capacity.dailyLimit} emails, including confirmations; digest budget: ${capacity.weeklyLimit}/day. Delivery may be delayed.`}

- :

{capacityState === "loading" ? zh ? "正在读取已确认人数与剩余名额…" : "Loading confirmed subscribers and remaining places…" : zh ? "订阅人数暂时未知,请重试读取。" : "Subscriber counts are temporarily unknown. Please retry."}

} - {capacityState === "error" &&

{zh ? "名额未能更新,数字为上次结果;仍可管理已生效订阅。" : "Availability failed to refresh; figures are from the last check. Active subscriptions remain manageable."}

} - -

{zh ? "邮件由 Brevo 投递。当前匿名打开与点击统计不关联具体联系人,但仍可能包含像素与链接跟踪;本站不依据这些统计决定发信或判断已读。" : "Email is delivered by Brevo. Anonymous open and click statistics are not associated with individual contacts, but tracking pixels and tracked links may remain. We do not use these statistics to decide whether to send email or as proof that an email was read."}