From 1e4f709766d92260946dd964692785298ea79e64 Mon Sep 17 00:00:00 2001 From: Murphy <72738186+toBerlinWay@users.noreply.github.com> Date: Mon, 9 Nov 2026 16:33:47 +0000 Subject: [PATCH] fix(proxy): show a profile-defined GLOBAL in rule mode when it is the only group (#8607) * fix(proxy): show a profile-defined GLOBAL in rule mode when it is the only group Rule mode renders only proxyView.groups, and the backend always moves GLOBAL out of that list. A profile whose only group is GLOBAL, or that has no proxy-groups, therefore showed the "no proxy info" empty state. Fall back to GLOBAL in that case, as v2.5.2 did before #7542. Fixes #8223 Co-Authored-By: Claude Opus 5.5 * docs(changelog): note the rule-mode GLOBAL fix Co-Authored-By: Claude Opus 5.5 * chore: drop the regression test and append the changelog entry Per review: the test was only needed to confirm the fix locally, and new changelog entries go at the end of their list. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: toBerlinWay Co-authored-by: Claude Opus 5.5 --- Changelog.md | 1 + src/components/proxy/use-render-list.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 307e88622..af0dc277d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -28,6 +28,7 @@ - 修复订阅响应过大导致内存占用过高,限制单次下载为 4 MiB - 修复全局模式默认停在 `DIRECT` 或 `REJECT` 导致流量未经代理,现自动切换到第一个策略组 - 修复订阅中未加引号的 REALITY `short-id`(如 `1234e123`)被误读为数字,导致订阅无法启用 +- 修复订阅中唯一的代理组名为 `GLOBAL` 或没有代理组时,规则模式下代理页面显示「未获取到代理信息」 **🍎 macOS** diff --git a/src/components/proxy/use-render-list.ts b/src/components/proxy/use-render-list.ts index 3823d91cf..c1f971b10 100644 --- a/src/components/proxy/use-render-list.ts +++ b/src/components/proxy/use-render-list.ts @@ -209,7 +209,13 @@ export const useRenderList = ( const renderGroups = useMemo(() => { if (!proxyView) return [] - if (mode === 'rule') return proxyView.groups + // A profile whose only group is GLOBAL (mihomo then skips its built-in one) + // or that has no proxy-groups has nothing else to show in rule mode. + if (mode === 'rule') { + return proxyView.groups.length || !proxyView.global + ? proxyView.groups + : [proxyView.global] + } const { global } = proxyView if (!global) return [] const current = findCurrentGroupMember(proxyView, global)?.member