Establishes the foundational architecture for DisklavierLink: Networking layer - PianoClientProtocol defines the full async API (play, pause, stop, record, volume, skip, connect, fetchSongList) - PianoClient is a stub implementation that logs calls and simulates short async delays; fetchSongList returns hardcoded sample songs - PianoConnectionError carries a French-language error description for when the piano is unreachable (used by the simulation toggle and, later, by real HTTP failures) State and persistence - Song model (Identifiable, Codable, Hashable) with optional artist and duration fields, ready to be mapped from the future JSON API response - SettingsStore persists host, port, and autoConnectOnLaunch to UserDefaults via @Published + didSet (replacing @AppStorage, which does not work in non-View ObservableObject classes) - PianoViewModel (@MainActor ObservableObject) owns the client and settings, wraps every protocol call with error handling, and exposes isSimulatedPianoOn so the unreachable-piano path can be exercised without a physical device UI - Connection settings moved to a dedicated Settings window (Cmd+,) using SwiftUI's Settings scene and a grouped Form - Auto-connect on launch option in Settings (off by default) - Main window redesigned as a music-player layout: Now Playing card with gradient artwork tile and progress track placeholder, large circular play/pause button, sidebar song library with row selection - Connection banner appears only when disconnected, showing the French error message with a shortcut to Settings - Toolbar holds a status badge, Connect/Disconnect button, and a simulation power toggle (green = piano on, red = piano off) for testing the error path without real hardware Project - Source files reorganised into App/, Models/, Networking/, ViewModels/, Views/ subdirectories (PBXFileSystemSynchronizedRootGroup picks them up automatically — no project.pbxproj file-reference edits needed) - com.apple.security.network.client entitlement added - Deployment target updated to macOS 14.0 - SwiftFormat hook and /run skill added to .claude/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
994 B
| name | description |
|---|---|
| run | Build the DisklavierLink macOS app with xcodebuild and open it so the developer can see changes live. Use when asked to run, launch, or test the app visually. |
Build and launch the DisklavierLink macOS app:
-
Run
xcodebuild -project DisklavierLink.xcodeproj -scheme DisklavierLink -configuration Debug buildfrom the project root. Capture stdout and stderr. -
If the build fails, show the relevant error lines (not the full log — filter for
error:lines) and stop. Do not try to open a non-existent binary. -
If the build succeeds, find the built app. The output path is typically inside
~/Library/Developer/Xcode/DerivedData/DisklavierLink-*/Build/Products/Debug/DisklavierLink.app. Usefind ~/Library/Developer/Xcode/DerivedData -name "DisklavierLink.app" -maxdepth 6if needed. -
Open it with
open <path-to-DisklavierLink.app>. -
Report whether the app launched successfully. Note any build warnings that look relevant to recent changes.