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

Add hover for dropdown prompt selection

grohith32715e259af3b47
diff --git a/Sources/Fluid/Views/BottomOverlayView.swift b/Sources/Fluid/Views/BottomOverlayView.swift
index c35cc7cf..1abc6fe4 100644
--- a/Sources/Fluid/Views/BottomOverlayView.swift
+++ b/Sources/Fluid/Views/BottomOverlayView.swift
@@ -181,6 +181,8 @@ final class BottomOverlayWindowController {
struct BottomOverlayView: View {
@ObservedObject private var contentState = NotchContentState.shared
@ObservedObject private var settings = SettingsStore.shared
+ @State private var showPromptHoverMenu = false
+ @State private var promptHoverWorkItem: DispatchWorkItem?
struct LayoutConstants {
let hPadding: CGFloat
@@ -300,6 +302,77 @@ struct BottomOverlayView: View {
return text.count > maxChars ? "..." + String(text.suffix(maxChars)) : text
}
+ private func handlePromptHover(_ hovering: Bool) {
+ self.promptHoverWorkItem?.cancel()
+ let task = DispatchWorkItem {
+ self.showPromptHoverMenu = hovering
+ }
+ self.promptHoverWorkItem = task
+ DispatchQueue.main.asyncAfter(deadline: .now() + (hovering ? 0.05 : 0.15), execute: task)
+ }
+
+ private func promptMenuContent() -> some View {
+ VStack(alignment: .leading, spacing: 0) {
+ Button(action: {
+ self.settings.selectedDictationPromptID = nil
+ let pid = NotchContentState.shared.recordingTargetPID
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
+ if let pid { _ = TypingService.activateApp(pid: pid) }
+ }
+ self.showPromptHoverMenu = false
+ }) {
+ HStack {
+ Text("Default")
+ Spacer()
+ if self.settings.selectedDictationPromptID == nil {
+ Image(systemName: "checkmark")
+ .font(.system(size: 10, weight: .semibold))
+ }
+ }
+ }
+ .buttonStyle(.plain)
+ .padding(.vertical, 4)
+
+ if !self.settings.dictationPromptProfiles.isEmpty {
+ Divider()
+ .padding(.vertical, 4)
+
+ ForEach(self.settings.dictationPromptProfiles) { profile in
+ Button(action: {
+ self.settings.selectedDictationPromptID = profile.id
+ let pid = NotchContentState.shared.recordingTargetPID
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
+ if let pid { _ = TypingService.activateApp(pid: pid) }
+ }
+ self.showPromptHoverMenu = false
+ }) {
+ HStack {
+ Text(profile.name.isEmpty ? "Untitled" : profile.name)
+ Spacer()
+ if self.settings.selectedDictationPromptID == profile.id {
+ Image(systemName: "checkmark")
+ .font(.system(size: 10, weight: .semibold))
+ }
+ }
+ }
+ .buttonStyle(.plain)
+ .padding(.vertical, 4)
+ }
+ }
+ }
+ .padding(.horizontal, 8)
+ .padding(.vertical, 6)
+ .background(Color.black.opacity(0.92))
+ .cornerRadius(8)
+ .overlay(
+ RoundedRectangle(cornerRadius: 8)
+ .stroke(Color.white.opacity(0.12), lineWidth: 1)
+ )
+ .onHover { hovering in
+ self.handlePromptHover(hovering)
+ }
+ }
+
var body: some View {
VStack(spacing: self.layout.vPadding / 2) {
// Transcription text area (single line)
@@ -320,27 +393,7 @@ struct BottomOverlayView: View {
// Dictation prompt selector (only in dictation mode)
if self.isDictationMode && !self.contentState.isProcessing {
- Menu {
- Button("Default") {
- self.settings.selectedDictationPromptID = nil
- let pid = NotchContentState.shared.recordingTargetPID
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
- if let pid { _ = TypingService.activateApp(pid: pid) }
- }
- }
- if !self.settings.dictationPromptProfiles.isEmpty {
- Divider()
- ForEach(self.settings.dictationPromptProfiles) { profile in
- Button(profile.name.isEmpty ? "Untitled" : profile.name) {
- self.settings.selectedDictationPromptID = profile.id
- let pid = NotchContentState.shared.recordingTargetPID
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
- if let pid { _ = TypingService.activateApp(pid: pid) }
- }
- }
- }
- }
- } label: {
+ ZStack(alignment: .top) {
HStack(spacing: 6) {
Text("Prompt:")
.font(.system(size: self.layout.modeFontSize, weight: .medium))
@@ -353,10 +406,22 @@ struct BottomOverlayView: View {
.font(.system(size: max(self.layout.modeFontSize - 2, 9), weight: .semibold))
.foregroundStyle(.white.opacity(0.45))
}
+ .padding(.horizontal, 8)
+ .padding(.vertical, 5)
+ .background(Color.white.opacity(0.05))
+ .cornerRadius(8)
+ .onHover { hovering in
+ self.handlePromptHover(hovering)
+ }
+
+ if self.showPromptHoverMenu {
+ self.promptMenuContent()
+ .padding(.top, self.layout.modeFontSize + 14)
+ .transition(.opacity)
+ .zIndex(10)
+ }
}
- .menuStyle(.button)
- .buttonStyle(.plain)
- .frame(maxWidth: self.layout.waveformWidth * 2.0)
+ .frame(maxWidth: self.layout.waveformWidth * 2.0, alignment: .top)
.transition(.opacity)
}
diff --git a/Sources/Fluid/Views/NotchContentViews.swift b/Sources/Fluid/Views/NotchContentViews.swift
index a9e950e4..626e64a8 100644
--- a/Sources/Fluid/Views/NotchContentViews.swift
+++ b/Sources/Fluid/Views/NotchContentViews.swift
@@ -234,6 +234,8 @@ struct NotchExpandedView: View {
let audioPublisher: AnyPublisher<CGFloat, Never>
@ObservedObject private var contentState = NotchContentState.shared
@ObservedObject private var settings = SettingsStore.shared
+ @State private var showPromptHoverMenu = false
+ @State private var promptHoverWorkItem: DispatchWorkItem?
private var modeColor: Color {
self.contentState.mode.notchColor
@@ -278,6 +280,77 @@ struct NotchExpandedView: View {
return "Default"
}
+ private func handlePromptHover(_ hovering: Bool) {
+ self.promptHoverWorkItem?.cancel()
+ let task = DispatchWorkItem {
+ self.showPromptHoverMenu = hovering
+ }
+ self.promptHoverWorkItem = task
+ DispatchQueue.main.asyncAfter(deadline: .now() + (hovering ? 0.05 : 0.15), execute: task)
+ }
+
+ private func promptMenuContent() -> some View {
+ VStack(alignment: .leading, spacing: 0) {
+ Button(action: {
+ self.settings.selectedDictationPromptID = nil
+ let pid = NotchContentState.shared.recordingTargetPID
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
+ if let pid { _ = TypingService.activateApp(pid: pid) }
+ }
+ self.showPromptHoverMenu = false
+ }) {
+ HStack {
+ Text("Default")
+ Spacer()
+ if self.settings.selectedDictationPromptID == nil {
+ Image(systemName: "checkmark")
+ .font(.system(size: 10, weight: .semibold))
+ }
+ }
+ }
+ .buttonStyle(.plain)
+ .padding(.vertical, 4)
+
+ if !self.settings.dictationPromptProfiles.isEmpty {
+ Divider()
+ .padding(.vertical, 4)
+
+ ForEach(self.settings.dictationPromptProfiles) { profile in
+ Button(action: {
+ self.settings.selectedDictationPromptID = profile.id
+ let pid = NotchContentState.shared.recordingTargetPID
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
+ if let pid { _ = TypingService.activateApp(pid: pid) }
+ }
+ self.showPromptHoverMenu = false
+ }) {
+ HStack {
+ Text(profile.name.isEmpty ? "Untitled" : profile.name)
+ Spacer()
+ if self.settings.selectedDictationPromptID == profile.id {
+ Image(systemName: "checkmark")
+ .font(.system(size: 10, weight: .semibold))
+ }
+ }
+ }
+ .buttonStyle(.plain)
+ .padding(.vertical, 4)
+ }
+ }
+ }
+ .padding(.horizontal, 8)
+ .padding(.vertical, 6)
+ .background(Color.black.opacity(0.92))
+ .cornerRadius(8)
+ .overlay(
+ RoundedRectangle(cornerRadius: 8)
+ .stroke(Color.white.opacity(0.12), lineWidth: 1)
+ )
+ .onHover { hovering in
+ self.handlePromptHover(hovering)
+ }
+ }
+
var body: some View {
VStack(spacing: 4) {
// Visualization + Mode label row
@@ -310,27 +383,7 @@ struct NotchExpandedView: View {
// Dictation prompt selector (only in dictation mode)
if self.isDictationMode && !self.contentState.isProcessing {
- Menu {
- Button("Default") {
- self.settings.selectedDictationPromptID = nil
- let pid = NotchContentState.shared.recordingTargetPID
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
- if let pid { _ = TypingService.activateApp(pid: pid) }
- }
- }
- if !self.settings.dictationPromptProfiles.isEmpty {
- Divider()
- ForEach(self.settings.dictationPromptProfiles) { profile in
- Button(profile.name.isEmpty ? "Untitled" : profile.name) {
- self.settings.selectedDictationPromptID = profile.id
- let pid = NotchContentState.shared.recordingTargetPID
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
- if let pid { _ = TypingService.activateApp(pid: pid) }
- }
- }
- }
- }
- } label: {
+ ZStack(alignment: .top) {
HStack(spacing: 6) {
Text("Prompt:")
.font(.system(size: 9, weight: .medium))
@@ -343,10 +396,22 @@ struct NotchExpandedView: View {
.font(.system(size: 8, weight: .semibold))
.foregroundStyle(.white.opacity(0.45))
}
+ .padding(.horizontal, 6)
+ .padding(.vertical, 4)
+ .background(Color.white.opacity(0.04))
+ .cornerRadius(6)
+ .onHover { hovering in
+ self.handlePromptHover(hovering)
+ }
+
+ if self.showPromptHoverMenu {
+ self.promptMenuContent()
+ .padding(.top, 26)
+ .transition(.opacity)
+ .zIndex(10)
+ }
}
- .menuStyle(.button)
- .buttonStyle(.plain)
- .frame(maxWidth: 180)
+ .frame(maxWidth: 180, alignment: .top)
.transition(.opacity)
}