Add a default autoship toggle to settings
New chats can default to autoship via a Settings toggle in New chat defaults. Enabling it implies Auto mode, mirroring the per-session control. Persisted under nucleic.defaultAutoShip and loaded into the store on launch. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
@@ -45,6 +45,7 @@ enum ModelCatalog {
|
||||
static let defaultModelKey = "nucleic.defaultModel"
|
||||
static let defaultEffortKey = "nucleic.defaultEffort"
|
||||
static let defaultAutoKey = "nucleic.defaultAuto"
|
||||
static let defaultAutoShipKey = "nucleic.defaultAutoShip"
|
||||
|
||||
static var storedDefaultModel: String {
|
||||
UserDefaults.standard.string(forKey: defaultModelKey) ?? fallbackModel
|
||||
@@ -55,4 +56,7 @@ enum ModelCatalog {
|
||||
static var storedDefaultAuto: Bool {
|
||||
UserDefaults.standard.bool(forKey: defaultAutoKey)
|
||||
}
|
||||
static var storedDefaultAutoShip: Bool {
|
||||
UserDefaults.standard.bool(forKey: defaultAutoShipKey)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ struct NucleicApp: App {
|
||||
store.defaultModel = ModelCatalog.storedDefaultModel
|
||||
store.defaultEffort = ModelCatalog.storedDefaultEffort
|
||||
store.defaultAuto = ModelCatalog.storedDefaultAuto
|
||||
store.defaultAutoShip = ModelCatalog.storedDefaultAutoShip
|
||||
_store = State(initialValue: store)
|
||||
} catch {
|
||||
fatalError("Could not open the Nucleic store at \(support.path): \(error)")
|
||||
|
||||
@@ -10,6 +10,7 @@ struct SettingsView: View {
|
||||
@AppStorage(ModelCatalog.defaultModelKey) private var defaultModel = ModelCatalog.fallbackModel
|
||||
@AppStorage(ModelCatalog.defaultEffortKey) private var defaultEffort = ModelCatalog.fallbackEffort
|
||||
@AppStorage(ModelCatalog.defaultAutoKey) private var defaultAuto = false
|
||||
@AppStorage(ModelCatalog.defaultAutoShipKey) private var defaultAutoShip = false
|
||||
@AppStorage(AppTextSize.storageKey) private var textSizeRaw = AppTextSize.medium.rawValue
|
||||
@AppStorage(ColorVisionMode.storageKey) private var colorVisionRaw = ColorVisionMode.standard.rawValue
|
||||
@AppStorage(AppAppearance.storageKey) private var appearanceRaw = AppAppearance.dark.rawValue
|
||||
@@ -67,6 +68,10 @@ struct SettingsView: View {
|
||||
Text("Auto mode lets Claude auto-approve safe actions; destructive ones still ask.")
|
||||
.font(.caption).foregroundStyle(.secondary)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
Toggle("Autoship new chats", isOn: $defaultAutoShip)
|
||||
Text("Autoship merges a finished chat's branch back into the project automatically. It implies Auto mode.")
|
||||
.font(.caption).foregroundStyle(.secondary)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
}
|
||||
|
||||
Section("Apple Intelligence") {
|
||||
@@ -96,11 +101,16 @@ struct SettingsView: View {
|
||||
.onChange(of: defaultModel) { _, _ in pushDefaults() }
|
||||
.onChange(of: defaultEffort) { _, _ in pushDefaults() }
|
||||
.onChange(of: defaultAuto) { _, _ in pushDefaults() }
|
||||
.onChange(of: defaultAutoShip) { _, _ in
|
||||
if defaultAutoShip { defaultAuto = true } // shipping implies autonomous
|
||||
pushDefaults()
|
||||
}
|
||||
}
|
||||
|
||||
private func pushDefaults() {
|
||||
store.defaultModel = defaultModel
|
||||
store.defaultEffort = defaultEffort
|
||||
store.defaultAuto = defaultAuto
|
||||
store.defaultAutoShip = defaultAutoShip
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user