feat(rigs): confirm before overwriting a built-in factory rig
Saving over a currently-loaded factory rig now shows a confirmation dialog instead of silently replacing the shipped original: Overwrite (destructive), Save as New Rig… (new id, keeps the original), or Cancel. The pending follow-up (e.g. the Save & Clear clear step) is threaded through all three paths. Adds FactoryRigLibrary.factoryIDs / isFactory(_:) so the UI can tell a shipped rig from a user rig by id, with a test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,16 @@ struct FactoryRigLibraryTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test func factoryDetectionRecognisesEveryRigAndRejectsOthers() {
|
||||
let rigs: [FactoryRig] = FactoryRigLibrary.all
|
||||
#expect(FactoryRigLibrary.factoryIDs.count == rigs.count)
|
||||
for rig: FactoryRig in rigs {
|
||||
#expect(FactoryRigLibrary.isFactory(rig.id), "\(rig.name) not recognised as factory")
|
||||
}
|
||||
// A freshly generated id is not a factory rig.
|
||||
#expect(!FactoryRigLibrary.isFactory(UUID()))
|
||||
}
|
||||
|
||||
// MARK: - Seeding entries
|
||||
|
||||
@Test func makeEntriesMatchesCatalogAndIsStable() throws {
|
||||
|
||||
Reference in New Issue
Block a user