diff --git a/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift b/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift index 51b31491..9c31be3c 100644 --- a/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift +++ b/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift @@ -153,7 +153,7 @@ struct DashboardSettingsView: View { showPasswordFields = false password = "" confirmPassword = "" - + // Clear cached password in LazyBasicAuthMiddleware LazyBasicAuthMiddleware.clearCache() diff --git a/VibeTunnel/Utilities/TerminalLauncher.swift b/VibeTunnel/Utilities/TerminalLauncher.swift index 48f92143..f94739b8 100644 --- a/VibeTunnel/Utilities/TerminalLauncher.swift +++ b/VibeTunnel/Utilities/TerminalLauncher.swift @@ -2,6 +2,10 @@ import AppKit import Foundation import SwiftUI +/// Supported terminal applications. +/// +/// Represents terminal emulators that VibeTunnel can launch +/// with commands, including detection of installed terminals. enum Terminal: String, CaseIterable { case terminal = "Terminal" case iTerm2 = "iTerm2" @@ -41,6 +45,10 @@ enum Terminal: String, CaseIterable { } } +/// Errors that can occur when launching terminal commands. +/// +/// Represents failures during terminal application launch, +/// including permission issues and missing applications. enum TerminalLauncherError: LocalizedError { case terminalNotFound case appleScriptPermissionDenied @@ -58,6 +66,11 @@ enum TerminalLauncherError: LocalizedError { } } +/// Manages launching terminal commands in the user's preferred terminal. +/// +/// Handles terminal application detection, preference management, +/// and command execution through AppleScript or direct process launching. +/// Supports Terminal, iTerm2, and Ghostty with automatic fallback. @MainActor final class TerminalLauncher { static let shared = TerminalLauncher() diff --git a/VibeTunnel/Utilities/WelcomeWindowController.swift b/VibeTunnel/Utilities/WelcomeWindowController.swift index cbbf4bdb..ac434e69 100644 --- a/VibeTunnel/Utilities/WelcomeWindowController.swift +++ b/VibeTunnel/Utilities/WelcomeWindowController.swift @@ -1,7 +1,11 @@ import AppKit import SwiftUI -/// Handles the presentation of the welcome screen window +/// Handles the presentation of the welcome screen window. +/// +/// Manages the lifecycle and presentation of the onboarding welcome window, +/// including window configuration, positioning, and notification-based showing. +/// Configured as a floating panel with transparent titlebar for modern appearance. @MainActor final class WelcomeWindowController: NSWindowController { static let shared = WelcomeWindowController() diff --git a/VibeTunnel/Utilities/WindowSizeAnimator.swift b/VibeTunnel/Utilities/WindowSizeAnimator.swift index eb7bc635..ebf02e3a 100644 --- a/VibeTunnel/Utilities/WindowSizeAnimator.swift +++ b/VibeTunnel/Utilities/WindowSizeAnimator.swift @@ -2,7 +2,11 @@ import AppKit import Observation import SwiftUI -/// A custom window size animator that works with SwiftUI Settings windows +/// A custom window size animator that works with SwiftUI Settings windows. +/// +/// Provides smooth animated transitions when resizing windows, particularly +/// useful for settings windows that change size based on tab selection. +/// Works around SwiftUI limitations by using AppKit's NSViewAnimation. @MainActor @Observable final class WindowSizeAnimator { @@ -73,7 +77,10 @@ final class WindowSizeAnimator { } } -/// A view modifier that captures the window and enables animated resizing +/// A view modifier that captures the window and enables animated resizing. +/// +/// Automatically captures the host window and animates size changes +/// when the provided size value changes. struct AnimatedWindowSizing: ViewModifier { let size: CGSize @State private var animator = WindowSizeAnimator.shared