mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #7025] [MERGED] fix(frontend): improve inbound form accessibility for screen readers #6585
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#6585
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/7025
Author: @HamedSanaei
Created: 10/29/2026
Status: ✅ Merged
Merged: 11/5/2026
Merged by: @MHSanaei
Base:
main← Head:codex/issue-7023-inbound-a11y📝 Commits (4)
823f149fix(frontend): make inbound pickers screen-reader accessible290aeb1chore: integrate current main for PR 7025 validation756134cMerge remote-tracking branch 'origin/main' into codex/review-pr-7025-20261105f647d84Merge remote-tracking branch 'origin/main' into codex/review-pr-7025-20261105📊 Changes
29 files changed (+875 additions, -110 deletions)
View changed files
📝
.github/workflows/ci.yml(+9 -0)📝
frontend/README.md(+27 -0)➕
frontend/src/components/form/NativeSelect.css(+14 -0)➕
frontend/src/components/form/NativeSelect.stories.tsx(+67 -0)➕
frontend/src/components/form/NativeSelect.tsx(+70 -0)📝
frontend/src/components/form/rhf/FormField.stories.tsx(+3 -0)📝
frontend/src/components/form/rhf/FormField.tsx(+12 -9)📝
frontend/src/lib/xray/forms/transport/CustomSockoptList.tsx(+2 -1)📝
frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx(+9 -8)📝
frontend/src/lib/xray/forms/transport/XDriveForm.tsx(+2 -1)➕
frontend/src/pages/inbounds/form/InboundFormModal.stories.tsx(+121 -0)📝
frontend/src/pages/inbounds/form/InboundFormModal.tsx(+52 -8)📝
frontend/src/pages/inbounds/form/protocols/hysteria.tsx(+3 -2)📝
frontend/src/pages/inbounds/form/protocols/mixed.tsx(+3 -2)📝
frontend/src/pages/inbounds/form/protocols/shadowsocks.tsx(+6 -3)📝
frontend/src/pages/inbounds/form/protocols/tuic.tsx(+4 -3)📝
frontend/src/pages/inbounds/form/protocols/tunnel.tsx(+3 -2)📝
frontend/src/pages/inbounds/form/protocols/vless.tsx(+3 -2)📝
frontend/src/pages/inbounds/form/security/reality.tsx(+4 -1)📝
frontend/src/pages/inbounds/form/security/tls.tsx(+6 -5)...and 9 more files
📄 Description
Refs #7023
Make the Create/Edit Inbound pickers expose actual selectable options and selected values, preserve their form behavior, and keep keyboard focus in the modal. Related reports: #6832 and #6107. The label/tooltip/localization work from #6907 is preserved.
Root cause and solution
Inspection of the installed Ant Design 6.6.7/rc-select implementation and rendered Chromium accessibility tree confirmed several separate gaps:
virtual={false}, rc-select does expose the actual list and selectable options, but its closed single-select combobox still has an empty value in Chromium's AX tree. It therefore does not fully solve the simple-picker problem.Use a small, themed native
<select>for the short single-value lists: Protocol, Transport, address strategy, reset schedule, encryption/auth type, and similar protocol/TLS/REALITY/transport fields. The browser owns their roles, selected-value semantics, keyboard interaction and mobile picker. No internal Select ARIA roles or active-descendant state are overridden.NativeSelectforwards IDs, ARIA descriptions, blur and React 19 refs. Its private option keys map back to the original typed values, including numeric zero, strings and empty strings; disabled options/fields, dynamic lists and unlisted saved values are preserved. Existing onChange/onAfterChange handlers still receive the same values. It also supports the existing small preset control and Ant Design theme tokens.Searchable, clearable, tag, autocomplete and multi-select controls remain Ant Design controls. There is no application-wide change to Ant Design defaults. The fixed-choice controls in the shared FinalMask, CustomSockopt and XDrive editors use the same native primitive because these editors are part of the inbound workflow; their outbound consumers are covered by the full regression suite.
Modified components/files
frontend/src/components/form/NativeSelect.{tsx,css,stories.tsx}: native single selection and typed-value browser example.frontend/src/components/form/rhf/FormField.{tsx,stories.tsx}: merge existing descriptions, tooltip, extra guidance and translated validation help; expose invalid state without replacing a caller's ARIA props.frontend/src/pages/inbounds/form/InboundFormModal.{tsx,stories.tsx}: basic/transport pickers, scoped complex-control options, named Security group, keyboard boundaries and real add/edit fixtures.hysteria.tsx,mixed.tsx,shadowsocks.tsx,tuic.tsx,tunnel.tsx,vless.tsx.security/reality.tsx,security/tls.tsx; transport fields:transport/sockopt.tsx,transport/xhttp.tsx.frontend/src/lib/xray/forms/transport/{CustomSockoptList,FinalMaskForm,XDriveForm}.tsx.native-select.test.tsx,inbound-form-accessibility.test.tsx,rhf-form-field.test.tsx; adapt the existing inbound/outbound tests andtest-utils.tsxto operate real native options instead of requiring Ant Design CSS markup. Remove the old crash-only inbound assertion and strengthen the existing protocol-shape assertion.frontend/tools/check-inbound-keyboard.mjs, the frontend CI job, andfrontend/README.md: repeatable trusted-keyboard/AX/request checks and the real-screen-reader verification checklist.Behavior preserved
Protocol availability and option values, edit-mode protocol disabling, localization, defaults/conditional fields, transport resets and security side effects are unchanged. Existing schema validation and form-to-wire adapters are untouched. Edit payloads still omit server-owned clients. No Go, API contract, database, quota/expiry/client setting or Xray configuration generation changes; no new dependency or translation key.
Automated verification
make verify: PASS, including code generation freshness, Go lint/tests/build, frontend lint/format/typecheck, 2,030 tests across 219 files, production Vite build, Storybook build and matching docs OpenAPI. Thus the requestednpm run typecheck,npm run lint,npm run testandnpm run buildwere all executed successfully.node tools/check-inbound-keyboard.mjsagainst built Storybook: 4/4 PASS, desktop + mobile viewport, create + edit. Uses trusted Chromium Tab/Arrow/Enter/typeahead, checks None/TLS/REALITY keyboard selection, desktop native-picker cancellation, native selected value in the accessibility tree, modal focus containment/return, actual serialized add/update requests and edit-client preservation. Only HTTP responses are stubbed; the form, selectors, validation and adapters are real.-shellcheck=), final frontend lint/format checks andgit diff --checkpassed.Remaining manual verification
No actual TalkBack or NVDA session was available. Mobile viewport emulation is not Android, and Chromium AX/keyboard tests cannot certify assistive-technology speech or touch exploration. Please validate with the reporter on Android TalkBack/Chrome and desktop NVDA before closing #7023.
The concise manual checklist and repeat commands cover touch exploration, selected-value announcements, native picker cancellation, Protocol/Transport/security-dependent fields, complex search/multi-select/tags, validation correction, Save/Close and opener focus. Complex lists render all options inside this modal, which trades additional DOM work for actual option semantics; their search/multi-select behavior is retained.
Upstream CI completed successfully on the published head; details below. This PR intentionally references, rather than automatically closes, the issue.
Final upstream CI
All 11 main checks passed on
823f149cc724ff048730d2cec8d0ab48cc4bbcfbin CI run 40894130269: frontend, go-test, codegen, golangci, PostgreSQL durable-first, PostgreSQL migration, race, node-e2e, govulncheck, fuzz-smoke and shell-lint. The frontend job's new Inbound keyboard and accessibility tree step also completed successfully, alongside its test and production/Storybook build steps.The optional Claude workflow reported that its account quota was already spent and no code on this head was examined. Its successful workflow status is not a code-review approval. Actual TalkBack/NVDA verification remains the manual follow-up described above.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #7025] fix(frontend): improve inbound form accessibility for screen readersto [PR #7025] [MERGED] fix(frontend): improve inbound form accessibility for screen readers