-
-
Notifications
You must be signed in to change notification settings - Fork 272
feat: add toggle to send only the user's dictation prompt without the forced base prompt #464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -339,6 +339,14 @@ final class SettingsStore: ObservableObject { | |
| } | ||
| } | ||
|
|
||
| var sendCustomPromptOnly: Bool { | ||
| get { self.defaults.bool(forKey: Keys.sendCustomPromptOnly) } | ||
| set { | ||
| objectWillChange.send() | ||
| self.defaults.set(newValue, forKey: Keys.sendCustomPromptOnly) | ||
| } | ||
| } | ||
|
|
||
| var isEditPromptOff: Bool { | ||
| get { self.defaults.bool(forKey: Keys.editPromptOff) } | ||
| set { | ||
|
|
@@ -1034,7 +1042,7 @@ final class SettingsStore: ObservableObject { | |
| profile: profile, | ||
| appBinding: binding, | ||
| promptBody: body, | ||
| systemPrompt: Self.combineBasePrompt(for: normalizedMode, with: body) | ||
| systemPrompt: self.systemPrompt(forCustomProfileBody: body, mode: normalizedMode) | ||
| ) | ||
| } | ||
| } | ||
|
|
@@ -1063,7 +1071,7 @@ final class SettingsStore: ObservableObject { | |
| profile: profile, | ||
| appBinding: nil, | ||
| promptBody: body, | ||
| systemPrompt: Self.combineBasePrompt(for: normalizedMode, with: body) | ||
| systemPrompt: self.systemPrompt(forCustomProfileBody: body, mode: normalizedMode) | ||
| ) | ||
| } | ||
| } | ||
|
|
@@ -1113,7 +1121,7 @@ final class SettingsStore: ObservableObject { | |
| } | ||
| let body = Self.stripBasePrompt(for: .dictate, from: profile.prompt) | ||
| if !body.isEmpty { | ||
| return Self.combineBasePrompt(for: .dictate, with: body) | ||
| return self.systemPrompt(forCustomProfileBody: body, mode: .dictate) | ||
| } | ||
| return self.effectiveSystemPrompt(for: .dictate, appBundleID: appBundleID) | ||
| } | ||
|
|
@@ -1188,6 +1196,15 @@ final class SettingsStore: ObservableObject { | |
| ) | ||
| } | ||
|
|
||
| private func systemPrompt(forCustomProfileBody body: String, mode: PromptMode) -> String { | ||
| let normalizedMode = mode.normalized | ||
| let trimmedBody = body.trimmingCharacters(in: .whitespacesAndNewlines) | ||
| if normalizedMode == .dictate, self.sendCustomPromptOnly { | ||
| return trimmedBody | ||
|
Comment on lines
+1202
to
+1203
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a user enables this toggle and selects a custom Dictate prompt for the primary or secondary shortcut, the live recording path never reaches this new helper: Useful? React with 👍 / 👎. |
||
| } | ||
| return Self.combineBasePrompt(for: normalizedMode, with: trimmedBody) | ||
| } | ||
|
|
||
| // MARK: - Model Reasoning Configuration | ||
|
|
||
| /// Configuration for model-specific reasoning/thinking parameters | ||
|
|
@@ -4444,6 +4461,7 @@ private extension SettingsStore { | |
| static let dictationPromptProfiles = "DictationPromptProfiles" | ||
| static let appPromptBindings = "AppPromptBindings" | ||
| static let selectedDictationPromptID = "SelectedDictationPromptID" | ||
| static let sendCustomPromptOnly = "SendCustomPromptOnly" | ||
| static let editPromptOff = "EditPromptOff" | ||
| static let selectedEditPromptID = "SelectedEditPromptID" | ||
| static let selectedWritePromptID = "SelectedWritePromptID" // legacy fallback key | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new persisted setting is not included in
SettingsBackupPayload/settingsBackupPayload()andrestore(from:)never reads it back, so exporting and importing a backup silently resets the toggle to the defaultfalse. For users who rely on custom-only Dictate prompts, a restored machine will start prepending the built-in base prompt again even though their prompt profiles and selections were restored.Useful? React with 👍 / 👎.