Files
Kisani/Features/MainTabView.swift
Robin Kutesa 59bdad803f feat: Kisani UI overhaul — brand identity, gallery, visual polish
- Rename app to Kisani (CFBundleDisplayName, xcodeproj → Kisani.xcodeproj)
- BackupView: kisani. wordmark + SwiftUI-drawn server logo mark (no asset,
  adaptive ink/bg), 206pt progress ring with active-state glow, 4-page
  swipeable ring (progress/pending/failed/uploaded), 4-metric stats strip,
  friendly NAS card (Home Server label), hamburger → AppMenuView sheet
- GalleryView: new NAS + local photo grid with source picker chip, 3-col
  lazy grid, ThumbnailCache, sync-status dots (green = backed up)
- MainTabView: Browse tab → Gallery tab; tab bar uses ultraThinMaterial
  blur background (systemGray3 icons, 9.5pt labels)
- All app icon sizes regenerated from 1024pt source via sips
- LANMonitor: nasReachable Bool?, checkNASReachability(host:port:) TCP ping
- project.yml: photo library usage description updated to Kisani branding

Co-Authored-By: Kutesir <kutesir@provoc.ug>
Co-Authored-By: Sentry <sentry@provoc.ug>
2026-05-17 11:17:13 +03:00

85 lines
2.8 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 { GalleryView() }
.tabItem { Label("Gallery", systemImage: "photo.on.rectangle") }
NavigationStack { SyncView() }
.tabItem { Label("Sync", systemImage: "arrow.triangle.2.circlepath") }
NavigationStack { SettingsView() }
.tabItem { Label("Settings", systemImage: "gearshape.fill") }
}
.tint(AppTheme.ink)
.onAppear {
let appearance = UITabBarAppearance()
// Native iOS blur feels lighter than opaque white, more premium
appearance.configureWithDefaultBackground()
appearance.backgroundEffect = UIBlurEffect(style: .systemUltraThinMaterial)
appearance.shadowColor = UIColor.separator.withAlphaComponent(0.4)
let itemAppearance = UITabBarItemAppearance()
itemAppearance.normal.iconColor = UIColor.systemGray3
itemAppearance.normal.titleTextAttributes = [
.font: UIFont.systemFont(ofSize: 9.5, weight: .regular),
.foregroundColor: UIColor.systemGray3
]
appearance.stackedLayoutAppearance = itemAppearance
UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
}
}
}
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("Gallery", systemImage: "photo.on.rectangle").tag("browse")
Label("Sync", systemImage: "arrow.triangle.2.circlepath").tag("sync")
Label("Settings", systemImage: "gearshape.fill").tag("settings")
}
.navigationTitle("Kisani")
} detail: {
switch selection {
case "backup": BackupView()
case "sync": SyncView()
case "browse": GalleryView()
case "settings": SettingsView()
default: BackupView()
}
}
.tint(AppTheme.ink)
}
}