mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6662] [MERGED] fix(clients): clarify renewal preview times and estimates #6400
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6662
Author: @JacktheRanger
Created: 9/27/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @MHSanaei
Base:
main← Head:fix/renewal-preview-time-display📝 Commits (2)
f15b1c3fix(clients): clarify renewal preview times and estimatescf54f74test(clients): remove redundant renewal preview copy checks📊 Changes
19 files changed (+194 additions, -35 deletions)
View changed files
📝
docs/content/docs/en/config/clients.mdx(+10 -0)📝
docs/content/docs/zh/config/clients.mdx(+8 -0)📝
frontend/src/pages/clients/ClientRenewalFields.tsx(+36 -7)📝
frontend/src/test/client-bulk-calendar-renewal.test.tsx(+5 -1)📝
frontend/src/test/client-calendar-renewal.test.tsx(+3 -1)➕
frontend/src/test/client-renewal-preview-display.test.tsx(+80 -0)📝
internal/web/translation/ar-EG.json(+4 -2)📝
internal/web/translation/en-US.json(+4 -2)📝
internal/web/translation/es-ES.json(+4 -2)📝
internal/web/translation/fa-IR.json(+4 -2)📝
internal/web/translation/id-ID.json(+4 -2)📝
internal/web/translation/ja-JP.json(+4 -2)📝
internal/web/translation/pt-BR.json(+4 -2)📝
internal/web/translation/ru-RU.json(+4 -2)📝
internal/web/translation/tr-TR.json(+4 -2)📝
internal/web/translation/uk-UA.json(+4 -2)📝
internal/web/translation/vi-VN.json(+4 -2)📝
internal/web/translation/zh-CN.json(+4 -2)📝
internal/web/translation/zh-TW.json(+4 -2)📄 Description
Summary
Clarify the client renewal preview introduced in #6524. Display readable dates with explicit UTC offsets, explain the panel/server timezone, and make clear that the renewal count is an estimate rather than a record of completed renewals.
Why
With the panel timezone set to
Local, a user currently seesRenewal preview (Local)beside a raw value such as2026-09-27T05:00:00Z. This is easy to mistake for browser-local time.Periods charged: 1can also look like opening the preview already consumed a renewal.The backend already returns each date in the panel's timezone. Converting those values through a browser-local
Datewould introduce another misleading clock, particularly around calendar boundaries and DST changes.Changes
YYYY-MM-DD HH:mm:ss[.fraction] UTC±HH:mm, preserving the backend's wall time and each date's own offset.ZbecomesUTC+00:00; fractional seconds remain intact.Localas Server local time. Named zones such asAmerica/New_Yorkremain visible.<time datetime>elements, and keep dates left-to-right in RTL layouts.Type and scope
How was this tested?
On macOS arm64 with Node 26.4.0, Go 1.27.1 and golangci-lint 2.14.0:
GODEBUG=tlsmlkem=0,http2client=0 make verify— passed after the review follow-up: generated-file consistency, Go/frontend lint, formatting, typechecking, shuffled uncached Go tests, 175 frontend test files / 1,742 tests, production frontend/Go builds and Storybook build. TheGODEBUGsetting was local only; no CI configuration changed.frontend:TZ=America/Los_Angeles npm test -- --project components src/test/client-renewal-preview-display.test.tsx src/test/client-calendar-renewal.test.tsx src/test/client-bulk-calendar-renewal.test.tsx— 3 files / 5 tests passed. This intentionally uses a browser/host timezone different from the UTC and server-offset fixtures. The updated assertions failed against the old raw-date presentation before the implementation was changed.docs:pnpm typecheck && pnpm lint && pnpm format:check && pnpm test— passed, 12 files / 106 tests.America/Los_Angeles. All four retained the server's05:00:00 UTC+00:00; document width equaled viewport width after fixing button wrapping. Temporary harness files are not included in this PR.git diff --check— passed. No dependency, lockfile or generated API/schema changes.Per-case isolation commands (from frontend/)
Display example
For a
Localserver returning UTC dates:Chromium screenshots were inspected locally; there is no hosted screenshot attachment in this PR.
Review follow-up
Addressed the LOW finding about tests that only pin constant translation wording. Removed the duplicate locale-only case and redundant exact-text comparisons. The remaining cases exercise timezone selection, timestamp formatting/precision and real single-client/bulk-form behavior. This follow-up changes tests only; production behavior and translations are unchanged.
Compatibility, risks and intentionally unchanged behavior
No breaking changes, migrations or new dependencies. No API, database, scheduler, renewal arithmetic, saved expiry, subscription, traffic reset or first-use behavior changes. Selecting a renewal mode still does not rewrite an existing expiry; the first-cutoff button remains an explicit form edit that must be saved.
Formatting intentionally preserves the existing Gregorian backend dates instead of converting them to the browser timezone or another calendar. Each timestamp keeps its own offset across DST. The formatter relies on the existing backend RFC3339 response contract; it is not a new general-purpose date parser.
No new requests, telemetry, logging or external data sharing. No CI/release workflow changes. PostgreSQL-specific integration and race targets were not run separately for this presentation-only change.
Checklist
make verifypasses, including Go builds/tests and frontend lint/typecheck/build.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.