Skip to content

Commit c975d0f

Browse files
mapleafgoclaude
andcommitted
fix: 非可选代理组点击提示,CI 内核升级至 v1.1.11
- 非可选代理组(URLTest/Fallback 等)点击节点时显示 SnackBar 提示 - 使用内核 selectable 字段判断组是否可手动切换 - 新增 autoGroupHint 中英文 i18n - CI 内核版本升级至 v1.1.11 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent ddc7860 commit c975d0f

7 files changed

Lines changed: 29 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919

2020
env:
2121
FLUTTER_VERSION: "3.44.1"
22-
CORE_VERSION: "v1.1.10"
22+
CORE_VERSION: "v1.1.11"
2323
VERSION: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.tag }}
2424

2525
jobs:

lib/i18n/en.i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"sortByDelay": "By Delay",
3737
"expandGroups": "Expand Groups",
3838
"selectGroup": "Select Group",
39-
"switchFailed": "Failed to switch proxy: $error"
39+
"switchFailed": "Failed to switch proxy: $error",
40+
"autoGroupHint": "This is an auto-select group, manual switching is not supported"
4041
},
4142
"profiles": {
4243
"title": "Profiles",

lib/i18n/strings.g.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
/// To regenerate, run: `dart run slang`
55
///
66
/// Locales: 2
7-
/// Strings: 320 (160 per locale)
7+
/// Strings: 322 (161 per locale)
88
///
9-
/// Built on 2026-06-08 at 16:15 UTC
9+
/// Built on 2026-06-10 at 07:21 UTC
1010
1111
// coverage:ignore-file
1212
// ignore_for_file: type=lint, unused_import

lib/i18n/strings_en.g.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class _Translations$proxies$en extends Translations$proxies$zh {
119119
@override String get expandGroups => 'Expand Groups';
120120
@override String get selectGroup => 'Select Group';
121121
@override String switchFailed({required Object error}) => 'Failed to switch proxy: ${error}';
122+
@override String get autoGroupHint => 'This is an auto-select group, manual switching is not supported';
122123
}
123124

124125
// Path: profiles
@@ -370,6 +371,7 @@ extension on TranslationsEn {
370371
'proxies.expandGroups' => 'Expand Groups',
371372
'proxies.selectGroup' => 'Select Group',
372373
'proxies.switchFailed' => ({required Object error}) => 'Failed to switch proxy: ${error}',
374+
'proxies.autoGroupHint' => 'This is an auto-select group, manual switching is not supported',
373375
'profiles.title' => 'Profiles',
374376
'profiles.add' => 'Add',
375377
'profiles.addSubscription' => 'Add Profile',

lib/i18n/strings_zh.g.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ class Translations$proxies$zh {
182182

183183
/// zh: '切换代理失败: $error'
184184
String switchFailed({required Object error}) => '切换代理失败: ${error}';
185+
186+
/// zh: '该分组为自动选择,不支持手动切换'
187+
String get autoGroupHint => '该分组为自动选择,不支持手动切换';
185188
}
186189

187190
// Path: profiles
@@ -691,6 +694,7 @@ extension on Translations {
691694
'proxies.expandGroups' => '展开分组',
692695
'proxies.selectGroup' => '选择分组',
693696
'proxies.switchFailed' => ({required Object error}) => '切换代理失败: ${error}',
697+
'proxies.autoGroupHint' => '该分组为自动选择,不支持手动切换',
694698
'profiles.title' => '订阅',
695699
'profiles.add' => '添加',
696700
'profiles.addSubscription' => '添加订阅',

lib/i18n/zh.i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"sortByDelay": "按延迟",
3737
"expandGroups": "展开分组",
3838
"selectGroup": "选择分组",
39-
"switchFailed": "切换代理失败: $error"
39+
"switchFailed": "切换代理失败: $error",
40+
"autoGroupHint": "该分组为自动选择,不支持手动切换"
4041
},
4142
"profiles": {
4243
"title": "订阅",

lib/presentation/pages/proxies_page.dart

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,15 @@ class _ProxyList extends StatelessWidget {
339339
final testing = testingTags.value;
340340
final items = _sortedItems(group?.items ?? []);
341341

342+
final selectable = group?.selectable ?? false;
342343
return ListView.builder(
343344
itemCount: items.length,
344345
itemBuilder: (_, i) => _ProxyTile(
345346
key: ValueKey(items[i].tag),
346347
item: items[i],
347348
selected: items[i].tag == selected,
348349
groupName: groupTag,
350+
selectable: selectable,
349351
testing: testing.contains(items[i].tag),
350352
testingTags: testingTags,
351353
),
@@ -375,13 +377,15 @@ class _ProxyList extends StatelessWidget {
375377
class _ProxyTile extends StatelessWidget {
376378
final ProxyGroupItem item;
377379
final bool selected;
380+
final bool selectable;
378381
final bool testing;
379382
final String groupName;
380383
final Signal<Set<String>> testingTags;
381384
const _ProxyTile({
382385
super.key,
383386
required this.item,
384387
required this.selected,
388+
required this.selectable,
385389
required this.testing,
386390
required this.groupName,
387391
required this.testingTags,
@@ -429,11 +433,16 @@ class _ProxyTile extends StatelessWidget {
429433
return _delayWidget(delay, testing, item.tag, testingTags);
430434
}),
431435
onTap: () async {
436+
if (!selectable) {
437+
_showHint(context, t.proxies.autoGroupHint);
438+
return;
439+
}
432440
try {
433441
await LibCore.instance.selectProxy(groupName, item.tag);
434442
} catch (e) {
435443
if (context.mounted) {
436-
showErrorDialog(context, t.proxies.switchFailed(error: '$e'));
444+
showErrorDialog(
445+
context, t.proxies.switchFailed(error: '$e'));
437446
}
438447
}
439448
},
@@ -506,3 +515,9 @@ Widget _delayText(int delay, BuildContext context) {
506515
: _delayColorBad;
507516
return Text('${delay}ms', style: TextStyle(color: color, fontSize: 13));
508517
}
518+
519+
void _showHint(BuildContext context, String message) {
520+
if (!context.mounted) return;
521+
ScaffoldMessenger.of(context)..clearSnackBars()
522+
..showSnackBar(SnackBar(content: Text(message)));
523+
}

0 commit comments

Comments
 (0)