feat: Kisani rebrand, step-based onboarding flow, dark mode fixes
- Rename app to Kisani in all UI text and Face ID prompt
- Replace flat 2-state RootView with 5-step flow: ConnectView →
LoginView → FolderSetupView → PhotoPermissionView → MainTabView
- Remove NavigationStack from LoginView (was causing nested-stack crash);
drive navigation via ConnectionStore.isSessionActive
- Add FolderSetupView and PhotoPermissionView onboarding screens with
step indicator (2/3, 3/3), spring entrance animations, and UGreen
connection chip
- Fix dark mode button invisibility: PrimaryButtonStyle and PillButtonStyle
now use AppTheme.inkInverse; GhostButtonStyle border uses ink.opacity(0.25)
- Add AppTheme.inkInverse adaptive token (dark bg ink on dark, white on light)
- Add ConnectionStore.isSessionActive (non-persisted) and
onboardingPhotoShown (UserDefaults-persisted)
- Add os_log logging in LoginViewModel at auth start/success/failure
- Remove dead Help button from ConnectView
- UGreenCompatibilityBadge, KeychainStore, SavedConnections, extensions,
PrivacyInfo.xcprivacy, unit test target and test stubs
- AppTheme: full UIColor dynamic provider tokens for dark/light adaptive color
- AppearanceMode enum + segmented picker in SettingsView
- BackupView: enlarged ring, removed options card and linear progress bar
- HistoryView: duration and bytes formatting, improved typography hierarchy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 16:20:53 +03:00
|
|
|
import Foundation
|
|
|
|
|
@testable import NASBackup
|
|
|
|
|
|
|
|
|
|
final class MockNASService: NASTransferProtocol {
|
|
|
|
|
var shouldFail: Bool = false
|
|
|
|
|
var uploadDelay: TimeInterval = 0
|
|
|
|
|
var fakeItems: [NASItem] = []
|
|
|
|
|
var fileExistsAnswer: Bool = false
|
|
|
|
|
|
|
|
|
|
private(set) var connectCalled = false
|
|
|
|
|
private(set) var uploadCallCount = 0
|
|
|
|
|
private(set) var lastUploadedPath: String?
|
|
|
|
|
|
|
|
|
|
var isConnected: Bool = false
|
|
|
|
|
|
|
|
|
|
func connect(to host: String, port: Int, username: String, password: String) async throws {
|
|
|
|
|
connectCalled = true
|
|
|
|
|
if shouldFail { throw MockError.connectionFailed }
|
|
|
|
|
isConnected = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func disconnect() { isConnected = false }
|
|
|
|
|
|
fix: SMB share enumeration, BrowseView polish, sign out, Login branding
- Fix "Bad Network Name": BrowseView at root "/" for SMB now calls
listShares() instead of listDirectory with empty share name.
SMBClient.listShares() filters IPC/admin/hidden ($) shares.
- Add listShares() to NASTransferProtocol; implement in SMB (filters
ipc/special/$-suffix) and SFTP (returns []).
- BrowseView: premium error state (wifi.exclamationmark icon + Retry
button with ScaleButtonStyle), empty state, safeAreaInset bottom bar
replacing toolbar bottomBar (shows current path chip + compact Select
button), proper disabled state for root selection on SMB.
- FolderRow: replace hardcoded .white with AppTheme.inkInverse for dark
mode correctness; use folder.fill icon; ScaleButtonStyle for tap feedback.
- LoginView: larger logo (80pt), bolder "Kisani" wordmark (32pt bold),
tagline, staggered spring entrance animations (0.08-0.36s delay).
- SettingsView: Sign Out button in ACCOUNT section with
confirmationDialog (destructive, clears connection + resets session).
- ConnectionStore: signOut() resets isSessionActive, onboardingPhotoShown,
and clears savedConnection (triggers Keychain delete).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 16:41:16 +03:00
|
|
|
func listShares() async throws -> [String] { [] }
|
|
|
|
|
|
feat: Kisani rebrand, step-based onboarding flow, dark mode fixes
- Rename app to Kisani in all UI text and Face ID prompt
- Replace flat 2-state RootView with 5-step flow: ConnectView →
LoginView → FolderSetupView → PhotoPermissionView → MainTabView
- Remove NavigationStack from LoginView (was causing nested-stack crash);
drive navigation via ConnectionStore.isSessionActive
- Add FolderSetupView and PhotoPermissionView onboarding screens with
step indicator (2/3, 3/3), spring entrance animations, and UGreen
connection chip
- Fix dark mode button invisibility: PrimaryButtonStyle and PillButtonStyle
now use AppTheme.inkInverse; GhostButtonStyle border uses ink.opacity(0.25)
- Add AppTheme.inkInverse adaptive token (dark bg ink on dark, white on light)
- Add ConnectionStore.isSessionActive (non-persisted) and
onboardingPhotoShown (UserDefaults-persisted)
- Add os_log logging in LoginViewModel at auth start/success/failure
- Remove dead Help button from ConnectView
- UGreenCompatibilityBadge, KeychainStore, SavedConnections, extensions,
PrivacyInfo.xcprivacy, unit test target and test stubs
- AppTheme: full UIColor dynamic provider tokens for dark/light adaptive color
- AppearanceMode enum + segmented picker in SettingsView
- BackupView: enlarged ring, removed options card and linear progress bar
- HistoryView: duration and bytes formatting, improved typography hierarchy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 16:20:53 +03:00
|
|
|
func listDirectory(at path: String) async throws -> [NASItem] {
|
|
|
|
|
if shouldFail { throw MockError.connectionFailed }
|
|
|
|
|
return fakeItems
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func createDirectory(at path: String) async throws {
|
|
|
|
|
if shouldFail { throw MockError.connectionFailed }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func fileExists(at remotePath: String) async throws -> Bool { fileExistsAnswer }
|
|
|
|
|
|
|
|
|
|
func upload(localURL: URL, remotePath: String, progress: @escaping (Int64, Int64) -> Void) async throws {
|
|
|
|
|
if uploadDelay > 0 {
|
|
|
|
|
try await Task.sleep(nanoseconds: UInt64(uploadDelay * 1_000_000_000))
|
|
|
|
|
}
|
|
|
|
|
if shouldFail { throw MockError.uploadFailed }
|
|
|
|
|
progress(100, 100)
|
|
|
|
|
uploadCallCount += 1
|
|
|
|
|
lastUploadedPath = remotePath
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum MockError: Error {
|
|
|
|
|
case connectionFailed
|
|
|
|
|
case uploadFailed
|
|
|
|
|
}
|