fix(mac): hide empty MCP servers section
parent
44f9327087
commit
a882798143
|
|
@ -217,9 +217,13 @@ struct ToolsSettings: View {
|
||||||
.padding(.top, 2)
|
.padding(.top, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
private func section(for kind: ToolEntry.Kind, title: String) -> some View {
|
private func section(for kind: ToolEntry.Kind, title: String) -> some View {
|
||||||
let filtered = self.tools.filter { $0.kind == kind }
|
let filtered = self.tools.filter { $0.kind == kind }
|
||||||
return VStack(alignment: .leading, spacing: 10) {
|
if filtered.isEmpty {
|
||||||
|
EmptyView()
|
||||||
|
} else {
|
||||||
|
VStack(alignment: .leading, spacing: 10) {
|
||||||
Text(title)
|
Text(title)
|
||||||
.font(.callout.weight(.semibold))
|
.font(.callout.weight(.semibold))
|
||||||
.padding(.top, 6)
|
.padding(.top, 6)
|
||||||
|
|
@ -241,6 +245,7 @@ struct ToolsSettings: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func binding(for tool: ToolEntry) -> Binding<InstallState> {
|
private func binding(for tool: ToolEntry) -> Binding<InstallState> {
|
||||||
let current = self.installStates[tool.id] ?? .checking
|
let current = self.installStates[tool.id] ?? .checking
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue