import SwiftUI @main struct PhotochkApp: App { @State private var model = ScanViewModel() var body: some Scene { WindowGroup { ContentView(model: model) .task { model.restorePreviousFolder() } } .defaultSize(width: 1120, height: 760) .commands { CommandGroup(replacing: .newItem) { Button("フォルダを選ぶ…") { model.chooseFolder() } .keyboardShortcut("o", modifiers: .command) } CommandGroup(after: .toolbar) { Button("再スキャン") { model.rescan() } .keyboardShortcut("r", modifiers: .command) .disabled(model.folder == nil || model.isScanning) } } } }