Skip to content

Open source CapCut alternative.

TypeScript

feat(app): replay onboarding from a Show Onboarding menu item

David Lef587503e681e
diff --git a/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift b/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift
index bd0893e3..5fdfacc2 100644
--- a/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift
+++ b/apps/Donkey/Sources/Donkey/DonkeyAppDelegate.swift
@@ -373,6 +373,24 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {
signOut()
}
+ @objc private func showOnboardingMenuAction(_ sender: Any?) {
+ showOnboardingWalkthrough()
+ }
+
+ /// Replays the onboarding walkthrough on demand from the menu. Unlike the first-run path, finishing or
+ /// closing it just dismisses the card — it never routes into sign-in.
+ private func showOnboardingWalkthrough() {
+ NSApp.setActivationPolicy(.regular)
+ let controller = OnboardingWindowController()
+ onboardingWindowController = controller
+ controller.present(
+ pages: OnboardingTour.pages,
+ finishButtonTitle: "Done",
+ onFinish: { [weak self] in self?.onboardingWindowController = nil },
+ onClose: { [weak self] in self?.onboardingWindowController = nil }
+ )
+ }
+
// MARK: - Permissions setup
/// Reopens the Accessibility / screenshot / microphone permission walkthrough on demand. Uses a
@@ -425,6 +443,14 @@ final class DonkeyAppDelegate: NSObject, NSApplicationDelegate {
let appMenu = NSMenu()
appMenuItem.submenu = appMenu
+ let showOnboardingItem = NSMenuItem(
+ title: "Show Onboarding",
+ action: #selector(showOnboardingMenuAction(_:)),
+ keyEquivalent: ""
+ )
+ showOnboardingItem.target = self
+ appMenu.addItem(showOnboardingItem)
+
let signOutItem = NSMenuItem(
title: "Sign Out",
action: #selector(signOutMenuAction(_:)),