[PR #5809] [MERGED] [Feature]: Add a tooltip/hint to the "Password" field in the client form clarifying which protocols use it #5994

Closed
opened 2026-11-02 04:05:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5809
Author: @ecgang
Created: 7/5/2026
Status: ✅ Merged
Merged: 7/7/2026
Merged by: @MHSanaei

Base: main ← Head: feat/clarify-client-password-hint


📝 Commits (2)

  • 97bedfa feat(clients): clarify which protocols use the Password and Hysteria Auth fields
  • 07942cf test(clients): assert Password/Hysteria Auth tooltip hints render

📊 Changes

15 files changed (+99 additions, -2 deletions)

View changed files

📝 frontend/src/pages/clients/ClientFormModal.tsx (+2 -2)
➕ frontend/src/test/client-form-modal.test.tsx (+71 -0)
📝 internal/web/translation/ar-EG.json (+2 -0)
📝 internal/web/translation/en-US.json (+2 -0)
📝 internal/web/translation/es-ES.json (+2 -0)
📝 internal/web/translation/fa-IR.json (+2 -0)
📝 internal/web/translation/id-ID.json (+2 -0)
📝 internal/web/translation/ja-JP.json (+2 -0)
📝 internal/web/translation/pt-BR.json (+2 -0)
📝 internal/web/translation/ru-RU.json (+2 -0)
📝 internal/web/translation/tr-TR.json (+2 -0)
📝 internal/web/translation/uk-UA.json (+2 -0)
📝 internal/web/translation/vi-VN.json (+2 -0)
📝 internal/web/translation/zh-CN.json (+2 -0)
📝 internal/web/translation/zh-TW.json (+2 -0)

📄 Description

Summary

Add tooltips to the Password and Hysteria Auth fields in the client
create/edit form (ClientFormModal.tsx), clarifying which protocols actually
consume each field. Adds passwordDesc / hysteriaAuthDesc translation keys to
all 13 locale files, following the existing tooltip convention.

Why

The client form is shared across all multi-client protocols (VLESS, VMess,
Trojan, Shadowsocks, Hysteria, WireGuard) and shows every protocol-specific
field at once, with no indication of which protocol each applies to. The
Password field is only meaningful for Trojan and Shadowsocks; for the
others it is silently ignored, and Hysteria's actual credential is the separate
Hysteria Auth field right below it. This caused real-world confusion
(reported in #5803) about whether a populated/empty Password field mattered for
a VLESS client.

Verified against the backend source — buildUserAccount in
internal/xray/api.go:

Protocol Field read Code
trojan password (required) getRequiredUserString(user, "password") — api.go:500
shadowsocks password (required) + cipher/Key api.go:514, :533, :538
hysteria auth (required), not password getRequiredUserString(user, "auth") — api.go:541
vmess / vless / wireguard never read password (no password access in those cases)

So the hint text is accurate: Password → Trojan/Shadowsocks only; Hysteria Auth
→ Hysteria only.

Closes #5803.

Type of change

  • New feature (UI clarification / usability)

Areas affected

  • Frontend (UI / panel pages)

What changed

  • frontend/src/pages/clients/ClientFormModal.tsx — added
    tooltip={t('pages.clients.passwordDesc')} to the Password Form.Item
    (line ~746) and tooltip={t('pages.clients.hysteriaAuthDesc')} to the
    Hysteria Auth Form.Item (line ~760). This matches the existing pattern
    already used for totalGBDesc, limitIpDesc, renewDesc, and groupDesc.
  • internal/web/translation/*.json (all 13 locales) — added passwordDesc
    and hysteriaAuthDesc under pages.clients, fully translated per-locale to
    match how sibling *Desc keys are localized in this repo (not English-only).

English strings:

  • passwordDesc: "Only used by Trojan and Shadowsocks clients; ignored for VLESS, VMess, Hysteria, and WireGuard."
  • hysteriaAuthDesc: "Credential used only by Hysteria clients. Trojan and Shadowsocks use the Password field instead."

How was this tested?

  • Backend field usage confirmed by reading internal/xray/api.go
    buildUserAccount (see table above).
  • All 13 locale JSON files validated as parseable JSON after the edit.
  • Tooltip prop usage matches the established Form.Item ... tooltip={t(...)}
    convention already present in the same file.
  • Frontend gates all pass on this branch: npm run lint (eslint) clean,
    npm run typecheck (tsc --noEmit) clean, npm run build succeeds
    (note: gen:api requires Node ≥ 22.6 for --experimental-strip-types —
    pre-existing toolchain requirement, unrelated to this change).
  • Rendered the Add Client form and hovered both new tooltips — the info icon
    appears next to the Password and Hysteria Auth labels and shows the correct
    hover text (screenshots below).

Screenshots / recordings

Both tooltips rendered in the Add Client form (Credentials tab), en-US:

Password tooltip Hysteria Auth tooltip
(attached: password tooltip) (attached: hysteria auth tooltip)
3xui-password-tooltip 3xui-hysteria-tooltip

Breaking changes

None. Additive translation keys and two tooltip props; no behavior or config
change.

Checklist

  • I tested the change locally and confirmed the described behavior (rendered form + tooltip hover, screenshots attached).
  • No new tests needed (additive UI hint; no logic change).
  • go build ./... and the test suite pass locally (frontend-only change; Go side untouched).
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • Translation keys added to all locale files.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

This contribution was developed with AI assistance via terminalhire. The author has reviewed the change and takes responsibility for its content.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5809 **Author:** [@ecgang](https://github.com/ecgang) **Created:** 7/5/2026 **Status:** ✅ Merged **Merged:** 7/7/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/clarify-client-password-hint` --- ### 📝 Commits (2) - [`97bedfa`](https://github.com/MHSanaei/3x-ui/commit/97bedfa0d5c95e5b3eca29c831b2b2f561ba966f) feat(clients): clarify which protocols use the Password and Hysteria Auth fields - [`07942cf`](https://github.com/MHSanaei/3x-ui/commit/07942cfa8dd691e5ff0cbdc8f304ea7f9cb65d9b) test(clients): assert Password/Hysteria Auth tooltip hints render ### 📊 Changes **15 files changed** (+99 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/pages/clients/ClientFormModal.tsx` (+2 -2) ➕ `frontend/src/test/client-form-modal.test.tsx` (+71 -0) 📝 `internal/web/translation/ar-EG.json` (+2 -0) 📝 `internal/web/translation/en-US.json` (+2 -0) 📝 `internal/web/translation/es-ES.json` (+2 -0) 📝 `internal/web/translation/fa-IR.json` (+2 -0) 📝 `internal/web/translation/id-ID.json` (+2 -0) 📝 `internal/web/translation/ja-JP.json` (+2 -0) 📝 `internal/web/translation/pt-BR.json` (+2 -0) 📝 `internal/web/translation/ru-RU.json` (+2 -0) 📝 `internal/web/translation/tr-TR.json` (+2 -0) 📝 `internal/web/translation/uk-UA.json` (+2 -0) 📝 `internal/web/translation/vi-VN.json` (+2 -0) 📝 `internal/web/translation/zh-CN.json` (+2 -0) 📝 `internal/web/translation/zh-TW.json` (+2 -0) </details> ### 📄 Description ## Summary Add tooltips to the **Password** and **Hysteria Auth** fields in the client create/edit form (`ClientFormModal.tsx`), clarifying which protocols actually consume each field. Adds `passwordDesc` / `hysteriaAuthDesc` translation keys to all 13 locale files, following the existing tooltip convention. ## Why The client form is shared across all multi-client protocols (VLESS, VMess, Trojan, Shadowsocks, Hysteria, WireGuard) and shows every protocol-specific field at once, with no indication of which protocol each applies to. The **Password** field is only meaningful for Trojan and Shadowsocks; for the others it is silently ignored, and Hysteria's actual credential is the separate **Hysteria Auth** field right below it. This caused real-world confusion (reported in #5803) about whether a populated/empty Password field mattered for a VLESS client. **Verified against the backend source** — `buildUserAccount` in `internal/xray/api.go`: | Protocol | Field read | Code | | --- | --- | --- | | `trojan` | `password` (required) | `getRequiredUserString(user, "password")` — `api.go:500` | | `shadowsocks` | `password` (required) + cipher/Key | `api.go:514`, `:533`, `:538` | | `hysteria` | `auth` (required), **not** password | `getRequiredUserString(user, "auth")` — `api.go:541` | | `vmess` / `vless` / `wireguard` | never read `password` | (no `password` access in those cases) | So the hint text is accurate: Password → Trojan/Shadowsocks only; Hysteria Auth → Hysteria only. Closes #5803. ## Type of change - [x] New feature (UI clarification / usability) ## Areas affected - [x] Frontend (UI / panel pages) ## What changed - `frontend/src/pages/clients/ClientFormModal.tsx` — added `tooltip={t('pages.clients.passwordDesc')}` to the Password `Form.Item` (line ~746) and `tooltip={t('pages.clients.hysteriaAuthDesc')}` to the Hysteria Auth `Form.Item` (line ~760). This matches the existing pattern already used for `totalGBDesc`, `limitIpDesc`, `renewDesc`, and `groupDesc`. - `internal/web/translation/*.json` (all 13 locales) — added `passwordDesc` and `hysteriaAuthDesc` under `pages.clients`, fully translated per-locale to match how sibling `*Desc` keys are localized in this repo (not English-only). English strings: - `passwordDesc`: "Only used by Trojan and Shadowsocks clients; ignored for VLESS, VMess, Hysteria, and WireGuard." - `hysteriaAuthDesc`: "Credential used only by Hysteria clients. Trojan and Shadowsocks use the Password field instead." ## How was this tested? - Backend field usage confirmed by reading `internal/xray/api.go` `buildUserAccount` (see table above). - All 13 locale JSON files validated as parseable JSON after the edit. - Tooltip prop usage matches the established `Form.Item ... tooltip={t(...)}` convention already present in the same file. - Frontend gates all pass on this branch: `npm run lint` (eslint) clean, `npm run typecheck` (tsc --noEmit) clean, `npm run build` succeeds (note: `gen:api` requires Node ≥ 22.6 for `--experimental-strip-types` — pre-existing toolchain requirement, unrelated to this change). - Rendered the Add Client form and hovered both new tooltips — the info icon appears next to the Password and Hysteria Auth labels and shows the correct hover text (screenshots below). ## Screenshots / recordings Both tooltips rendered in the Add Client form (Credentials tab), en-US: | Password tooltip | Hysteria Auth tooltip | | --- | --- | | (attached: password tooltip) | (attached: hysteria auth tooltip) | <img width="1200" height="897" alt="3xui-password-tooltip" src="https://github.com/user-attachments/assets/8110f887-3a16-41a1-a613-8a9ac0478db9" /> <img width="1200" height="897" alt="3xui-hysteria-tooltip" src="https://github.com/user-attachments/assets/1f0cc641-c94e-4c96-9d31-e95a6aef2b42" /> ## Breaking changes None. Additive translation keys and two `tooltip` props; no behavior or config change. ## Checklist - [x] I tested the change locally and confirmed the described behavior (rendered form + tooltip hover, screenshots attached). - [x] No new tests needed (additive UI hint; no logic change). - [ ] `go build ./...` and the test suite pass locally (frontend-only change; Go side untouched). - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] Translation keys added to all locale files. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- This contribution was developed with AI assistance via [terminalhire](https://terminalhire.com). The author has reviewed the change and takes responsibility for its content. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:35 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5994
No description provided.