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
@@ -70,6 +70,11 @@ extension ChainRouter {
@MainActor
public enum FactoryRigLibrary {
/// Catalog seed version. Bump this whenever new factory rigs are added so first-run catch-up
/// seeding re-runs on already-populated libraries and installs the newly-shipped starters. Never
/// re-adds a rig the user has since deleted at the *same* version — the marker only advances.
public static let seedVersion: Int = 1
/// Stable ids of every built-in rig, for detecting whether a library entry is a factory rig.
///
/// Because factory rigs are seeded with their fixed ``FactoryRig/id``, an entry recalled from the