mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6969] feat(sub): default subscription ordering to Hosts order #6551
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#6551
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/6969
Author: @HamedSanaei
Created: 10/27/2026
Status: 🔄 Open
Base:
main← Head:codex/default-subscription-host-order📝 Commits (1)
c59de58feat(sub): default subscription ordering to Hosts order📊 Changes
21 files changed (+105 additions, -58 deletions)
View changed files
📝
docs/content/docs/en/config/subscription.mdx(+23 -3)➕
docs/public/images/subscription-node-order-default.png(+0 -0)📝
frontend/src/models/setting.ts(+1 -1)📝
frontend/src/test/subscription-general-tab.test.tsx(+6 -6)📝
internal/sub/host_order_test.go(+2 -0)📝
internal/web/service/setting.go(+2 -2)📝
internal/web/service/setting_sub_info_node_test.go(+29 -4)📝
internal/web/translation/ar-EG.json(+3 -3)📝
internal/web/translation/en-US.json(+3 -3)📝
internal/web/translation/es-ES.json(+3 -3)📝
internal/web/translation/fa-IR.json(+3 -3)📝
internal/web/translation/id-ID.json(+3 -3)📝
internal/web/translation/ja-JP.json(+3 -3)📝
internal/web/translation/pt-BR.json(+3 -3)📝
internal/web/translation/ru-RU.json(+3 -3)📝
internal/web/translation/sk-SK.json(+3 -3)📝
internal/web/translation/tr-TR.json(+3 -3)📝
internal/web/translation/uk-UA.json(+3 -3)📝
internal/web/translation/vi-VN.json(+3 -3)📝
internal/web/translation/zh-CN.json(+3 -3)...and 1 more files
📄 Description
Summary
Use Hosts order as the default for Subscription Node Ordering, so subscriptions follow the order configured on the Hosts page without an extra settings change. Preserve every stored mode, including values written by previous Settings saves.
Why
Hosts already supports global ordering across inbounds, but the default still groups subscription entries by inbound. Users can reorder Hosts and reasonably expect that order to reach their subscriptions without discovering another setting.
Refs #6895.
Type of change
Areas affected
How was this tested?
GOFLAGS=-p=2 make verify.GOFLAGS=-p=2 make race.pnpm typecheck,pnpm lint,pnpm format:check,pnpm test(112 tests),pnpm gen:apiwith no generated diff, andpnpm build.c59de589ea58a55c03de5eb5d5b265b24ee76067, including race, real PostgreSQL jobs, fuzz smoke, and master/node end-to-end tests.Screenshots / recordings
The screenshot renders the actual subscription settings tab with default settings in a local component preview.
Breaking changes
The default changes for new installations and existing panels with no stored ordering mode, including upgrades from before this option existed. Those panels switch on the next subscription refresh without any settings or Host edit. Hosts with equal sort order use their remarks to break ties; migrated Host groups from different inbounds can interleave; inbounds without applicable Hosts follow Host entries regardless of their subscription sort index. A client app that automatically selects the first node can therefore change servers.
Every stored mode is preserved, including
inbound-firstwritten by saving any Settings field after the option was introduced. A saved row does not distinguish a deliberate ordering selection from a full Settings save. To retain inbound-based ordering, select and save Inbound order before upgrading if the current version offers it; otherwise select it after upgrading and refresh the subscription. Requests that omit the mode or send an empty value use the new default.The subscription guide and the inbound sort-order tooltip in all 14 locales explain the difference between the two modes. This intentionally changes the default; it does not fix a defect in the previous opt-in implementation.
No API shape or database schema changes, migration, or Xray restart is required. The existing sorting algorithms are unchanged; client applications can still apply their own sorting.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.