Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
|
|
struct MainTabView: View {
|
|
|
|
|
@EnvironmentObject var store: ConnectionStore
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
AdaptiveLayout()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// iPad uses NavigationSplitView; iPhone uses TabView
|
|
|
|
|
struct AdaptiveLayout: View {
|
|
|
|
|
@Environment(\.horizontalSizeClass) private var sizeClass
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
if sizeClass == .regular {
|
|
|
|
|
iPadSidebarLayout()
|
|
|
|
|
} else {
|
|
|
|
|
iPhoneTabLayout()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct iPhoneTabLayout: View {
|
|
|
|
|
var body: some View {
|
|
|
|
|
TabView {
|
|
|
|
|
NavigationStack { BackupView() }
|
|
|
|
|
.tabItem { Label("Backup", systemImage: "arrow.up.doc.fill") }
|
|
|
|
|
|
|
|
|
|
NavigationStack { HistoryView() }
|
|
|
|
|
.tabItem { Label("History", systemImage: "clock.arrow.circlepath") }
|
|
|
|
|
|
|
|
|
|
NavigationStack {
|
|
|
|
|
if let conn = ConnectionStore.shared.savedConnection {
|
|
|
|
|
BrowseView(connection: conn, selectedPath: .constant("/"))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.tabItem { Label("Browse", systemImage: "folder.fill") }
|
|
|
|
|
|
|
|
|
|
NavigationStack { SettingsView() }
|
|
|
|
|
.tabItem { Label("Settings", systemImage: "gearshape.fill") }
|
|
|
|
|
}
|
2026-05-16 00:43:31 +03:00
|
|
|
.tint(AppTheme.ink)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct iPadSidebarLayout: View {
|
|
|
|
|
@State private var selection: String? = "backup"
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
NavigationSplitView {
|
|
|
|
|
List(selection: $selection) {
|
|
|
|
|
Label("Backup", systemImage: "arrow.up.doc.fill").tag("backup")
|
|
|
|
|
Label("History", systemImage: "clock.arrow.circlepath").tag("history")
|
|
|
|
|
Label("Browse", systemImage: "folder.fill").tag("browse")
|
|
|
|
|
Label("Settings", systemImage: "gearshape.fill").tag("settings")
|
|
|
|
|
}
|
|
|
|
|
.navigationTitle("NASBackup")
|
|
|
|
|
} detail: {
|
|
|
|
|
switch selection {
|
|
|
|
|
case "backup": BackupView()
|
|
|
|
|
case "history": HistoryView()
|
|
|
|
|
case "browse":
|
|
|
|
|
if let conn = ConnectionStore.shared.savedConnection {
|
|
|
|
|
BrowseView(connection: conn, selectedPath: .constant("/"))
|
|
|
|
|
}
|
|
|
|
|
case "settings": SettingsView()
|
|
|
|
|
default: BackupView()
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-05-16 00:43:31 +03:00
|
|
|
.tint(AppTheme.ink)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
}
|