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>
17 lines
994 B
Markdown
17 lines
994 B
Markdown
---
|
|
name: run
|
|
description: 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:
|
|
|
|
1. Run `xcodebuild -project DisklavierLink.xcodeproj -scheme DisklavierLink -configuration Debug build` from the project root. Capture stdout and stderr.
|
|
|
|
2. 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.
|
|
|
|
3. If the build succeeds, find the built app. The output path is typically inside `~/Library/Developer/Xcode/DerivedData/DisklavierLink-*/Build/Products/Debug/DisklavierLink.app`. Use `find ~/Library/Developer/Xcode/DerivedData -name "DisklavierLink.app" -maxdepth 6` if needed.
|
|
|
|
4. Open it with `open <path-to-DisklavierLink.app>`.
|
|
|
|
5. Report whether the app launched successfully. Note any build warnings that look relevant to recent changes.
|