- Replace History tab with Sync tab (file list, NAS status, free-up-space retention) - Add AppMenuView hamburger sheet (History, Errors, Connection Status, Sync Activity) - BackupView: Kisani logo chip in toolbar, hamburger menu button, swipeable ring pages (progress/pending/failed/uploaded), always-visible compact stats strip - SettingsView: NETWORK section (SSID, NAS reachability, trusted-network warning, refresh button) - BrowseView: pull-to-refresh, long-press context menu on items - LANMonitor: nasReachable, nasCheckTime, checkNASReachability(host:port:) - ConnectionStore: localRetentionDays (0/60/90/365 days) - Regenerate xcodeproj with xcodegen to include new files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
74 lines
2.2 KiB
Swift
74 lines
2.2 KiB
Swift
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 { SyncView() }
|
|
.tabItem { Label("Sync", systemImage: "arrow.triangle.2.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") }
|
|
}
|
|
.tint(AppTheme.ink)
|
|
}
|
|
}
|
|
|
|
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("Sync", systemImage: "arrow.triangle.2.circlepath").tag("sync")
|
|
Label("Browse", systemImage: "folder.fill").tag("browse")
|
|
Label("Settings", systemImage: "gearshape.fill").tag("settings")
|
|
}
|
|
.navigationTitle("Kisani")
|
|
} detail: {
|
|
switch selection {
|
|
case "backup": BackupView()
|
|
case "sync": SyncView()
|
|
case "browse":
|
|
if let conn = ConnectionStore.shared.savedConnection {
|
|
BrowseView(connection: conn, selectedPath: .constant("/"))
|
|
}
|
|
case "settings": SettingsView()
|
|
default: BackupView()
|
|
}
|
|
}
|
|
.tint(AppTheme.ink)
|
|
}
|
|
}
|