feat(ui): Mine/Starters rig toggle + seed starters into existing libraries

Two fixes so shipped starter rigs are actually reachable:

- Seeding no longer requires an empty library. On launch it installs any
  factory rigs whose stable ids are missing, once per FactoryRigLibrary
  .seedVersion (a per-device UserDefaults marker). Existing users therefore
  receive the starters on their next launch; a starter the user later
  deletes stays deleted (the marker has advanced); bumping seedVersion when
  new starters ship re-runs catch-up for just the new ones. Idempotent by id,
  so iCloud-synced devices never duplicate.
- Sidebar gains a segmented Mine / Starters toggle. "Mine" is the flat,
  reorderable user list; "Starters" groups the shipped rigs by category. A
  "Restore Starter Rigs" action (Starters empty-state button + library menu)
  re-installs missing starters on demand via RigLibraryBootstrap.restoreStarterRigs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-09 14:11:22 -07:00
parent fba32ff0aa
commit ad6ed41674
4 changed files with 168 additions and 77 deletions
@@ -645,10 +645,18 @@ public struct ShoeGazeBuilderView: View {
onEraseAll: { showEraseAllDialog = true },
onImportArchive: { showImporter = true },
onExportArchive: { exportArchiveAction() },
onRestoreStarters: { restoreStarterRigs() },
onShowCloudStatus: { showICloudUnavailableAlert = true }
)
}
/// (Re-)installs any shipped starter rigs missing from the library. Non-destructive: user rigs
/// are untouched, and already-present starters are skipped (matched by stable id).
private func restoreStarterRigs() {
let added: Int = RigLibraryBootstrap.restoreStarterRigs(into: library)
print("[ShoeGazeBuilderView] restored \(added) starter rig(s)")
}
// MARK: - Sleep / iCloud status
/// Platform name for the settings app, used in the iCloud guidance alert.