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:
2026-06-13 22:26:42 -07:00
co-authored by Claude Opus 4.8
parent b226e4036a
commit 4c8b2c6a6c
3 changed files with 15 additions and 0 deletions
+4
View File
@@ -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)
}
}
+1
View File
@@ -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
View File
@@ -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
}
}