ui(app): drop redundant mode badge from home mode card

This commit is contained in:
Qiu Yuzhou
2026-09-30 22:23:52 +08:00
parent 740bf567b8
commit 020d7a62d9
3 changed files with 3 additions and 25 deletions
-14
View File
@@ -38,20 +38,6 @@ struct HomeCard<Trailing: View, Content: View>: View {
}
}
/// 当前模式徽标(票 #54)。
struct ModeBadge: View {
let label: String
var body: some View {
Text(label)
.font(.caption.weight(.semibold))
.foregroundStyle(.tint)
.padding(.horizontal, 8)
.padding(.vertical, 3)
.background(Color.accentColor.opacity(0.12), in: Capsule())
}
}
/// 快速操作行按钮(票 #54)。
struct QuickActionButton: View {
let icon: String
+2 -10
View File
@@ -142,7 +142,7 @@ private struct RuntimeControlCard: View {
}
}
/// 「代理模式」卡:可用模式切换(Domain 单点策略投影)+ 规则子选项 + 模式说明 + 当前徽标。
/// 「代理模式」卡:可用模式切换(Domain 单点策略投影)+ 规则子选项 + 模式说明。
private struct ModeCard: View {
@ObservedObject var control: ProxyControlWorkflow
@@ -150,7 +150,7 @@ private struct ModeCard: View {
HomeCard(
title: "代理模式",
subtitle: "选择系统代理应用方式",
trailing: { ModeBadge(label: modeBadgeLabel) },
trailing: { EmptyView() },
content: {
VStack(alignment: .leading, spacing: 14) {
Picker("代理模式", selection: modeBinding) {
@@ -180,14 +180,6 @@ private struct ModeCard: View {
})
}
private var modeBadgeLabel: String {
let mode = control.snapshot.proxyMode
if mode == .rule {
return "\(mode.label) · \(control.snapshot.ruleDefaultAction.label)"
}
return mode.label
}
private var modeBinding: Binding<ProxyMode> {
Binding(
get: { control.snapshot.proxyMode },
+1 -1
View File
@@ -51,7 +51,7 @@ enum StatusMenuModel {
targetPath: snapshot.activeTarget?.pathSummary)
}
/// 模式标签与首页徽标同口径(issue #67 AC2):规则模式带上子选项。
/// 模式标签(issue #67 AC2):规则模式带上子选项。
private static func modeLabel(for snapshot: ProxyControlSnapshot) -> String {
let mode = snapshot.proxyMode
if mode == .rule {