From 1263a4f85125aca7620d1710c1681e419316acb9 Mon Sep 17 00:00:00 2001 From: brunorezio Date: Sun, 26 Jul 2026 03:12:58 +0100 Subject: [PATCH] drop the built-in Transcribe entry from the file browser context menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Transcribe Audio covers it as a task, with recursion, multi-select scoping, skip-if-already-done and a choice of inline or job — none of which the one-shot menu entry had. Two ways to do the same thing from the same menu is worse than one good one. The file viewer's Transcribe button is untouched, and /file-browser/transcribe stays: it is what both that button and the task call. Co-Authored-By: Claude Opus 5 --- .../FileBrowserApp/components/FileGrid.tsx | 2 -- .../FileBrowserApp/components/FileItem.tsx | 27 ++----------------- .../FileBrowserApp/useFileBrowserApp.ts | 14 ---------- 3 files changed, 2 insertions(+), 41 deletions(-) diff --git a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileGrid.tsx b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileGrid.tsx index 7e9b409c..cf1855aa 100644 --- a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileGrid.tsx +++ b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileGrid.tsx @@ -62,7 +62,6 @@ export const FileGrid = ({ fileBrowserManager }: FileGridProps) => { setRenamingName, handleReadAloud, handleOcr, - handleTranscribe, handleExtractAudio, handleExtract, handlePlay, @@ -181,7 +180,6 @@ export const FileGrid = ({ fileBrowserManager }: FileGridProps) => { onRenamingChange={setRenamingName} onReadAloud={handleReadAloud} onOcr={handleOcr} - onTranscribe={handleTranscribe} onExtractAudio={handleExtractAudio} onExtract={handleExtract} onPlay={handlePlay} diff --git a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileItem.tsx b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileItem.tsx index a1ba1587..e1bcfdc5 100644 --- a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileItem.tsx +++ b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/components/FileItem.tsx @@ -13,7 +13,6 @@ import { LayoutGrid, Volume2, ScanText, - FileText, AudioLines, FolderArchive, ClipboardCopy, @@ -65,7 +64,6 @@ export type FileItemProps = { onRenamingChange: (name: string | null) => void; onReadAloud: (entry: DirEntry) => void; onOcr: (entry: DirEntry) => void; - onTranscribe: (entry: DirEntry) => void; onExtractAudio: (entry: DirEntry) => void; onExtract: (entry: DirEntry) => void; onPlay: (entry: DirEntry) => void; @@ -98,7 +96,6 @@ type MenuItemsProps = { onDownload: (e: DirEntry) => void; onReadAloud: (e: DirEntry) => void; onOcr: (e: DirEntry) => void; - onTranscribe: (e: DirEntry) => void; onExtractAudio: (e: DirEntry) => void; onExtract: (e: DirEntry) => void; onPlay: (e: DirEntry) => void; @@ -119,7 +116,6 @@ const DropdownMenuItems = ({ onDownload, onReadAloud, onOcr, - onTranscribe, onExtractAudio, onExtract, onPlay, @@ -132,14 +128,12 @@ const DropdownMenuItems = ({ const fileType = entry.type === 'file' ? getFileType(entry.name) : null; const showReadAloud = fileType === 'markdown' || fileType === 'code' || fileType === 'text'; const showOcr = fileType === 'image'; - const showTranscribe = fileType === 'audio'; const showExtractAudio = fileType === 'video'; const showExtract = fileType === 'archive'; const showPlay = fileType === 'audio' || entry.type === 'directory'; const hasTasks = taskGroups.length > 0; - const hasActions = - showPlay || showReadAloud || showOcr || showTranscribe || showExtractAudio || showExtract || hasTasks; + const hasActions = showPlay || showReadAloud || showOcr || showExtractAudio || showExtract || hasTasks; // Only nest when more than one category matched — a file usually matches a single category, and // Run Task > Video > Convert would just add a hop. const nestTasks = taskGroups.length > 1; @@ -165,12 +159,6 @@ const DropdownMenuItems = ({ Extract Text (OCR) )} - {showTranscribe && ( - onTranscribe(entry)} className="cursor-pointer"> - - Transcribe - - )} {showExtractAudio && ( onExtractAudio(entry)} className="cursor-pointer"> @@ -272,7 +260,6 @@ const ContextMenuItems = ({ onDownload, onReadAloud, onOcr, - onTranscribe, onExtractAudio, onExtract, onPlay, @@ -285,14 +272,12 @@ const ContextMenuItems = ({ const fileType = entry.type === 'file' ? getFileType(entry.name) : null; const showReadAloud = fileType === 'markdown' || fileType === 'code' || fileType === 'text'; const showOcr = fileType === 'image'; - const showTranscribe = fileType === 'audio'; const showExtractAudio = fileType === 'video'; const showExtract = fileType === 'archive'; const showPlay = fileType === 'audio' || entry.type === 'directory'; const hasTasks = taskGroups.length > 0; - const hasActions = - showPlay || showReadAloud || showOcr || showTranscribe || showExtractAudio || showExtract || hasTasks; + const hasActions = showPlay || showReadAloud || showOcr || showExtractAudio || showExtract || hasTasks; // Only nest when more than one category matched — a file usually matches a single category, and // Run Task > Video > Convert would just add a hop. const nestTasks = taskGroups.length > 1; @@ -318,12 +303,6 @@ const ContextMenuItems = ({ Extract Text (OCR) )} - {showTranscribe && ( - onTranscribe(entry)} className="cursor-pointer"> - - Transcribe - - )} {showExtractAudio && ( onExtractAudio(entry)} className="cursor-pointer"> @@ -534,7 +513,6 @@ export const FileItem = ({ onRenamingChange, onReadAloud, onOcr, - onTranscribe, onExtractAudio, onExtract, onPlay, @@ -617,7 +595,6 @@ export const FileItem = ({ onDownload, onReadAloud, onOcr, - onTranscribe, onExtractAudio, onExtract, onPlay, diff --git a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/useFileBrowserApp.ts b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/useFileBrowserApp.ts index 1a3d6350..9203de99 100644 --- a/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/useFileBrowserApp.ts +++ b/src/workspaces/officerdev/src/apps/FileBrowser/FileBrowserApp/useFileBrowserApp.ts @@ -457,19 +457,6 @@ export const useFileBrowserApp = ( } }; - const handleTranscribe = async (entry: DirEntry) => { - const filePath = entryPath(entry.name); - const toastId = toast.loading('Transcribing audio...'); - try { - const { transcriptionPath } = await files.transcribe(filePath, { saveNextTo: true }); - toast.dismiss(toastId); - refresh(); - setSearchParams({ view: filePath, ephemeral: transcriptionPath }); - } catch { - toast.error('Failed to transcribe audio', { id: toastId }); - } - }; - const handleExtractAudio = async (entry: DirEntry) => { const filePath = entryPath(entry.name); const toastId = toast.loading('Extracting audio from video...'); @@ -778,7 +765,6 @@ export const useFileBrowserApp = ( handleCreateDashboardHere, handleReadAloud, handleOcr, - handleTranscribe, handleExtractAudio, handleExtract, handlePlay,