mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
- Create 3-page onboarding experience for new users - Page 1: Welcome message with app overview - Page 2: VT command explanation with CLI installer - Page 3: Dashboard access with tunneling options - Add "Show Tutorial" option in Help menu - Add button in Debug settings to reopen tutorial - Welcome screen opens Settings on finish - Support for marking tutorial as seen The tutorial provides a smooth introduction to VibeTunnel's key features and helps users get started quickly.
52 lines
No EOL
1.6 KiB
Swift
52 lines
No EOL
1.6 KiB
Swift
import SwiftUI
|
|
import AppKit
|
|
|
|
/// Handles the presentation of the welcome screen window
|
|
@MainActor
|
|
final class WelcomeWindowController: NSWindowController {
|
|
static let shared = WelcomeWindowController()
|
|
|
|
private init() {
|
|
let welcomeView = WelcomeView()
|
|
let hostingController = NSHostingController(rootView: welcomeView)
|
|
|
|
let window = NSWindow(contentViewController: hostingController)
|
|
window.title = ""
|
|
window.styleMask = [.titled, .closable, .fullSizeContentView]
|
|
window.titlebarAppearsTransparent = true
|
|
window.titleVisibility = .hidden
|
|
window.isMovableByWindowBackground = true
|
|
window.center()
|
|
window.setFrameAutosaveName("WelcomeWindow")
|
|
window.isReleasedWhenClosed = false
|
|
window.level = .floating
|
|
|
|
super.init(window: window)
|
|
|
|
// Listen for notification to show welcome screen
|
|
NotificationCenter.default.addObserver(
|
|
self,
|
|
selector: #selector(handleShowWelcomeNotification),
|
|
name: .showWelcomeScreen,
|
|
object: nil
|
|
)
|
|
}
|
|
|
|
required init?(coder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
func show() {
|
|
window?.makeKeyAndOrderFront(nil)
|
|
NSApp.activate(ignoringOtherApps: true)
|
|
}
|
|
|
|
@objc private func handleShowWelcomeNotification() {
|
|
show()
|
|
}
|
|
}
|
|
|
|
// MARK: - Notification Extension
|
|
extension Notification.Name {
|
|
static let showWelcomeScreen = Notification.Name("showWelcomeScreen")
|
|
} |