fix(dashboard): say whether the day count is remaining or overdue - #169
Merged
Ember-Moth merged 1 commit intoAug 14, 2026
Merged
Conversation
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 <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 1.15.1-dev.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
订阅卡片上这一格用同一个标签「Expiration Days / 过期天数」套在
Math.abs(...)上:Math.abs让两种相反的状态渲染出完全相同的结果:4747而标签本身也是双关的 —— 「过期天数」既可以理解成「距离过期还有几天」,也可以理解成「已经过期了几天」。数字和标题互相都无法消歧,用户按自己的预期去读,读到哪个全看运气。
这在实际运营中会造成反向效果:已过期的用户看到一个正数,以为自己还有时间,反而不会去续费。
改动
卡片本身已经为水印和 greyscale 计算了
isActuallyExpired,标签直接跟着它走:数值保留
Math.abs—— 方向已经由标签承担;去掉 abs 只会让已过期的重新显示负数,那正是它当初被加上的原因。新增两个 key(zh-CN / en-US),移除不再被引用的
expirationDays。验证
bun --filter ppanel-user-web check与bun run build均通过。