mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6672] [MERGED] fix(clients): balance renewal form layout and mode guidance #6402
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#6402
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/6672
Author: @JacktheRanger
Created: 9/28/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @MHSanaei
Base:
main← Head:fix/client-renewal-form-layout📝 Commits (5)
033716ffix(clients): balance renewal form layout and mode guidanceea36591chore(clients): merge main and resolve renewal locale conflicts02539e8refactor(clients): drop the renewal CSS that #6662 made redundantce256bfMerge branch 'main' into fix/client-renewal-form-layout0d77be5test(tuic): wait for downstream association activity refresh📊 Changes
19 files changed (+226 additions, -117 deletions)
View changed files
📝
docs/content/docs/en/config/clients.mdx(+6 -0)📝
docs/content/docs/zh/config/clients.mdx(+5 -0)📝
frontend/src/pages/clients/ClientFormModal.tsx(+13 -14)📝
frontend/src/pages/clients/ClientRenewalFields.tsx(+81 -59)➕
frontend/src/test/client-renewal-help.test.tsx(+42 -0)📝
internal/tuic/stream_udp_lifecycle_test.go(+14 -5)📝
internal/web/translation/ar-EG.json(+5 -3)📝
internal/web/translation/en-US.json(+5 -3)📝
internal/web/translation/es-ES.json(+5 -3)📝
internal/web/translation/fa-IR.json(+5 -3)📝
internal/web/translation/id-ID.json(+5 -3)📝
internal/web/translation/ja-JP.json(+5 -3)📝
internal/web/translation/pt-BR.json(+5 -3)📝
internal/web/translation/ru-RU.json(+5 -3)📝
internal/web/translation/tr-TR.json(+5 -3)📝
internal/web/translation/uk-UA.json(+5 -3)📝
internal/web/translation/vi-VN.json(+5 -3)📝
internal/web/translation/zh-CN.json(+5 -3)📝
internal/web/translation/zh-TW.json(+5 -3)📄 Description
Motivation
The client editor currently places Traffic Reset beside the entire auto-renewal block in two half-width columns (introduced by
a33b2341e9). When renewal is enabled, the right column contains several fields, help and a preview while the left often contains just one selector. This leaves a large blank area and pushes subsequent fields down.The same block also shows calendar/month-end guidance for fixed-day intervals and weekly schedules, even though those modes do not share monthly boundaries.
Changes
mdbreakpoint, they stack. Help and the preview use the width below the controls.02539e84; those changes are preserved.ClientFormModaland checks both appearing and disappearing guidance. No markup snapshots or CSS-class assertions are used as substitutes for browser layout validation.This follows the existing Ant Design/RHF conventions in
frontend/CLAUDE.md, the rootCLAUDE.mdtest-first/local-gate rules, and the schedule semantics documented indocs/content/docs/en/config/clients.mdx.Upstream sync (2026-10-07)
Merged upstream
mainatf21721224757062066597a84e3137fadfde70c73into the existing PR branch without rewriting its history. The only manual conflicts were in the 13 locale files: upstream's native TUIC support removed the obsoletepages.clients.tuicTotalGBDesckey beside this PR's new renewal descriptions. The resolution keeps that deletion and both renewal descriptions in every locale. It does not restore the old TUIC limitation.The client form, #6662 preview changes and client guides merged automatically and were reviewed together. At that merge, comparing the added/deleted lines of all 19 PR files against the original patch confirmed that the original edits were preserved on top of the new base. Each locale differs from current main only in the original four intended renewal keys; other upstream strings are preserved.
CI follow-up (2026-10-08)
The race job on head ce256bf0 failed in
TestDownstreamUDPResponseRefreshesAssociationIdleTime, not with a race-detector report. Receiving a QUIC datagram does not synchronize with the sender's subsequentassociations.touchcall. The test could therefore read the old timestamp even though the response had arrived successfully.The follow-up changes only
internal/tuic/stream_udp_lifecycle_test.go: poll the mutex-protected timestamp until it advances, with a one-second deadline, before exercising idle reaping. Keep the exact payload, association ID, idle-survival and relay-shutdown assertions. Missing activity updates still fail. No production code, network timeout, dependency or CI configuration is changed, and no check is disabled.Not included
Known costs
Validation
After the CI test fix (2026-10-08)
Validated on macOS arm64 with Go 1.27.1, Node 26.4.0, golangci-lint 2.14.0 and the existing upstream lockfiles. Go commands used
PATH=/tmp/three-x-ui-conflict.Y0D4lY/go/bin:$PATHandGODEBUG=tlsmlkem=0,http2client=0.go test -race -shuffle=1791424023316329240 -count=1 -timeout=3m ./internal/tuic— passed using the failing CI package's shuffle seed.make race— passed across the full local package list, with uncached shuffled race-enabled tests. Environment-gated PostgreSQL, master/node and other opt-in integration paths were not enabled locally.go test -race -run '^TestDownstreamUDPResponseRefreshesAssociationIdleTime$' -count=200 -timeout=2m ./internal/tuic— passed on the final unmodified production code.go test -race -run '^TestDownstreamUDPResponseRefreshesAssociationIdleTime$' -count=1 -timeout=30s ./internal/tuic; the fixed test passed 50 repetitions using-count=50 -timeout=2m. Temporarily removing the activity update entirely made the fixed test fail within its deadline with the same-count=1 -timeout=30scommand. All temporary production edits were removed before final validation.go test -race -run '^TestDownstreamUDPResponseRefreshesAssociationIdleTime$' -count=1000 -timeout=3m ./internal/tuicwas not fully green: one iteration timed out during QUIC connection setup, before the activity assertion. No activity-refresh assertion failed in that run. The subsequent 200-repetition run above passed; this is not a claim that the unrelated connection-setup timeout was fixed.PATH=/tmp/three-x-ui-conflict.Y0D4lY/go/bin:/tmp/three-x-ui-conflict.Y0D4lY/golangci-lint-2.14.0-darwin-arm64:$PATH GODEBUG=tlsmlkem=0,http2client=0 CI=true make verify— generated-file freshness, Go/frontend lint, formatting and typecheck passed, then the existing upstream MSW worker mismatch stopped the gate. The tracked worker is still 2.15.0 while the locked runtime is 3.0.2; this is separate from the failed GitHub race job.PATH=/tmp/three-x-ui-conflict.Y0D4lY/go/bin:$PATH GODEBUG=tlsmlkem=0,http2client=0 CI=true make test build build-storybook— passed: uncached shuffled Go tests, 184 frontend test files / 1800 tests, frontend and Go builds, and Storybook build.git diff --checkandgofmt -d internal/tuic/stream_udp_lifecycle_test.go— clean. Verified that only the intended test file differs fromce256bf0, with no remaining production fault injection. No frontend tests, shared setup, user-facing behavior or documentation semantics changed in this follow-up.After upstream sync (2026-10-07)
Environment: Node 26.4.0, Go 1.27.1, golangci-lint 2.14.0, Vitest 5.0.3 and installed Playwright Chromium. Dependencies were installed from the updated upstream lockfiles using
npm ci --no-audit --no-fundinfrontend/andpnpm install --frozen-lockfileindocs/; no manifest or lockfile changes are introduced by this PR.PATH=/tmp/three-x-ui-conflict.Y0D4lY/go/bin:/tmp/three-x-ui-conflict.Y0D4lY/golangci-lint-2.14.0-darwin-arm64:$PATH GODEBUG=tlsmlkem=0,http2client=0 CI=true make verify— not fully green: code generation/freshness, Go/frontend lint, formatting and typecheck passed, thenmsw-worker-checkfailed. Upstream's lockfile installs MSW 3.0.2, while the tracked worker still declares 2.15.0.git show origin/main:frontend/public/mockServiceWorker.js | cmp - frontend/node_modules/msw/lib/mockServiceWorker.jsreproduces the same mismatch using the unmodified upstream worker. This dependency-sync issue is intentionally not folded into the conflict resolution.PATH=/tmp/three-x-ui-conflict.Y0D4lY/go/bin:/tmp/three-x-ui-conflict.Y0D4lY/golangci-lint-2.14.0-darwin-arm64:$PATH GODEBUG=tlsmlkem=0,http2client=0 CI=true make test build build-storybook— passed: uncached shuffled Go tests, 184 frontend test files / 1800 tests, frontend production build, Go build and Storybook build.frontend/:npm test -- --project components src/test/client-renewal-help.test.tsx src/test/client-renewal-preview-display.test.tsx src/test/client-calendar-renewal.test.tsx src/test/client-bulk-calendar-renewal.test.tsx— 4 files / 6 tests passed, covering mode-specific guidance, preview timezone/offset formatting, save payloads and explicit-cutoff/first-use behavior.docs/:pnpm typecheck && pnpm lint && pnpm format:check && pnpm test— passed, 12 files / 107 tests.git diff --cached --check— passed;git ls-files -ureturned no unresolved entries. Parsed and compared all 13 locale JSON files against upstream and the original PR to verify preservation of both sides.Original submission (2026-09-28, head
033716f)The results below apply to the original pre-sync tree, not the updated dependency state.
Environment: Node 26.4.0, Go 1.27.1, golangci-lint 2.14.0 and installed Playwright Chromium. The manifest/lockfile comparison with the previously installed checkout was empty, so no dependency or lockfile changes were needed.
PATH=/tmp/three-x-ui-display-tools.44XpWH/go/bin:/tmp/three-x-ui-display-tools.44XpWH/golangci-lint-2.14.0-darwin-arm64:$PATH GODEBUG=tlsmlkem=0,http2client=0 make verify— passed: generated-file check, Go/frontend lint, formatting, typecheck, MSW worker check, uncached shuffled Go tests, 175 frontend test files / 1743 tests, frontend/Go builds and Storybook build. This is the repository's local gate; live PostgreSQL, race and fuzz CI jobs were not run locally.frontend/:npm test -- --project components src/test/client-renewal-help.test.tsx src/test/client-calendar-renewal.test.tsx src/test/client-bulk-calendar-renewal.test.tsx— 3 files / 3 tests passed, including existing save-payload and explicit-cutoff/first-use behavior.frontend/:npm test -- --project components src/test/client-renewal-help.test.tsx— the single new case passed in its own process. Restoring the pre-fix component made the same case fail because interval mode displayed calendar guidance.docs/, using the bundled pnpm executable:pnpm typecheck && pnpm lint && pnpm format:check && pnpm test— passed, 12 files / 106 tests.node /tmp/three-x-ui-layout-qa.DOliaq/check-layout.mjs— 16 Chromium scenarios passed, covering disabled/interval/weekly/monthly modes, add/edit/bulk dialogs, monthly traffic reset, unset expiry, delayed start, English/Chinese, Arabic RTL, 375 px mobile, 1280 px desktop and the 767/768 px breakpoint. Checks cover same-row/equal-width desktop controls, stacked mobile/bulk controls and horizontal clipping/overflow. The same harness with--baselineand the original components failed the desktop same-row assertion. A final Chrome check confirmed the cutoff button's 32 px minimum height.git diff --check— passed. Documentation/locale searches found no remaining zero-value mode-switch instructions in these tooltips.git merge-tree --write-tree HEAD fix/renewal-preview-time-display— passed with no conflicts against #6662 atcf54f748d010b6e371964def0c166f1b981354b1. This is a merge-compatibility check, not a claim that the combined branch ran the full suite.Manual reproduction
Open Clients -> Edit Client, enable a renewal mode, and compare the reset/renewal area at desktop and mobile widths. Switch among interval, weekly, monthly and disabled: the parameter and help must follow the selected mode. Enable monthly independent traffic reset to reveal its adjacent day field. With no expiry set, select a calendar mode and verify that the first-cutoff button wraps without clipping. Repeat in Add Client and Add Bulk; the bulk fields should remain stacked.
Screenshots
Full-dialog desktop and mobile screenshots were generated and visually reviewed using synthetic client data. Attaching them here was blocked by the Chrome extension's file-upload permission, so this description currently has no hosted screenshot attachments. No browser permission was changed and no production-panel screenshot was uploaded.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.