mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #4698] [MERGED] refactor(frontend): reorganize source tree & break down oversized modals/tabs #5733
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#5733
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/4698
Author: @MHSanaei
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @MHSanaei
Base:
main← Head:refactor📝 Commits (10+)
06d0ae9refactor(frontend): reorganize components & pages into feature folders1645664refactor(frontend): move shared protocol enums to schemas/protocols/shareda32fe94refactor(frontend): break InboundList into helpers/types/RowActions/columns hook/stats modalf116b09refactor(frontend): extract InboundInfoModal helpers, types & buildInboundInfo0b130d2test(frontend): add React Testing Library + jsdom render-test harnessc24b7d9test(frontend): per-protocol field-structure coverage for both form modals1ca0e10refactor(frontend): extract OutboundFormModal constants & stream helpers42f943drefactor(frontend): extract InboundFormModal advanced JSON editorscf99205refactor(frontend): extract OutboundFormModal loopback/blackhole/dns field blocks2b02f1brefactor(frontend): extract OutboundFormModal freedom field block📊 Changes
188 files changed (+10471 additions, -7812 deletions)
View changed files
📝
frontend/package-lock.json(+662 -0)📝
frontend/package.json(+3 -0)📝
frontend/src/components/feedback/PromptModal.tsx(+0 -0)📝
frontend/src/components/feedback/TextModal.tsx(+0 -0)➕
frontend/src/components/feedback/index.ts(+2 -0)📝
frontend/src/components/form/DateTimePicker.css(+0 -0)📝
frontend/src/components/form/DateTimePicker.tsx(+0 -0)📝
frontend/src/components/form/HeaderMapEditor.tsx(+1 -1)📝
frontend/src/components/form/JsonEditor.css(+0 -0)📝
frontend/src/components/form/JsonEditor.tsx(+0 -0)➕
frontend/src/components/form/index.ts(+3 -0)📝
frontend/src/components/ui/InfinityIcon.tsx(+0 -0)📝
frontend/src/components/ui/InputAddon.css(+0 -0)📝
frontend/src/components/ui/InputAddon.tsx(+0 -0)📝
frontend/src/components/ui/SettingListItem.css(+0 -0)📝
frontend/src/components/ui/SettingListItem.tsx(+0 -0)➕
frontend/src/components/ui/index.ts(+3 -0)📝
frontend/src/components/utility/LazyMount.tsx(+0 -0)➕
frontend/src/components/utility/index.ts(+1 -0)📝
frontend/src/components/viz/Sparkline.css(+0 -0)...and 80 more files
📄 Description
Summary
Pure structural refactor of the
frontend/source tree (React + TS + Vite + AntD). Goal: a professional layout where every file sits in its correct place, and the oversized modals/tabs are broken into small, focused, easy-to-read units. No behavior change — all tests, golden fixtures and form field-structure snapshots stay green.Done in small, reviewable commits; after each one
npm run typecheck,npm run lint,npm run test,npm run buildwere all green.What changed
1. Reorganization (zero behavior change)
components/grouped intoui/ · form/ · feedback/ · viz/ · utility/with barrels.AppSidebar→layouts/;FinalMaskForm→lib/xray/forms/transport/.pages/xray/split into feature folders (basics/ · outbounds/ · routing/ · dns/ · balancers/ · overrides/);pages/inbounds/intoform/ · info/ · clients/ · qr/ · list/.SSMethodSchema) moved toschemas/protocols/shared/, so outbound no longer reaches into the inbound shadowsocks schema.2. Broke down the oversized files (per-modal presentational components receiving form/handlers as props; inbound vs outbound forms differ by direction, so they are kept per-modal rather than force-shared):
inbounds/form/InboundFormModal.tsxxray/outbounds/OutboundFormModal.tsxinbounds/info/InboundInfoModal.tsxinbounds/list/InboundList.tsxxray/routing/RoutingTab.tsxxray/basics/BasicsTab.tsxxray/dns/DnsTab.tsxxray/outbounds/OutboundsTab.tsxprotocols/,transport/,security/folders (one file per protocol/transport), plus extracted hooks (useSecurityActions,useInboundFallbacks) and presentational sections (FallbacksCard,SniffingTab).helpers/types/columns-hooks/card-listsections.3. Test net added to guard the refactor
componentsvitest project).Verification
npm run typecheck— cleannpm run lint— 0 errors (4 pre-existing warnings, unchanged)npm run test— 351 passing (21 files)npm run build— green🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.