fix(rigs): don't let starter overwrites be reverted by reseeding
External-review findings for 3.1.0: - A starter rig can no longer be overwritten in place. Saving over a loaded starter previously stored the edited content under the rig's fixed factory id, so the next starter-catalog update (or Restore Starter Rigs) would silently revert it to the shipped version. The confirmation now offers only Save as New Rig / Cancel — a starter is managed content, and the player's changes are kept as their own rig (a new id) instead. - restoreStarterRigs advances the seed-version marker only on success, matching start(), so a failed manual restore no longer suppresses the next launch's automatic catch-up seed. - CHANGELOG: correct the starter-rig count (18, not 19). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -320,7 +320,7 @@ public struct ShoeGazeBuilderView: View {
|
||||
.background(actionErrorAnchor)
|
||||
.rigNamePrompt($namePrompt)
|
||||
.confirmationDialog(
|
||||
"Overwrite starter rig?",
|
||||
"Starter rig",
|
||||
isPresented: Binding(
|
||||
get: { factoryOverwrite != nil },
|
||||
set: { presented in if !presented { factoryOverwrite = nil } }
|
||||
@@ -328,12 +328,9 @@ public struct ShoeGazeBuilderView: View {
|
||||
titleVisibility: .visible,
|
||||
presenting: factoryOverwrite
|
||||
) { request in
|
||||
Button("Overwrite", role: .destructive) {
|
||||
persist(
|
||||
shoeGaze.captureEntry(name: request.entry.name, id: request.entry.id),
|
||||
then: request.completion
|
||||
)
|
||||
}
|
||||
// A starter rig is managed content: it is refreshed to the shipped version whenever the
|
||||
// starter catalog updates, so it deliberately cannot be overwritten in place — that would
|
||||
// silently revert on the next update. The player keeps their changes as a new rig instead.
|
||||
Button("Save as New Rig…") {
|
||||
// Defer one runloop hop: presenting the name-entry alert while the confirmation
|
||||
// dialog is still dismissing can drop the new presentation on some SwiftUI versions.
|
||||
@@ -342,8 +339,8 @@ public struct ShoeGazeBuilderView: View {
|
||||
}
|
||||
Button("Cancel", role: .cancel) { }
|
||||
} message: { request in
|
||||
Text("“\(request.entry.name)” is a built-in starter rig. Overwriting replaces it in "
|
||||
+ "your library. Save as a new rig to keep the original.")
|
||||
Text("“\(request.entry.name)” is a built-in starter rig and can't be changed in place. "
|
||||
+ "Save your changes as a new rig to keep them.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user