Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
refactor: remove redundant ui elements
Gabriel Stein1bd543b4ca1e
diff --git a/README.md b/README.mdindex 7789620de..c2d0e7472 100644--- a/README.md+++ b/README.md@@ -298,7 +298,6 @@ open-whispr/│ │ │ ├── card.tsx│ │ │ ├── input.tsx│ │ │ ├── LoadingDots.tsx-│ │ │ ├── DotFlashing.tsx│ │ │ ├── Toast.tsx│ │ │ ├── toggle.tsx│ │ │ └── tooltip.tsxdiff --git a/src/components/LocalModelPicker.tsx b/src/components/LocalModelPicker.tsxindex c7f2552eb..21361086b 100644--- a/src/components/LocalModelPicker.tsx+++ b/src/components/LocalModelPicker.tsx@@ -1,6 +1,6 @@import { useState, useEffect, useCallback, useMemo } from "react";import { Button } from "./ui/button";-import { RefreshCw, Download, Trash2, Check, X } from "lucide-react";+import { Download, Trash2, Check, X } from "lucide-react";import { ProviderIcon } from "./ui/ProviderIcon";import { ProviderTabs } from "./ui/ProviderTabs";import { DownloadProgressBar } from "./ui/DownloadProgressBar";@@ -50,13 +50,11 @@ export default function LocalModelPicker({onDownloadComplete,}: LocalModelPickerProps) {const [downloadedModels, setDownloadedModels] = useState<Set<string>>(new Set());- const [loadingModels, setLoadingModels] = useState(false);const { confirmDialog, showConfirmDialog, hideConfirmDialog } = useDialogs();const styles = useMemo(() => MODEL_PICKER_COLORS[colorScheme], [colorScheme]);const loadDownloadedModels = useCallback(async () => {- setLoadingModels(true);try {let downloaded = new Set<string>();if (modelType === "whisper") {@@ -83,8 +81,6 @@ export default function LocalModelPicker({} catch (error) {console.error("Failed to load downloaded models:", error);return new Set<string>();- } finally {- setLoadingModels(false);}}, [modelType]);@@ -163,19 +159,7 @@ export default function LocalModelPicker({{progressDisplay}<div className="p-4">- <div className="flex items-center justify-between mb-3">- <h5 className={styles.header}>Available Models</h5>- <Button- onClick={loadDownloadedModels}- variant="outline"- size="sm"- disabled={loadingModels}- className={`${styles.buttons.refresh} min-w-[105px] transition-colors`}- >- <RefreshCw size={14} className={loadingModels ? "animate-spin" : ""} />- <span className="ml-1">{loadingModels ? "Checking..." : "Refresh"}</span>- </Button>- </div>+ <h5 className={`${styles.header} mb-3`}>Available Models</h5><div className="space-y-2">{models.length === 0 ? (diff --git a/src/components/LocalWhisperPicker.tsx b/src/components/LocalWhisperPicker.tsxindex 318e41308..274391df2 100644--- a/src/components/LocalWhisperPicker.tsx+++ b/src/components/LocalWhisperPicker.tsx@@ -1,6 +1,6 @@import { useState, useEffect, useCallback, useMemo, useRef } from "react";import { Button } from "./ui/button";-import { RefreshCw, Download, Trash2, Check, X } from "lucide-react";+import { Download, Trash2, Check, X } from "lucide-react";import { ProviderIcon } from "./ui/ProviderIcon";import { DownloadProgressBar } from "./ui/DownloadProgressBar";import { ConfirmDialog } from "./ui/dialog";@@ -31,7 +31,6 @@ export default function LocalWhisperPicker({variant = "settings",}: LocalWhisperPickerProps) {const [models, setModels] = useState<WhisperModel[]>([]);- const [loadingModels, setLoadingModels] = useState(false);const hasLoadedRef = useRef(false);const downloadingModelRef = useRef<string | null>(null);@@ -41,7 +40,6 @@ export default function LocalWhisperPicker({const loadModels = useCallback(async () => {try {- setLoadingModels(true);const result = await window.electronAPI?.listWhisperModels();if (result?.success) {setModels(result.models);@@ -49,8 +47,6 @@ export default function LocalWhisperPicker({} catch (error) {console.error("[LocalWhisperPicker] Failed to load models:", error);setModels([]);- } finally {- setLoadingModels(false);}}, []);@@ -116,19 +112,7 @@ export default function LocalWhisperPicker({{progressDisplay}<div className="p-4">- <div className="flex items-center justify-between mb-3">- <h5 className={styles.header}>Whisper Models</h5>- <Button- onClick={loadModels}- variant="outline"- size="sm"- disabled={loadingModels}- className={`${styles.buttons.refresh} min-w-[105px] justify-center transition-colors`}- >- <RefreshCw size={14} className={loadingModels ? "animate-spin" : ""} />- <span>{loadingModels ? "Checking..." : "Refresh"}</span>- </Button>- </div>+ <h5 className={`${styles.header} mb-3`}>Whisper Models</h5><div className="space-y-2">{models.map((model) => {diff --git a/src/components/TranscriptionModelPicker.tsx b/src/components/TranscriptionModelPicker.tsxindex bab368f57..3f58933d2 100644--- a/src/components/TranscriptionModelPicker.tsx+++ b/src/components/TranscriptionModelPicker.tsx@@ -1,6 +1,6 @@import { useState, useEffect, useCallback, useMemo, useRef } from "react";import { Button } from "./ui/button";-import { RefreshCw, Download, Trash2, Check, Cloud, Lock } from "lucide-react";+import { Download, Trash2, Check, Cloud, Lock } from "lucide-react";import { ProviderIcon } from "./ui/ProviderIcon";import { ProviderTabs } from "./ui/ProviderTabs";import ModelCardList from "./ui/ModelCardList";@@ -73,7 +73,6 @@ export default function TranscriptionModelPicker({variant = "settings",}: TranscriptionModelPickerProps) {const [localModels, setLocalModels] = useState<WhisperModel[]>([]);- const [loadingModels, setLoadingModels] = useState(false);const [internalLocalProvider, setInternalLocalProvider] = useState(selectedLocalProvider);const hasLoadedRef = useRef(false);const isLoadingRef = useRef(false);@@ -92,7 +91,6 @@ export default function TranscriptionModelPicker({isLoadingRef.current = true;try {- setLoadingModels(true);const result = await window.electronAPI?.listWhisperModels();if (result?.success) {setLocalModels(result.models);@@ -101,7 +99,6 @@ export default function TranscriptionModelPicker({console.error("[TranscriptionModelPicker] Failed to load models:", error);setLocalModels([]);} finally {- setLoadingModels(false);isLoadingRef.current = false;}}, []);@@ -487,19 +484,7 @@ export default function TranscriptionModelPicker({{progressDisplay}<div className="p-4">- <div className="flex items-center justify-between mb-3">- <h5 className={styles.header}>Available Models</h5>- <Button- onClick={loadLocalModels}- variant="outline"- size="sm"- disabled={loadingModels}- className={`${styles.buttons.refresh} min-w-[105px] justify-center transition-colors`}- >- <RefreshCw size={14} className={loadingModels ? "animate-spin" : ""} />- <span>{loadingModels ? "Checking..." : "Refresh"}</span>- </Button>- </div>+ <h5 className={`${styles.header} mb-3`}>Available Models</h5>{internalLocalProvider === "whisper" && renderLocalModels()}{internalLocalProvider === "nvidia" && (diff --git a/src/components/ui/DotFlashing.tsx b/src/components/ui/DotFlashing.tsxdeleted file mode 100644index b297cb488..000000000--- a/src/components/ui/DotFlashing.tsx+++ /dev/null@@ -1,51 +0,0 @@-import React from "react";--export const DotFlashing = () => (- <>- <div style={{ display: "flex", alignItems: "center", justifyContent: "center", height: 16 }}>- <div className="dot-flashing"></div>- </div>- <style>{`- .dot-flashing {- position: relative;- width: 5px;- height: 5px;- border-radius: 5px;- background-color: #ccc;- color: #ccc;- animation: dot-flashing 1s infinite linear alternate;- animation-delay: 0.5s;- }- .dot-flashing::before, .dot-flashing::after {- content: "";- display: inline-block;- position: absolute;- top: 0;- }- .dot-flashing::before {- left: -8px;- width: 5px;- height: 5px;- border-radius: 5px;- background-color: #787777;- color: #787777;- animation: dot-flashing 1s infinite alternate;- animation-delay: 0s;- }- .dot-flashing::after {- left: 8px;- width: 5px;- height: 5px;- border-radius: 5px;- background-color: #787777;- color: #787777;- animation: dot-flashing 1s infinite alternate;- animation-delay: 1s;- }- @keyframes dot-flashing {- 0% { background-color: #787777; }- 50%, 100% { background-color: rgba(152, 128, 255, 0.2); }- }- `}</style>- </>-);