Skip to content

Commit b0fd088

Browse files
committed
remove a few unused pieces
1 parent 315bea3 commit b0fd088

3 files changed

Lines changed: 2 additions & 146 deletions

File tree

VOICE_DICTATION_PR.md

Lines changed: 0 additions & 80 deletions
This file was deleted.

ui/desktop/src/main.ts

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,65 +1024,6 @@ ipcMain.handle('get-quit-confirmation-state', () => {
10241024
}
10251025
});
10261026

1027-
// Handle macOS dictation
1028-
ipcMain.handle('trigger-dictation', async () => {
1029-
if (process.platform !== 'darwin') {
1030-
return { error: 'Dictation is only available on macOS' };
1031-
}
1032-
1033-
try {
1034-
// Use AppleScript to trigger macOS dictation
1035-
return new Promise((resolve) => {
1036-
const script = `
1037-
tell application "System Events"
1038-
keystroke "d" using command down & shift down
1039-
end tell
1040-
`;
1041-
1042-
const appleScript = spawn('osascript', ['-e', script]);
1043-
let errorOutput = '';
1044-
1045-
appleScript.stderr.on('data', (data) => {
1046-
errorOutput += data.toString();
1047-
});
1048-
1049-
appleScript.on('close', (code) => {
1050-
if (code !== 0) {
1051-
console.error('Error triggering dictation:', errorOutput);
1052-
1053-
// Check for specific accessibility permission error
1054-
if (
1055-
errorOutput.includes('is not allowed to send keystrokes') ||
1056-
errorOutput.includes('1002')
1057-
) {
1058-
resolve({
1059-
error:
1060-
'Goose needs accessibility permissions to trigger dictation. Please go to System Settings → Privacy & Security → Accessibility and allow Goose to control your computer.',
1061-
});
1062-
} else {
1063-
resolve({
1064-
error:
1065-
'Failed to trigger dictation. Make sure dictation is enabled in System Settings → Keyboard → Dictation.',
1066-
});
1067-
}
1068-
} else {
1069-
// Note: We can't directly capture the dictation text from macOS
1070-
// The user will need to manually insert it
1071-
resolve({ text: '', error: 'Please use macOS dictation to input text' });
1072-
}
1073-
});
1074-
1075-
appleScript.on('error', (error) => {
1076-
console.error('Error executing AppleScript:', error);
1077-
resolve({ error: 'Failed to execute dictation command' });
1078-
});
1079-
});
1080-
} catch (error) {
1081-
console.error('Error in trigger-dictation handler:', error);
1082-
return { error: 'Failed to trigger dictation' };
1083-
}
1084-
});
1085-
10861027
// Add file/directory selection handler
10871028
ipcMain.handle('select-file-or-directory', async () => {
10881029
const result = (await dialog.showOpenDialog({
@@ -1510,7 +1451,7 @@ app.whenReady().then(async () => {
15101451
// Handle microphone permission requests
15111452
session.defaultSession.setPermissionRequestHandler((_webContents, permission, callback) => {
15121453
console.log('Permission requested:', permission);
1513-
// Allow microphone and media access for dictation
1454+
// Allow microphone and media access
15141455
if (permission === 'media') {
15151456
callback(true);
15161457
} else {
@@ -1540,7 +1481,7 @@ app.whenReady().then(async () => {
15401481
"frame-src 'none';" +
15411482
// Font sources
15421483
"font-src 'self';" +
1543-
// Media sources - allow microphone for dictation
1484+
// Media sources - allow microphone
15441485
"media-src 'self' mediastream:;" +
15451486
// Form actions
15461487
"form-action 'none';" +

ui/desktop/src/preload.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ type ElectronAPI = {
106106
restartApp: () => void;
107107
onUpdaterEvent: (callback: (event: UpdaterEvent) => void) => void;
108108
getUpdateState: () => Promise<{ updateAvailable: boolean; latestVersion?: string } | null>;
109-
// Dictation functions
110-
triggerDictation: () => Promise<{ text?: string; error?: string }>;
111109
};
112110

113111
type AppConfigAPI = {
@@ -211,9 +209,6 @@ const electronAPI: ElectronAPI = {
211209
getUpdateState: (): Promise<{ updateAvailable: boolean; latestVersion?: string } | null> => {
212210
return ipcRenderer.invoke('get-update-state');
213211
},
214-
triggerDictation: (): Promise<{ text?: string; error?: string }> => {
215-
return ipcRenderer.invoke('trigger-dictation');
216-
},
217212
};
218213

219214
const appConfigAPI: AppConfigAPI = {

0 commit comments

Comments
 (0)