mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Fix final Swift formatting issue
This commit is contained in:
parent
e77fdfe909
commit
cce2ea6343
4 changed files with 28 additions and 4 deletions
|
|
@ -2,6 +2,10 @@ import AppKit
|
||||||
import Foundation
|
import Foundation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
/// Supported terminal applications.
|
||||||
|
///
|
||||||
|
/// Represents terminal emulators that VibeTunnel can launch
|
||||||
|
/// with commands, including detection of installed terminals.
|
||||||
enum Terminal: String, CaseIterable {
|
enum Terminal: String, CaseIterable {
|
||||||
case terminal = "Terminal"
|
case terminal = "Terminal"
|
||||||
case iTerm2 = "iTerm2"
|
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 {
|
enum TerminalLauncherError: LocalizedError {
|
||||||
case terminalNotFound
|
case terminalNotFound
|
||||||
case appleScriptPermissionDenied
|
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
|
@MainActor
|
||||||
final class TerminalLauncher {
|
final class TerminalLauncher {
|
||||||
static let shared = TerminalLauncher()
|
static let shared = TerminalLauncher()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
import AppKit
|
import AppKit
|
||||||
import SwiftUI
|
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
|
@MainActor
|
||||||
final class WelcomeWindowController: NSWindowController {
|
final class WelcomeWindowController: NSWindowController {
|
||||||
static let shared = WelcomeWindowController()
|
static let shared = WelcomeWindowController()
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@ import AppKit
|
||||||
import Observation
|
import Observation
|
||||||
import SwiftUI
|
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
|
@MainActor
|
||||||
@Observable
|
@Observable
|
||||||
final class WindowSizeAnimator {
|
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 {
|
struct AnimatedWindowSizing: ViewModifier {
|
||||||
let size: CGSize
|
let size: CGSize
|
||||||
@State private var animator = WindowSizeAnimator.shared
|
@State private var animator = WindowSizeAnimator.shared
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue