From 66116873f8a62630e7f19b6d845a6ea21d08a844 Mon Sep 17 00:00:00 2001 From: echoowall Date: Tue, 11 Aug 2026 18:10:32 +0800 Subject: [PATCH] fix(dashboard): say whether the day count is remaining or overdue The subscription card renders one label, "Expiration Days", over Math.abs(differenceInDays(expire_time, now)). The absolute value makes a subscription with 47 days left and one that expired 47 days ago render the identical "47", and the label reads equally well as "days until expiry" and "days since expiry", so neither the number nor its caption resolves the other. Users read it as whichever they expected. The card already computes isActuallyExpired for its watermark and greyscale, so the caption can follow it: Remaining Days before expiry, Days Expired after. The value keeps Math.abs -- the caption now carries the direction, and dropping the abs would only bring back the negative count that made it look broken. Co-Authored-By: Claude Opus 5 --- apps/user/public/assets/locales/en-US/dashboard.json | 3 ++- apps/user/public/assets/locales/zh-CN/dashboard.json | 3 ++- apps/user/src/sections/user/dashboard/content.tsx | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/user/public/assets/locales/en-US/dashboard.json b/apps/user/public/assets/locales/en-US/dashboard.json index 37583306..4bd9803e 100644 --- a/apps/user/public/assets/locales/en-US/dashboard.json +++ b/apps/user/public/assets/locales/en-US/dashboard.json @@ -7,7 +7,8 @@ "deducted": "Deducted", "download": "Download", "expireAt": "Expires At", - "expirationDays": "Expiration Days", + "expiredDays": "Days Expired", + "remainingDays": "Remaining Days", "expired": "Expired", "finished": "Finished", "import": "Import", diff --git a/apps/user/public/assets/locales/zh-CN/dashboard.json b/apps/user/public/assets/locales/zh-CN/dashboard.json index e8c82aaf..28c35e72 100644 --- a/apps/user/public/assets/locales/zh-CN/dashboard.json +++ b/apps/user/public/assets/locales/zh-CN/dashboard.json @@ -7,7 +7,8 @@ "deducted": "已扣除", "download": "下载", "expireAt": "到期时间", - "expirationDays": "过期天数", + "expiredDays": "已过期天数", + "remainingDays": "剩余天数", "expired": "已过期", "finished": "已完成", "import": "一键导入", diff --git a/apps/user/src/sections/user/dashboard/content.tsx b/apps/user/src/sections/user/dashboard/content.tsx index 1b1449fc..876d436e 100644 --- a/apps/user/src/sections/user/dashboard/content.tsx +++ b/apps/user/src/sections/user/dashboard/content.tsx @@ -399,7 +399,9 @@ export default function Content() {
  • - {t("expirationDays", "Expiration Days")} + {isActuallyExpired + ? t("expiredDays", "Days Expired") + : t("remainingDays", "Remaining Days")} {item.expire_time