[PR #6361] [MERGED] feat(routing): add panel-only comment field to routing rules #6234

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6361
Author: @Ssentiago
Created: 8/29/2026
Status: ✅ Merged
Merged: 9/2/2026
Merged by: @MHSanaei

Base: main ← Head: feat/routing-rule-comments


📝 Commits (1)

  • a864e07 feat(routing): add panel-only comment field to routing rules

📊 Changes

9 files changed (+71 additions, -4 deletions)

View changed files

📝 frontend/src/pages/xray/routing/RoutingTab.css (+30 -0)
📝 frontend/src/pages/xray/routing/RoutingTab.tsx (+1 -0)
📝 frontend/src/pages/xray/routing/RuleCardList.tsx (+7 -0)
📝 frontend/src/pages/xray/routing/RuleFormModal.tsx (+8 -0)
📝 frontend/src/pages/xray/routing/types.ts (+1 -0)
📝 frontend/src/pages/xray/routing/useRoutingColumns.tsx (+15 -1)
📝 frontend/src/schemas/routing.ts (+1 -0)
📝 frontend/src/schemas/xray.ts (+1 -0)
📝 internal/web/service/xray.go (+7 -3)

📄 Description

Summary

  • Add a panel-only comment field to routing rules for human-readable annotations.
  • Strip comment from the generated xray-core config (same pattern as the existing enabled flag).
  • Display the comment as a column in the desktop table (with Ant Design Tooltip on hover) and as a chip in the mobile card list.

Why

When adding routing rules manually — specific IPs, domains — it's easy to forget what each rule is for after a few weeks. A rule pointing at 91.108.4.0/22 or 10.0.0.0/8 means nothing a month later without context. A panel-only comment field lets admins label rules (e.g. "1С server subnet", "Office VPN range", "Temp bypass for client X") so they remain readable over time, without affecting the xray-core config.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)

How was this tested?

  • npm run typecheck passes.
  • go build ./internal/web/service/ passes.
  • Manually verified: create/edit routing rule with comment, confirm comment persists in template JSON, confirm comment is absent from generated xray config, confirm tooltip shows full text on hover.

Breaking changes

None. The comment field is optional and silently ignored by xray-core if it ever leaks through (unknown keys are tolerated by xray's JSON parser).

Checklist

  • I tested the change locally and confirmed the described behavior.

  • I added or updated tests for the new behavior.

  • go build ./... and the test suite pass locally.

  • My commits follow the project's existing message style.

  • I have no unrelated changes mixed into this PR.

  • I tested the change locally and confirmed the described behavior.

  • I added or updated tests for the new behavior.

  • go build ./... and the test suite pass locally.

  • My commits follow the project's existing message style.

  • I have no unrelated changes mixed into this PR.


🔄 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/6361 **Author:** [@Ssentiago](https://github.com/Ssentiago) **Created:** 8/29/2026 **Status:** ✅ Merged **Merged:** 9/2/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/routing-rule-comments` --- ### 📝 Commits (1) - [`a864e07`](https://github.com/MHSanaei/3x-ui/commit/a864e074c6be00d1cee4c4aba44e1131395c7929) feat(routing): add panel-only comment field to routing rules ### 📊 Changes **9 files changed** (+71 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/pages/xray/routing/RoutingTab.css` (+30 -0) 📝 `frontend/src/pages/xray/routing/RoutingTab.tsx` (+1 -0) 📝 `frontend/src/pages/xray/routing/RuleCardList.tsx` (+7 -0) 📝 `frontend/src/pages/xray/routing/RuleFormModal.tsx` (+8 -0) 📝 `frontend/src/pages/xray/routing/types.ts` (+1 -0) 📝 `frontend/src/pages/xray/routing/useRoutingColumns.tsx` (+15 -1) 📝 `frontend/src/schemas/routing.ts` (+1 -0) 📝 `frontend/src/schemas/xray.ts` (+1 -0) 📝 `internal/web/service/xray.go` (+7 -3) </details> ### 📄 Description ## Summary - Add a panel-only `comment` field to routing rules for human-readable annotations. - Strip `comment` from the generated xray-core config (same pattern as the existing `enabled` flag). - Display the comment as a column in the desktop table (with Ant Design Tooltip on hover) and as a chip in the mobile card list. ## Why When adding routing rules manually — specific IPs, domains — it's easy to forget what each rule is for after a few weeks. A rule pointing at `91.108.4.0/22` or `10.0.0.0/8` means nothing a month later without context. A panel-only comment field lets admins label rules (e.g. "1С server subnet", "Office VPN range", "Temp bypass for client X") so they remain readable over time, without affecting the xray-core config. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [ ] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) ## How was this tested? - `npm run typecheck` passes. - `go build ./internal/web/service/` passes. - Manually verified: create/edit routing rule with comment, confirm comment persists in template JSON, confirm comment is absent from generated xray config, confirm tooltip shows full text on hover. ## Breaking changes None. The `comment` field is optional and silently ignored by xray-core if it ever leaks through (unknown keys are tolerated by xray's JSON parser). ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [ ] I added or updated tests for the new behavior. - [x] `go build ./...` and the test suite pass locally. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. - [x] I tested the change locally and confirmed the described behavior. - [ ] I added or updated tests for the new behavior. - [x] `go build ./...` and the test suite pass locally. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:17 +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#6234
No description provided.