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>
This commit is contained in:
@@ -3,7 +3,7 @@ import SwiftUI
|
||||
struct LoginView: View {
|
||||
@EnvironmentObject var store: ConnectionStore
|
||||
@StateObject private var vm = LoginViewModel()
|
||||
@State private var logoAppeared = false
|
||||
@State private var appeared = false
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
@@ -12,70 +12,79 @@ struct LoginView: View {
|
||||
VStack(spacing: 0) {
|
||||
Spacer()
|
||||
|
||||
// Logo
|
||||
Image("nas_logo_clean")
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 72, height: 72)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 18, style: .continuous))
|
||||
.shadow(color: .black.opacity(0.08), radius: 16, x: 0, y: 4)
|
||||
.scaleEffect(logoAppeared ? 1 : 0.8)
|
||||
.opacity(logoAppeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.5, dampingFraction: 0.7).delay(0.1), value: logoAppeared)
|
||||
// Logo + wordmark
|
||||
VStack(spacing: 20) {
|
||||
Image("nas_logo_clean")
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 80, height: 80)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 20, style: .continuous))
|
||||
.shadow(color: .black.opacity(0.12), radius: 20, x: 0, y: 6)
|
||||
.scaleEffect(appeared ? 1 : 0.85)
|
||||
.opacity(appeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.5, dampingFraction: 0.72).delay(0.08), value: appeared)
|
||||
|
||||
Spacer().frame(height: 32)
|
||||
VStack(spacing: 6) {
|
||||
Text("Kisani")
|
||||
.font(.system(size: 32, weight: .bold, design: .default))
|
||||
.foregroundStyle(AppTheme.ink)
|
||||
.opacity(appeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.45, dampingFraction: 0.8).delay(0.16), value: appeared)
|
||||
|
||||
// Title + account
|
||||
VStack(spacing: 5) {
|
||||
Text("Kisani")
|
||||
.font(.system(size: 22, weight: .semibold))
|
||||
.foregroundStyle(AppTheme.ink)
|
||||
Text("Sign in to continue")
|
||||
.font(AppTheme.caption())
|
||||
.foregroundStyle(AppTheme.inkTertiary)
|
||||
}
|
||||
.opacity(logoAppeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.5, dampingFraction: 0.7).delay(0.2), value: logoAppeared)
|
||||
|
||||
Spacer().frame(height: 40)
|
||||
|
||||
// Face ID button
|
||||
Button(action: { vm.authenticateWithFaceID() }) {
|
||||
HStack(spacing: 8) {
|
||||
if vm.isAuthenticating {
|
||||
ProgressView()
|
||||
.tint(AppTheme.inkInverse)
|
||||
.scaleEffect(0.8)
|
||||
} else {
|
||||
Image(systemName: "faceid")
|
||||
.font(.system(size: 16, weight: .medium))
|
||||
Text("Sign in with Face ID")
|
||||
}
|
||||
Text("Your NAS, always in sync.")
|
||||
.font(.system(size: 15, weight: .regular))
|
||||
.foregroundStyle(AppTheme.inkTertiary)
|
||||
.opacity(appeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.45, dampingFraction: 0.8).delay(0.22), value: appeared)
|
||||
}
|
||||
}
|
||||
.buttonStyle(PrimaryButtonStyle())
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.disabled(vm.isAuthenticating)
|
||||
.opacity(logoAppeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.5, dampingFraction: 0.7).delay(0.3), value: logoAppeared)
|
||||
|
||||
if let error = vm.authError {
|
||||
Text(error)
|
||||
.font(AppTheme.caption())
|
||||
Spacer().frame(height: 52)
|
||||
|
||||
// Auth button + error
|
||||
VStack(spacing: 12) {
|
||||
Button(action: { vm.authenticateWithFaceID() }) {
|
||||
HStack(spacing: 8) {
|
||||
if vm.isAuthenticating {
|
||||
ProgressView()
|
||||
.tint(AppTheme.inkInverse)
|
||||
.scaleEffect(0.85)
|
||||
} else {
|
||||
Image(systemName: "faceid")
|
||||
.font(.system(size: 17, weight: .medium))
|
||||
Text("Sign in with Face ID")
|
||||
.font(.system(size: 15, weight: .semibold))
|
||||
}
|
||||
}
|
||||
}
|
||||
.buttonStyle(PrimaryButtonStyle())
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.disabled(vm.isAuthenticating)
|
||||
.opacity(appeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.45, dampingFraction: 0.8).delay(0.28), value: appeared)
|
||||
|
||||
if let error = vm.authError {
|
||||
HStack(spacing: 5) {
|
||||
Image(systemName: "exclamationmark.circle")
|
||||
.font(.system(size: 12))
|
||||
Text(error)
|
||||
.font(AppTheme.caption())
|
||||
}
|
||||
.foregroundStyle(AppTheme.destructive)
|
||||
.padding(.top, 12)
|
||||
.transition(.opacity.combined(with: .move(edge: .top)))
|
||||
}
|
||||
}
|
||||
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: vm.authError != nil)
|
||||
|
||||
Spacer()
|
||||
|
||||
// More
|
||||
// More options
|
||||
Button("More options") { vm.showMoreSheet = true }
|
||||
.font(.system(size: 13, weight: .regular))
|
||||
.foregroundStyle(AppTheme.inkTertiary)
|
||||
.padding(.bottom, 44)
|
||||
.opacity(logoAppeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.5, dampingFraction: 0.7).delay(0.4), value: logoAppeared)
|
||||
.padding(.bottom, 48)
|
||||
.opacity(appeared ? 1 : 0)
|
||||
.animation(.spring(response: 0.45, dampingFraction: 0.8).delay(0.36), value: appeared)
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $vm.showMoreSheet) {
|
||||
@@ -88,7 +97,7 @@ struct LoginView: View {
|
||||
}
|
||||
.onAppear {
|
||||
vm.onAuthenticated = { store.isSessionActive = true }
|
||||
logoAppeared = true
|
||||
appeared = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,7 +128,7 @@ struct MoreOptionsSheet: View {
|
||||
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous)
|
||||
.stroke(AppTheme.cardBorderColor, lineWidth: 0.5)
|
||||
.stroke(AppTheme.ink.opacity(0.08), lineWidth: 0.5)
|
||||
)
|
||||
.padding(.horizontal, AppTheme.hPad)
|
||||
.padding(.bottom, 16)
|
||||
|
||||
Reference in New Issue
Block a user