Files
ShoeGaze/Sources/LyrebirdShoeGazeUI/RigLibraryCommands.swift
T
josh e8e134499d Add macOS New/Save Rig menu items and save-on-switch prompt
- macOS File menu gains New Rig (⌘N) and Save Rig (⌘S), which forward to
  the in-window builder via shoeGazeNewRig / shoeGazeSaveRig notifications
  so the naming prompt and current-rig highlight update correctly.
- Selecting a different rig while the current one has unsaved changes now
  prompts Save / Don't Save / Cancel (both platforms). Dirtiness is
  captureState() != the loaded entry's state; a backing-less working rig
  with boards counts as dirty.
- Generalize saveCurrentRig to take a completion (used by Save & Clear and
  by save-then-switch).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 18:04:55 -07:00

20 lines
841 B
Swift

// RigLibraryCommands.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import Foundation
/// Notifications the macOS app shell posts from its menu bar so the in-window
/// ``ShoeGazeBuilderView`` — which owns the current-rig state — performs the action with the
/// correct UI (naming prompts, highlight updates). iOS has no menu bar and simply never posts them.
public extension Notification.Name {
/// Save the current rig to the library (overwrites the loaded entry, or prompts for a name).
static let shoeGazeSaveRig: Notification.Name = Notification.Name("net.realizedsound.shoegaze.saveRig")
/// Create a new, named, empty rig and make it current.
static let shoeGazeNewRig: Notification.Name = Notification.Name("net.realizedsound.shoegaze.newRig")
}