Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

feat(onboarding): blend window into desktop

altic-devbb176ddbe1cd
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index 26b8f8a3..df979ac9 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -407,8 +407,9 @@ struct ContentView: View {
let sized = nav.fluidWindowSizing(self.windowSizing)
let observed = self.applyShortcutStateChanges(to: sized)
+ let withToolbar = self.applyMainWindowToolbar(to: observed)
- return observed
+ return withToolbar
.onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in
self.refreshAccessibilityPermissionState()
}
@@ -427,25 +428,6 @@ struct ContentView: View {
.onReceive(self.asr.$partialTranscription) { text in
self.handleSpokenSendPartialTranscription(text)
}
- .toolbar {
- if !self.settings.shouldShowOnboarding {
- ToolbarItemGroup(placement: .primaryAction) {
- self.todayStatsButton
- .buttonStyle(.automatic)
-
- self.themePreferenceButton
- .buttonStyle(.automatic)
-
- Button(action: self.openIssueReportingPage) {
- Image(systemName: "ladybug.fill")
- }
- .buttonStyle(.automatic)
- .help("Report an issue")
- .accessibilityLabel("Report an issue")
- }
- }
- }
- .toolbar(removing: .sidebarToggle)
.overlay(alignment: .center) {}
.alert(
self.asr.errorTitle,
@@ -1714,6 +1696,7 @@ struct ContentView: View {
theme: self.theme
)
.environmentObject(self.appServices)
+ .ignoresSafeArea(.container, edges: .top)
}
// MARK: - Welcome Guide
@@ -1769,6 +1752,32 @@ struct ContentView: View {
return .minimum(width: window.mainMinWidth, height: window.mainMinHeight)
}
+ @ViewBuilder
+ private func applyMainWindowToolbar<Content: View>(to content: Content) -> some View {
+ if self.settings.shouldShowOnboarding {
+ content
+ } else {
+ content
+ .toolbar {
+ ToolbarItemGroup(placement: .primaryAction) {
+ self.todayStatsButton
+ .buttonStyle(.automatic)
+
+ self.themePreferenceButton
+ .buttonStyle(.automatic)
+
+ Button(action: self.openIssueReportingPage) {
+ Image(systemName: "ladybug.fill")
+ }
+ .buttonStyle(.automatic)
+ .help("Report an issue")
+ .accessibilityLabel("Report an issue")
+ }
+ }
+ .toolbar(removing: .sidebarToggle)
+ }
+ }
+
private var microphoneActionButton: some View {
Group {
if self.asr.micStatus == .notDetermined {
diff --git a/Sources/Fluid/Theme/Components/OnboardingComponents.swift b/Sources/Fluid/Theme/Components/OnboardingComponents.swift
index dccae33c..4920a749 100644
--- a/Sources/Fluid/Theme/Components/OnboardingComponents.swift
+++ b/Sources/Fluid/Theme/Components/OnboardingComponents.swift
@@ -1,6 +1,11 @@
import AppKit
import SwiftUI
+enum FluidOnboardingLayout {
+ static let footerHorizontalInset: CGFloat = 56
+ static let footerBottomInset: CGFloat = 56
+}
+
struct OnboardingModelInfoTooltip: View {
let text: String
let font: Font
@@ -108,7 +113,11 @@ struct FluidOnboardingLandingBackdrop: View {
var body: some View {
ZStack {
+ Rectangle()
+ .fill(.ultraThinMaterial)
+
Color(red: 0.012, green: 0.019, blue: 0.031)
+ .opacity(0.88)
RadialGradient(
colors: [
@@ -131,10 +140,73 @@ struct FluidOnboardingLandingBackdrop: View {
endRadius: 520
)
}
+ .mask {
+ RoundedRectangle(cornerRadius: 34, style: .continuous)
+ .inset(by: 14)
+ .fill(.white)
+ .blur(radius: 20)
+ }
.ignoresSafeArea()
}
}
+struct FluidOnboardingWindowTransparency: NSViewRepresentable {
+ func makeNSView(context _: Context) -> NSView {
+ FluidOnboardingWindowTransparencyView()
+ }
+
+ func updateNSView(_: NSView, context _: Context) {}
+}
+
+private final class FluidOnboardingWindowTransparencyView: NSView {
+ private struct WindowSnapshot {
+ let isOpaque: Bool
+ let backgroundColor: NSColor
+ let hasShadow: Bool
+ }
+
+ private weak var observedWindow: NSWindow?
+ private var snapshot: WindowSnapshot?
+
+ deinit {
+ self.restoreWindow()
+ }
+
+ override func viewWillMove(toWindow newWindow: NSWindow?) {
+ if self.observedWindow !== newWindow {
+ self.restoreWindow()
+ }
+ super.viewWillMove(toWindow: newWindow)
+ }
+
+ override func viewDidMoveToWindow() {
+ super.viewDidMoveToWindow()
+ guard let window else { return }
+
+ if self.observedWindow !== window {
+ self.observedWindow = window
+ self.snapshot = WindowSnapshot(
+ isOpaque: window.isOpaque,
+ backgroundColor: window.backgroundColor,
+ hasShadow: window.hasShadow
+ )
+ }
+
+ window.isOpaque = false
+ window.backgroundColor = .clear
+ window.hasShadow = false
+ }
+
+ private func restoreWindow() {
+ guard let window = self.observedWindow, let snapshot else { return }
+ window.isOpaque = snapshot.isOpaque
+ window.backgroundColor = snapshot.backgroundColor
+ window.hasShadow = snapshot.hasShadow
+ self.observedWindow = nil
+ self.snapshot = nil
+ }
+}
+
struct FluidOnboardingCompactProgress: View {
let value: Double
diff --git a/Sources/Fluid/UI/OnboardingAIEnhancementStepView.swift b/Sources/Fluid/UI/OnboardingAIEnhancementStepView.swift
index 0f6484ad..cec2a827 100644
--- a/Sources/Fluid/UI/OnboardingAIEnhancementStepView.swift
+++ b/Sources/Fluid/UI/OnboardingAIEnhancementStepView.swift
@@ -118,8 +118,8 @@ struct OnboardingAIEnhancementStepView: View {
self.offerNavigation
}
}
- .padding(.horizontal, 30)
- .padding(.bottom, 20)
+ .padding(.horizontal, FluidOnboardingLayout.footerHorizontalInset)
+ .padding(.bottom, FluidOnboardingLayout.footerBottomInset)
.padding(.top, 12)
.fixedSize(horizontal: false, vertical: true)
}
diff --git a/Sources/Fluid/UI/WelcomeView.swift b/Sources/Fluid/UI/WelcomeView.swift
index 0afbe9af..fba7c32c 100644
--- a/Sources/Fluid/UI/WelcomeView.swift
+++ b/Sources/Fluid/UI/WelcomeView.swift
@@ -357,16 +357,7 @@ struct OnboardingFlowView: View {
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
}
.background {
- ZStack {
- self.theme.palette.windowBackground
- .opacity(0.98)
- .ignoresSafeArea()
-
- Rectangle()
- .fill(self.theme.materials.window)
- .opacity(0.75)
- .ignoresSafeArea()
- }
+ FluidOnboardingWindowTransparency()
}
.onAppear {
self.isOnboardingFlowVisible = true
@@ -522,8 +513,8 @@ struct OnboardingFlowView: View {
height: FluidOnboardingLandingPrimaryButton.size.height
)
}
- .padding(.horizontal, 30)
- .padding(.bottom, 24)
+ .padding(.horizontal, FluidOnboardingLayout.footerHorizontalInset)
+ .padding(.bottom, FluidOnboardingLayout.footerBottomInset)
}
FluidOnboardingLandingHoverTracker(
@@ -917,8 +908,8 @@ struct OnboardingFlowView: View {
}
.keyboardShortcut(.defaultAction)
}
- .padding(.horizontal, 30)
- .padding(.bottom, 24)
+ .padding(.horizontal, FluidOnboardingLayout.footerHorizontalInset)
+ .padding(.bottom, FluidOnboardingLayout.footerBottomInset)
}
private func cinematicFooterButton(
diff --git a/Sources/Fluid/fluidApp.swift b/Sources/Fluid/fluidApp.swift
index 4d94cbfc..40dbbef3 100644
--- a/Sources/Fluid/fluidApp.swift
+++ b/Sources/Fluid/fluidApp.swift
@@ -30,6 +30,7 @@ struct FluidApp: App {
}
}
.defaultSize(width: 1000, height: 700)
+ .windowStyle(.hiddenTitleBar)
.commands {
CommandGroup(replacing: .appSettings) {
Button("Settings...") {