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

Added rewrite/write mode working well, change to settings to add shortcut key modifications fo r all 3 modes, modified prompts for write(empty) / rewrite ( with selected text) modes

altic-dev7f91a6251410
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index bef30f6f..a9e83720 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -94,6 +94,7 @@ struct ContentView: View {
@State private var isRecordingForRewrite: Bool = false // Track if current recording is for rewrite mode
@State private var isRecordingForCommand: Bool = false // Track if current recording is for command mode
@State private var isRecordingShortcut = false
+ @State private var isRecordingCommandModeShortcut = false
@State private var isRecordingRewriteShortcut = false
@State private var pendingModifierFlags: NSEvent.ModifierFlags = []
@State private var pendingModifierKeyCode: UInt16?
@@ -314,8 +315,8 @@ struct ContentView: View {
let eventModifiers = event.modifierFlags.intersection([.function, .command, .option, .control, .shift])
let shortcutModifiers = hotkeyShortcut.modifierFlags.intersection([.function, .command, .option, .control, .shift])
- let isRecordingAnyShortcut = isRecordingShortcut || isRecordingRewriteShortcut
- DebugLogger.shared.debug("NSEvent \(event.type) keyCode=\(event.keyCode) recordingShortcut=\(isRecordingShortcut) recordingRewrite=\(isRecordingRewriteShortcut)", source: "ContentView")
+ let isRecordingAnyShortcut = isRecordingShortcut || isRecordingCommandModeShortcut || isRecordingRewriteShortcut
+ DebugLogger.shared.debug("NSEvent \(event.type) keyCode=\(event.keyCode) recordingShortcut=\(isRecordingShortcut) recordingCommand=\(isRecordingCommandModeShortcut) recordingRewrite=\(isRecordingRewriteShortcut)", source: "ContentView")
if event.type == .keyDown {
if event.keyCode == hotkeyShortcut.keyCode && eventModifiers == shortcutModifiers {
@@ -353,6 +354,7 @@ struct ContentView: View {
if keyCode == 53 {
DebugLogger.shared.debug("NSEvent monitor: Escape pressed, cancelling shortcut recording", source: "ContentView")
isRecordingShortcut = false
+ isRecordingCommandModeShortcut = false
isRecordingRewriteShortcut = false
resetPendingShortcutState()
return nil
@@ -367,6 +369,11 @@ struct ContentView: View {
SettingsStore.shared.rewriteModeHotkeyShortcut = newShortcut
hotkeyManager?.updateRewriteModeShortcut(newShortcut)
isRecordingRewriteShortcut = false
+ } else if isRecordingCommandModeShortcut {
+ commandModeHotkeyShortcut = newShortcut
+ SettingsStore.shared.commandModeHotkeyShortcut = newShortcut
+ hotkeyManager?.updateCommandModeShortcut(newShortcut)
+ isRecordingCommandModeShortcut = false
} else {
hotkeyShortcut = newShortcut
SettingsStore.shared.hotkeyShortcut = newShortcut
@@ -400,6 +407,11 @@ struct ContentView: View {
SettingsStore.shared.rewriteModeHotkeyShortcut = newShortcut
hotkeyManager?.updateRewriteModeShortcut(newShortcut)
isRecordingRewriteShortcut = false
+ } else if isRecordingCommandModeShortcut {
+ commandModeHotkeyShortcut = newShortcut
+ SettingsStore.shared.commandModeHotkeyShortcut = newShortcut
+ hotkeyManager?.updateCommandModeShortcut(newShortcut)
+ isRecordingCommandModeShortcut = false
} else {
hotkeyShortcut = newShortcut
SettingsStore.shared.hotkeyShortcut = newShortcut
@@ -757,6 +769,8 @@ struct ContentView: View {
accessibilityEnabled: $accessibilityEnabled,
hotkeyShortcut: $hotkeyShortcut,
isRecordingShortcut: $isRecordingShortcut,
+ commandModeShortcut: $commandModeHotkeyShortcut,
+ isRecordingCommandModeShortcut: $isRecordingCommandModeShortcut,
rewriteShortcut: $rewriteModeHotkeyShortcut,
isRecordingRewriteShortcut: $isRecordingRewriteShortcut,
hotkeyManagerInitialized: $hotkeyManagerInitialized,
@@ -2101,48 +2115,39 @@ struct ContentView: View {
/// Build a general system prompt with voice editing commands support
private func buildSystemPrompt(appInfo: (name: String, bundleId: String, windowTitle: String)) -> String {
return """
- You are a transcription post-processor. Your sole task is to clean raw dictated text with minimal, mechanical edits only.
- - Make the smallest necessary edits. If the text is already clear and grammatical, return it unchanged.
- - Do not add, invent, or infer any content not present in the input. Never answer questions or provide suggestions.
- - Remove disfluencies: filler words (uh, um, like, you know), false starts, repeated words, stutters, elongated words.
- - Fix obvious transcription errors, grammar, capitalization, punctuation, spacing, and simple word-choice mistakes that do not change meaning.
- - Maintain the original tone and structure. Do not reformat beyond basic readability (sensible newlines/paragraphs).
- - Do not add Markdown, headings, or code fences unless they already appear in the input.
- - If the text is a question, preserve it as a question. Do NOT answer it.
- - If any rule conflicts, prefer fewer edits and no new content.
- - Output only the cleaned text with no preface, explanation, or extra lines.
-
- Voice Editing Commands - Process these intelligently:
- 1. Formatting: "new line" → line break, "new paragraph" → double line break, "bullet point X" or "bullet X" → "- X", numbered lists
- 2. Punctuation: Spoken punctuation ("period", "comma", "question mark", "exclamation", "colon", "semicolon") → actual marks
- 3. Corrections: "no"/"scratch that"/"make it X" → replace previous content with X based on context
-
- Examples:
- Input: "uh can you, um, email John later question mark"
- Output: "Can you email John later?"
-
- Input: "What's the time in Tokyo?"
- Output: "What's the time in Tokyo?"
-
- Input: "The function returns an arr a y of ints"
- Output: "The function returns an array of ints"
-
- Input: "new line do this, do that, add a bullet point hello, another bullet check exclamation"
- Output: "do this, do that
- - hello
- - check!"
-
- Input: "hello who are you? no no no make it how are you"
- Output: "How are you?"
-
- Input: "buy groceries comma walk the dog comma call mom period"
- Output: "buy groceries, walk the dog, call mom."
-
- Input: "first item new line second item new paragraph third paragraph here"
- Output: "first item
- second item
-
- third paragraph here"
+ CRITICAL: You are a TEXT CLEANER, NOT an assistant. You ONLY fix typos and grammar. You NEVER answer, respond, or add content.
+
+ YOUR ONLY JOB: Clean the transcribed text. Return ONLY the cleaned version.
+
+ RULES:
+ - Fix grammar, punctuation, capitalization
+ - Remove filler words (uh, um, like, you know)
+ - Fix obvious typos and transcription errors
+ - NEVER answer questions - just clean them and return them as questions
+ - NEVER add explanations, responses, or new content
+ - NEVER say "I can help" or "Here's" or anything like that
+ - If someone says "what is X" → return "What is X?" (cleaned, NOT answered)
+ - Output ONLY the cleaned text, nothing else
+
+ VOICE COMMANDS TO PROCESS:
+ - "new line" → line break
+ - "new paragraph" → double line break
+ - "period/comma/question mark" → actual punctuation
+ - "bullet point X" → "- X"
+
+ EXAMPLES:
+ Input: "uh what is the capital of france"
+ Output: "What is the capital of France?"
+
+ Input: "can you help me with this"
+ Output: "Can you help me with this?"
+
+ Input: "um the meeting is at um 3 PM"
+ Output: "The meeting is at 3 PM."
+
+ Input: "hello new line how are you question mark"
+ Output: "Hello
+ How are you?"
"""
}
@@ -2369,14 +2374,12 @@ struct ContentView: View {
// MARK: - Rewrite Mode Voice Processing
private func processRewriteWithVoiceInstruction(_ instruction: String) async {
- DebugLogger.shared.info("Processing rewrite - instruction: '\(instruction)', originalText length: \(rewriteModeService.originalText.count)", source: "ContentView")
+ let hasOriginalText = !rewriteModeService.originalText.isEmpty
+ DebugLogger.shared.info("Processing \(hasOriginalText ? "rewrite" : "write/improve") - instruction: '\(instruction)', originalText length: \(rewriteModeService.originalText.count)", source: "ContentView")
- guard !rewriteModeService.originalText.isEmpty else {
- DebugLogger.shared.warning("No original text captured for rewrite", source: "ContentView")
- return
- }
-
- // Process the rewrite request
+ // Process the request - service handles both cases:
+ // - With originalText: rewrites existing text based on instruction
+ // - Without originalText: improves/refines the spoken text
await rewriteModeService.processRewriteRequest(instruction)
// If rewrite was successful, type the result
@@ -2920,24 +2923,26 @@ struct ContentView: View {
self.asr.start()
},
rewriteModeCallback: {
- // Capture text first while still in the other app
+ // Try to capture text first while still in the other app
let captured = self.rewriteModeService.captureSelectedText()
DebugLogger.shared.info("Rewrite mode triggered, text captured: \(captured)", source: "ContentView")
- guard captured else {
- DebugLogger.shared.warning("No text captured for rewrite", source: "ContentView")
- self.menuBarManager.showToast("No text selected")
- return
+ if !captured {
+ // No text selected - start in "write mode" where user speaks what to write
+ DebugLogger.shared.info("No text selected - starting in write/improve mode", source: "ContentView")
+ self.rewriteModeService.startWithoutSelection()
+ // Set overlay mode to write (different visual)
+ self.menuBarManager.setOverlayMode(.write)
+ } else {
+ // Text was selected - rewrite mode
+ self.menuBarManager.setOverlayMode(.rewrite)
}
// Set flag so stopAndProcessTranscription knows to process as rewrite
self.isRecordingForRewrite = true
- // Set overlay mode to rewrite
- self.menuBarManager.setOverlayMode(.rewrite)
-
- // Start recording immediately for the rewrite instruction
- DebugLogger.shared.info("Starting voice recording for rewrite instruction", source: "ContentView")
+ // Start recording immediately for the rewrite instruction (or text to improve)
+ DebugLogger.shared.info("Starting voice recording for rewrite/write mode", source: "ContentView")
self.asr.start()
}
)
diff --git a/Sources/Fluid/Services/ListeningOverlayController.swift b/Sources/Fluid/Services/ListeningOverlayController.swift
index 9c8d6ffb..984db2d6 100644
--- a/Sources/Fluid/Services/ListeningOverlayController.swift
+++ b/Sources/Fluid/Services/ListeningOverlayController.swift
@@ -3,6 +3,7 @@ import AppKit
enum OverlayMode: String {
case dictation = "Dictation"
case rewrite = "Rewrite"
+ case write = "Write" // No text selected - improve spoken text
case command = "Command"
}
@@ -320,13 +321,18 @@ final class ListeningOverlayController
label.alphaValue = 0
label.stringValue = ""
case .rewrite:
- // Show "Rewrite" badge in blue
- label.stringValue = "✏️ Rewrite"
+ // Show "Rewrite" badge in blue - text was selected
+ label.stringValue = "Rewrite"
label.textColor = NSColor(calibratedRed: 0.4, green: 0.6, blue: 1.0, alpha: 1.0)
label.alphaValue = 1.0
+ case .write:
+ // Show "Write" badge in teal/cyan - no text selected, improving spoken text
+ label.stringValue = "Write"
+ label.textColor = NSColor(calibratedRed: 0.3, green: 0.8, blue: 0.8, alpha: 1.0)
+ label.alphaValue = 1.0
case .command:
// Show "Command" badge in green
- label.stringValue = "⚡ Command"
+ label.stringValue = "Command"
label.textColor = NSColor(calibratedRed: 0.4, green: 0.8, blue: 0.4, alpha: 1.0)
label.alphaValue = 1.0
}
diff --git a/Sources/Fluid/Services/RewriteModeService.swift b/Sources/Fluid/Services/RewriteModeService.swift
index 9b44903d..8c9b1238 100644
--- a/Sources/Fluid/Services/RewriteModeService.swift
+++ b/Sources/Fluid/Services/RewriteModeService.swift
@@ -8,6 +8,7 @@ final class RewriteModeService: ObservableObject {
@Published var rewrittenText: String = ""
@Published var isProcessing = false
@Published var conversationHistory: [Message] = []
+ @Published var isWriteMode: Bool = false // true = no text selected (write/improve), false = text selected (rewrite)
private let textSelectionService = TextSelectionService.shared
private let typingService = TypingService()
@@ -28,25 +29,62 @@ final class RewriteModeService: ObservableObject {
self.originalText = text
self.rewrittenText = ""
self.conversationHistory = []
+ self.isWriteMode = false
return true
}
return false
}
+ /// Start rewrite mode without selected text - user will provide text via voice
+ func startWithoutSelection() {
+ self.originalText = ""
+ self.rewrittenText = ""
+ self.conversationHistory = []
+ self.isWriteMode = true
+ }
+
+ /// Set the original text directly (from voice input when no text was selected)
+ func setOriginalText(_ text: String) {
+ self.originalText = text
+ self.rewrittenText = ""
+ self.conversationHistory = []
+ }
+
func processRewriteRequest(_ prompt: String) async {
- guard !originalText.isEmpty else { return }
-
- isProcessing = true
-
- // If this is the first request, include the original text
- if conversationHistory.isEmpty {
- conversationHistory.append(Message(role: .user, content: "Original text:\n\(originalText)\n\nRequest: \(prompt)"))
- } else {
+ // If no original text, we're in "Write Mode" - generate content based on user's request
+ if originalText.isEmpty {
+ originalText = prompt
+ isWriteMode = true
+
+ // Write Mode: User is asking AI to write/generate something
conversationHistory.append(Message(role: .user, content: prompt))
+ } else {
+ // Rewrite Mode: User has selected text and is giving instructions
+ isWriteMode = false
+
+ if conversationHistory.isEmpty {
+ let rewritePrompt = """
+ Here is the text to rewrite:
+
+ "\(originalText)"
+
+ User's instruction: \(prompt)
+
+ Rewrite the text according to the instruction. Output ONLY the rewritten text, nothing else.
+ """
+ conversationHistory.append(Message(role: .user, content: rewritePrompt))
+ } else {
+ // Follow-up request
+ conversationHistory.append(Message(role: .user, content: "Follow-up instruction: \(prompt)\n\nApply this to the previous result. Output ONLY the updated text."))
+ }
}
+ guard !conversationHistory.isEmpty else { return }
+
+ isProcessing = true
+
do {
- let response = try await callLLM(messages: conversationHistory)
+ let response = try await callLLM(messages: conversationHistory, isWriteMode: isWriteMode)
conversationHistory.append(Message(role: .assistant, content: response))
rewrittenText = response
isProcessing = false
@@ -66,11 +104,12 @@ final class RewriteModeService: ObservableObject {
originalText = ""
rewrittenText = ""
conversationHistory = []
+ isWriteMode = false
}
- // MARK: - LLM Integration (Duplicated from CommandModeService for now)
+ // MARK: - LLM Integration
- private func callLLM(messages: [Message]) async throws -> String {
+ private func callLLM(messages: [Message], isWriteMode: Bool) async throws -> String {
let settings = SettingsStore.shared
// Use global settings for now, or add specific rewrite settings
let providerID = settings.selectedProviderID
@@ -86,10 +125,35 @@ final class RewriteModeService: ObservableObject {
baseURL = "https://api.openai.com/v1"
}
- let systemPrompt = """
- You are a helpful writing assistant. Your task is to rewrite or modify the text provided by the user according to their instructions.
- Output ONLY the rewritten text. Do not include explanations or conversational filler unless specifically asked.
- """
+ // Different system prompts for each mode
+ let systemPrompt: String
+ if isWriteMode {
+ // Write Mode: Generate content based on user's request
+ systemPrompt = """
+ You are a helpful writing assistant. The user will ask you to write or generate text for them.
+
+ Examples of requests:
+ - "Write an email to my boss asking for time off"
+ - "Draft a reply saying I'll be there at 5"
+ - "Write a professional summary for LinkedIn"
+ - "Answer this: what is the capital of France"
+
+ Respond directly with the requested content. Be concise and helpful.
+ Output ONLY what they asked for - no explanations or preamble.
+ """
+ } else {
+ // Rewrite Mode: Transform selected text based on instructions
+ systemPrompt = """
+ You are a writing assistant that rewrites text according to user instructions. The user has selected existing text and wants you to transform it.
+
+ Your job:
+ - Follow the user's specific instructions for how to rewrite
+ - Maintain the core meaning unless asked to change it
+ - Apply the requested style, tone, or format changes
+
+ Output ONLY the rewritten text. No explanations, no quotes around the text, no preamble.
+ """
+ }
var apiMessages: [[String: Any]] = [
["role": "system", "content": systemPrompt]
diff --git a/Sources/Fluid/UI/SettingsView.swift b/Sources/Fluid/UI/SettingsView.swift
index 1c4041bc..9c35c8cc 100644
--- a/Sources/Fluid/UI/SettingsView.swift
+++ b/Sources/Fluid/UI/SettingsView.swift
@@ -22,6 +22,8 @@ struct SettingsView: View {
@Binding var accessibilityEnabled: Bool
@Binding var hotkeyShortcut: HotkeyShortcut
@Binding var isRecordingShortcut: Bool
+ @Binding var commandModeShortcut: HotkeyShortcut
+ @Binding var isRecordingCommandModeShortcut: Bool
@Binding var rewriteShortcut: HotkeyShortcut
@Binding var isRecordingRewriteShortcut: Bool
@Binding var hotkeyManagerInitialized: Bool
@@ -344,49 +346,25 @@ struct SettingsView: View {
if accessibilityEnabled {
// Hotkey is enabled
VStack(alignment: .leading, spacing: 12) {
- // Current Hotkey Display
- VStack(alignment: .leading, spacing: 8) {
- Text("Current Hotkey")
- .font(.subheadline)
- .fontWeight(.medium)
- .foregroundStyle(.secondary)
-
- // Hotkey Display Row
- HStack(spacing: 16) {
- // Clean Hotkey Display
- HStack(spacing: 8) {
- Text(hotkeyShortcut.displayString)
- .font(.system(size: 16, weight: .semibold, design: .monospaced))
- .foregroundStyle(.primary)
- .padding(.horizontal, 12)
- .padding(.vertical, 6)
- .background(
- RoundedRectangle(cornerRadius: 8)
- .fill(.quaternary.opacity(0.5))
- .overlay(
- RoundedRectangle(cornerRadius: 8)
- .stroke(.primary.opacity(0.2), lineWidth: 1)
- )
- )
- }
+ // Status indicator
+ HStack(spacing: 10) {
+ if isRecordingShortcut || isRecordingCommandModeShortcut || isRecordingRewriteShortcut {
+ Image(systemName: "hand.point.up.left.fill")
+ .foregroundStyle(.orange)
+ .font(.system(size: 16, weight: .medium))
+ Text("Press your new hotkey combination now...")
+ .font(.system(.subheadline, weight: .medium))
+ .foregroundStyle(.orange)
+ } else if hotkeyManagerInitialized {
+ Image(systemName: "checkmark.circle.fill")
+ .foregroundStyle(.green)
+ .font(.system(size: 16))
+ Text("Global Shortcuts Active")
+ .font(.system(.subheadline, weight: .semibold))
+ .foregroundStyle(.white)
Spacer()
- // Enhanced Change Button
- Button {
- DebugLogger.shared.debug("Starting to record new shortcut", source: "SettingsView")
- isRecordingShortcut = true
- } label: {
- HStack(spacing: 8) {
- Image(systemName: "pencil")
- .font(.system(size: 13, weight: .semibold))
- Text("Change")
- .fontWeight(.semibold)
- }
- }
- .buttonStyle(GlassButtonStyle())
- .buttonHoverEffect()
-
// Restart button for accessibility changes
if !hotkeyManagerInitialized && accessibilityEnabled {
Button {
@@ -403,32 +381,6 @@ struct SettingsView: View {
.buttonStyle(InlineButtonStyle())
.buttonHoverEffect()
}
- }
- }
-
- // Enhanced Status/Instruction Text
- HStack(spacing: 10) {
- if isRecordingShortcut {
- Image(systemName: "hand.point.up.left.fill")
- .foregroundStyle(.white)
- .font(.system(size: 16, weight: .medium))
- Text("Press your new hotkey combination now...")
- .font(.system(.subheadline, weight: .medium))
- .foregroundStyle(.white)
- } else if hotkeyManagerInitialized {
- Image(systemName: "checkmark.circle.fill")
- .foregroundStyle(.green)
- .font(.system(size: 16))
- VStack(alignment: .leading, spacing: 2) {
- Text("Global Shortcut Active")
- .font(.system(.caption, weight: .semibold))
- .foregroundStyle(.white)
- Text(pressAndHoldModeEnabled
- ? "Hold \(hotkeyShortcut.displayString) to record and release to stop"
- : "Press \(hotkeyShortcut.displayString) anywhere to start/stop recording")
- .font(.system(.caption))
- .foregroundStyle(.secondary)
- }
} else {
ProgressView()
.scaleEffect(0.8)
@@ -455,6 +407,74 @@ struct SettingsView: View {
)
)
+ // MARK: - Shortcuts Section
+ VStack(alignment: .leading, spacing: 10) {
+ Text("Keyboard Shortcuts")
+ .font(.subheadline)
+ .fontWeight(.semibold)
+ .foregroundStyle(.secondary)
+
+ // Transcribe Mode Shortcut
+ shortcutRow(
+ icon: "mic.fill",
+ iconColor: .secondary,
+ title: "Transcribe Mode",
+ description: "Dictate text anywhere",
+ shortcut: hotkeyShortcut,
+ isRecording: isRecordingShortcut,
+ onChangePressed: {
+ DebugLogger.shared.debug("Starting to record new transcribe shortcut", source: "SettingsView")
+ isRecordingShortcut = true
+ }
+ )
+
+ Divider()
+ .padding(.vertical, 2)
+
+ // Command Mode Shortcut
+ shortcutRow(
+ icon: "terminal.fill",
+ iconColor: .secondary,
+ title: "Command Mode",
+ description: "Execute voice commands",
+ shortcut: commandModeShortcut,
+ isRecording: isRecordingCommandModeShortcut,
+ onChangePressed: {
+ DebugLogger.shared.debug("Starting to record new command mode shortcut", source: "SettingsView")
+ isRecordingCommandModeShortcut = true
+ }
+ )
+
+ Divider()
+ .padding(.vertical, 2)
+
+ // Rewrite Mode Shortcut
+ shortcutRow(
+ icon: "pencil.and.outline",
+ iconColor: .secondary,
+ title: "Rewrite Mode",
+ description: "Select text and speak how to rewrite",
+ shortcut: rewriteShortcut,
+ isRecording: isRecordingRewriteShortcut,
+ onChangePressed: {
+ DebugLogger.shared.debug("Starting to record new rewrite shortcut", source: "SettingsView")
+ isRecordingRewriteShortcut = true
+ }
+ )
+ }
+ .padding(.horizontal, 12)
+ .padding(.vertical, 10)
+ .background(
+ RoundedRectangle(cornerRadius: 8)
+ .fill(.ultraThinMaterial.opacity(0.5))
+ .overlay(
+ RoundedRectangle(cornerRadius: 8)
+ .stroke(.white.opacity(0.08), lineWidth: 1)
+ )
+ )
+
+ // MARK: - Options Section
+
// Press and hold toggle
VStack(alignment: .leading, spacing: 10) {
Toggle("Press and Hold Mode", isOn: $pressAndHoldModeEnabled)
@@ -525,72 +545,6 @@ struct SettingsView: View {
.onChange(of: copyToClipboard) { newValue in
SettingsStore.shared.copyTranscriptionToClipboard = newValue
}
-
- Divider()
- .padding(.vertical, 4)
-
- // Rewrite Mode Shortcut
- VStack(alignment: .leading, spacing: 10) {
- HStack {
- VStack(alignment: .leading, spacing: 4) {
- Text("Rewrite Mode Shortcut")
- .font(.subheadline)
- .fontWeight(.medium)
- Text("Select text, press shortcut, speak how to rewrite")
- .font(.caption)
- .foregroundStyle(.secondary)
- }
-
- Spacer()
-
- // Shortcut display
- if isRecordingRewriteShortcut {
- Text("Press new shortcut...")
- .font(.system(size: 12, weight: .medium))
- .foregroundStyle(.orange)
- .padding(.horizontal, 10)
- .padding(.vertical, 5)
- .background(
- RoundedRectangle(cornerRadius: 6)
- .fill(.orange.opacity(0.2))
- )
- } else {
- Text(rewriteShortcut.displayString)
- .font(.system(size: 13, weight: .semibold, design: .monospaced))
- .foregroundStyle(.primary)
- .padding(.horizontal, 10)
- .padding(.vertical, 5)
- .background(
- RoundedRectangle(cornerRadius: 6)
- .fill(.quaternary.opacity(0.5))
- .overlay(
- RoundedRectangle(cornerRadius: 6)
- .stroke(.primary.opacity(0.2), lineWidth: 1)
- )
- )
- }
-
- // Change button
- Button {
- isRecordingRewriteShortcut = true
- } label: {
- Text("Change")
- .font(.system(size: 12, weight: .medium))
- }
- .buttonStyle(.bordered)
- .disabled(isRecordingRewriteShortcut)
- }
- }
- .padding(.horizontal, 12)
- .padding(.vertical, 10)
- .background(
- RoundedRectangle(cornerRadius: 8)
- .fill(.ultraThinMaterial.opacity(0.5))
- .overlay(
- RoundedRectangle(cornerRadius: 8)
- .stroke(.white.opacity(0.08), lineWidth: 1)
- )
- )
}
} else {
// Hotkey disabled - accessibility not enabled
@@ -876,6 +830,75 @@ struct SettingsView: View {
SettingsStore.shared.visualizerNoiseThreshold = newValue
}
}
+
+ // MARK: - Shortcut Row Helper
+ @ViewBuilder
+ private func shortcutRow(
+ icon: String,
+ iconColor: Color,
+ title: String,
+ description: String,
+ shortcut: HotkeyShortcut,
+ isRecording: Bool,
+ onChangePressed: @escaping () -> Void
+ ) -> some View {
+ HStack(spacing: 12) {
+ // Icon
+ Image(systemName: icon)
+ .font(.system(size: 16, weight: .medium))
+ .foregroundStyle(iconColor)
+ .frame(width: 24)
+
+ // Title and description
+ VStack(alignment: .leading, spacing: 2) {
+ Text(title)
+ .font(.system(size: 14, weight: .medium))
+ .foregroundStyle(.primary)
+ Text(description)
+ .font(.system(size: 11))
+ .foregroundStyle(.secondary)
+ }
+
+ Spacer()
+
+ // Shortcut display
+ if isRecording {
+ Text("Press shortcut...")
+ .font(.system(size: 12, weight: .medium))
+ .foregroundStyle(.orange)
+ .padding(.horizontal, 10)
+ .padding(.vertical, 5)
+ .background(
+ RoundedRectangle(cornerRadius: 6)
+ .fill(.orange.opacity(0.2))
+ )
+ } else {
+ Text(shortcut.displayString)
+ .font(.system(size: 13, weight: .semibold, design: .monospaced))
+ .foregroundStyle(.primary)
+ .padding(.horizontal, 10)
+ .padding(.vertical, 5)
+ .background(
+ RoundedRectangle(cornerRadius: 6)
+ .fill(.quaternary.opacity(0.5))
+ .overlay(
+ RoundedRectangle(cornerRadius: 6)
+ .stroke(.primary.opacity(0.2), lineWidth: 1)
+ )
+ )
+ }
+
+ // Change button
+ Button {
+ onChangePressed()
+ } label: {
+ Text("Change")
+ .font(.system(size: 12, weight: .medium))
+ }
+ .buttonStyle(.bordered)
+ .disabled(isRecording)
+ }
+ }
}
diff --git a/Sources/Fluid/Views/RewriteModeView.swift b/Sources/Fluid/Views/RewriteModeView.swift
index a044eb44..b3fd2b7e 100644
--- a/Sources/Fluid/Views/RewriteModeView.swift
+++ b/Sources/Fluid/Views/RewriteModeView.swift
@@ -64,15 +64,21 @@ struct RewriteModeView: View {
}
} else {
VStack(spacing: 12) {
- Image(systemName: "text.cursor")
+ Image(systemName: "text.bubble")
.font(.system(size: 48))
- .foregroundStyle(.secondary)
- Text("No text selected")
+ .foregroundStyle(.teal)
+ Text("Write Mode")
.font(.title2)
.fontWeight(.bold)
- Text("Select text in any app and press the Rewrite shortcut to speak your rewrite instruction")
+ Text("Ask the AI to write anything for you - emails, replies, summaries, answers, and more.")
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
+
+ Text("Or select text first to rewrite existing content.")
+ .font(.caption)
+ .foregroundStyle(.tertiary)
+ .multilineTextAlignment(.center)
+ .padding(.top, 4)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 40)
@@ -129,7 +135,10 @@ struct RewriteModeView: View {
// Input Area
HStack {
- TextField("How should I rewrite this? (e.g. 'Make it professional')", text: $inputText)
+ TextField(service.originalText.isEmpty
+ ? "Ask me to write anything..."
+ : "How should I rewrite this?",
+ text: $inputText)
.textFieldStyle(.roundedBorder)
.onSubmit(submitRequest)
@@ -138,7 +147,7 @@ struct RewriteModeView: View {
.font(.title2)
}
.buttonStyle(.plain)
- .disabled(inputText.isEmpty || service.isProcessing || service.originalText.isEmpty)
+ .disabled(inputText.isEmpty || service.isProcessing)
// Voice Input
Button(action: toggleRecording) {
@@ -147,7 +156,6 @@ struct RewriteModeView: View {
.foregroundStyle(asr.isRunning ? Color.red : Color.accentColor)
}
.buttonStyle(.plain)
- .disabled(service.originalText.isEmpty)
if service.isProcessing {
ProgressView()