fix(mac): flatten config sections + use checkboxes
This commit is contained in:
@@ -120,7 +120,7 @@ struct ConfigSettings: View {
|
|||||||
self.gridLabel("Enabled")
|
self.gridLabel("Enabled")
|
||||||
Toggle("", isOn: self.$webChatEnabled)
|
Toggle("", isOn: self.$webChatEnabled)
|
||||||
.labelsHidden()
|
.labelsHidden()
|
||||||
.toggleStyle(.switch)
|
.toggleStyle(.checkbox)
|
||||||
}
|
}
|
||||||
GridRow {
|
GridRow {
|
||||||
self.gridLabel("Port")
|
self.gridLabel("Port")
|
||||||
@@ -151,7 +151,7 @@ struct ConfigSettings: View {
|
|||||||
self.gridLabel("Enabled")
|
self.gridLabel("Enabled")
|
||||||
Toggle("", isOn: self.$browserEnabled)
|
Toggle("", isOn: self.$browserEnabled)
|
||||||
.labelsHidden()
|
.labelsHidden()
|
||||||
.toggleStyle(.switch)
|
.toggleStyle(.checkbox)
|
||||||
.onChange(of: self.browserEnabled) { _, _ in self.autosaveConfig() }
|
.onChange(of: self.browserEnabled) { _, _ in self.autosaveConfig() }
|
||||||
}
|
}
|
||||||
GridRow {
|
GridRow {
|
||||||
@@ -200,7 +200,7 @@ struct ConfigSettings: View {
|
|||||||
self.gridLabel("Attach only")
|
self.gridLabel("Attach only")
|
||||||
Toggle("", isOn: self.$browserAttachOnly)
|
Toggle("", isOn: self.$browserAttachOnly)
|
||||||
.labelsHidden()
|
.labelsHidden()
|
||||||
.toggleStyle(.switch)
|
.toggleStyle(.checkbox)
|
||||||
.disabled(!self.browserEnabled)
|
.disabled(!self.browserEnabled)
|
||||||
.onChange(of: self.browserAttachOnly) { _, _ in self.autosaveConfig() }
|
.onChange(of: self.browserAttachOnly) { _, _ in self.autosaveConfig() }
|
||||||
.help("When enabled, the browser server will only connect if the clawd browser is already running.")
|
.help("When enabled, the browser server will only connect if the clawd browser is already running.")
|
||||||
@@ -224,6 +224,7 @@ struct ConfigSettings: View {
|
|||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.padding(.horizontal, 24)
|
.padding(.horizontal, 24)
|
||||||
.padding(.vertical, 18)
|
.padding(.vertical, 18)
|
||||||
|
.groupBoxStyle(PlainSettingsGroupBoxStyle())
|
||||||
}
|
}
|
||||||
.onChange(of: self.modelCatalogPath) { _, _ in
|
.onChange(of: self.modelCatalogPath) { _, _ in
|
||||||
Task { await self.loadModels() }
|
Task { await self.loadModels() }
|
||||||
@@ -419,6 +420,18 @@ struct ConfigSettings: View {
|
|||||||
let human = context >= 1000 ? "\(context / 1000)k" : "\(context)"
|
let human = context >= 1000 ? "\(context / 1000)k" : "\(context)"
|
||||||
return "Context window: \(human) tokens"
|
return "Context window: \(human) tokens"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private struct PlainSettingsGroupBoxStyle: GroupBoxStyle {
|
||||||
|
func makeBody(configuration: Configuration) -> some View {
|
||||||
|
VStack(alignment: .leading, spacing: 10) {
|
||||||
|
configuration.label
|
||||||
|
.font(.caption.weight(.semibold))
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
configuration.content
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user