[PR #6150] [CLOSED] fix(frontend): preserve edited server drafts #6112

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6150
Author: @PathGao
Created: 7/29/2026
Status: ❌ Closed

Base: main ← Head: fix-server-draft-hydration-v3


📝 Commits (5)

  • c8d67ad fix(frontend): preserve edited server drafts
  • de2cf8a fix(frontend): retain Xray server projections
  • c53dd76 fix(frontend): keep draft controls internal
  • 8b1025d fix(frontend): rehydrate saved redacted settings
  • 0b3369c fix(frontend): order saved draft hydration

📊 Changes

6 files changed (+303 additions, -48 deletions)

View changed files

📝 frontend/src/api/queries/useAllSettings.ts (+33 -20)
➕ frontend/src/hooks/useServerDraft.ts (+37 -0)
📝 frontend/src/hooks/useXraySetting.ts (+26 -27)
📝 frontend/src/test/use-all-settings.test.tsx (+51 -1)
➕ frontend/src/test/use-xray-setting.test.tsx (+70 -0)
➕ frontend/src/test/useServerDraft.test.tsx (+86 -0)

📄 Description

Summary

  • Preserve Settings and Xray edits across background refetches.
  • Establish the saved Settings baseline before invalidating its query, so redacted-secret rehydration cannot depend on refetch timing.
  • Keep server-derived Xray projections current while an editable draft is dirty, remove dirty-state polling, and normalize an emptied test URL to its effective default.

Validation

  • npm run test -- useServerDraft.test.tsx use-all-settings.test.tsx use-xray-setting.test.tsx
  • npm run typecheck
  • npm run lint

🔄 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/6150 **Author:** [@PathGao](https://github.com/PathGao) **Created:** 7/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-server-draft-hydration-v3` --- ### 📝 Commits (5) - [`c8d67ad`](https://github.com/MHSanaei/3x-ui/commit/c8d67ad67e458bdf7034fd44b2b5c1a1f4ee4e1c) fix(frontend): preserve edited server drafts - [`de2cf8a`](https://github.com/MHSanaei/3x-ui/commit/de2cf8ad9fc55243f68ccfaabc4a51960a073c10) fix(frontend): retain Xray server projections - [`c53dd76`](https://github.com/MHSanaei/3x-ui/commit/c53dd769682877764398b748b4a0ef1682a14048) fix(frontend): keep draft controls internal - [`8b1025d`](https://github.com/MHSanaei/3x-ui/commit/8b1025dd22804027eb15a8024af5023341e13ecb) fix(frontend): rehydrate saved redacted settings - [`0b3369c`](https://github.com/MHSanaei/3x-ui/commit/0b3369c792198fef8ec3c444ca6e59c500372a6b) fix(frontend): order saved draft hydration ### 📊 Changes **6 files changed** (+303 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/api/queries/useAllSettings.ts` (+33 -20) ➕ `frontend/src/hooks/useServerDraft.ts` (+37 -0) 📝 `frontend/src/hooks/useXraySetting.ts` (+26 -27) 📝 `frontend/src/test/use-all-settings.test.tsx` (+51 -1) ➕ `frontend/src/test/use-xray-setting.test.tsx` (+70 -0) ➕ `frontend/src/test/useServerDraft.test.tsx` (+86 -0) </details> ### 📄 Description ## Summary - Preserve Settings and Xray edits across background refetches. - Establish the saved Settings baseline before invalidating its query, so redacted-secret rehydration cannot depend on refetch timing. - Keep server-derived Xray projections current while an editable draft is dirty, remove dirty-state polling, and normalize an emptied test URL to its effective default. ## Validation - `npm run test -- useServerDraft.test.tsx use-all-settings.test.tsx use-xray-setting.test.tsx` - `npm run typecheck` - `npm run lint` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:06:27 +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#6112
No description provided.