Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

added quit and error logging

Gabriel Stein4175e543a744
diff --git a/index.html b/index.html
index 22cb71086..2fa9b238b 100644
--- a/index.html
+++ b/index.html
@@ -147,6 +147,34 @@
</div>
);
+ // Toast notification component
+ const Toast = ({ message, onClose }) => {
+ useEffect(() => {
+ if (!message) return;
+ const timer = setTimeout(onClose, 3500);
+ return () => clearTimeout(timer);
+ }, [message]);
+ if (!message) return null;
+ return (
+ <div style={{
+ position: 'fixed',
+ left: '50%',
+ bottom: 60,
+ transform: 'translateX(-50%)',
+ background: '#222',
+ color: '#fff',
+ padding: '10px 22px',
+ borderRadius: 8,
+ boxShadow: '0 2px 12px rgba(0,0,0,0.18)',
+ fontSize: 15,
+ zIndex: 9999,
+ pointerEvents: 'auto',
+ }}>
+ {message}
+ </div>
+ );
+ };
+
// Main App Component
const App = () => {
const [isRecording, setIsRecording] = useState(false);
@@ -195,6 +223,14 @@
}
};
+ const safePaste = async (text) => {
+ try {
+ await ipcRenderer.invoke('paste-text', text);
+ } catch (err) {
+ setError('Failed to paste text. Please check accessibility permissions.');
+ }
+ };
+
const processAudio = async (audioBlob) => {
try {
console.log("Processing audio blob, size:", audioBlob.size)
@@ -223,6 +259,7 @@
if (!response.ok) {
const errorText = await response.text()
console.error("API Error:", errorText)
+ setError(`Transcription failed: ${response.status} ${errorText}`);
throw new Error(`Failed to transcribe audio: ${response.status} ${errorText}`)
}
@@ -234,8 +271,9 @@
setTranscript(text);
console.log("Transcribed text:", text)
// Automatically paste the text
- await ipcRenderer.invoke('paste-text', text);
+ await safePaste(text);
} else {
+ setError('No text transcribed. Try again.');
console.log("No text transcribed")
}
} catch (err) {
@@ -291,39 +329,42 @@
// Minimal always-visible tab UI (no bars when idle)
return (
- <div style={{
- position: 'absolute',
- left: 0,
- right: 0,
- bottom: 0,
- width: '100%',
- height: '100%',
- pointerEvents: 'none',
- }}>
- <div
- className="glass-effect"
- style={{
- position: 'absolute',
- left: '50%',
- bottom: 8,
- transform: 'translateX(-50%)',
- width: tabWidth,
- height: tabHeight,
- background: 'rgba(30,30,30,0.85)',
- border: '1px solid #ccc',
- borderRadius: 20,
- boxShadow: '0 1px 6px rgba(0,0,0,0.10)',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- padding: 0,
- pointerEvents: 'auto',
- transition,
- }}
- >
- {content}
+ <>
+ <div style={{
+ position: 'absolute',
+ left: 0,
+ right: 0,
+ bottom: 0,
+ width: '100%',
+ height: '100%',
+ pointerEvents: 'none',
+ }}>
+ <div
+ className="glass-effect"
+ style={{
+ position: 'absolute',
+ left: '50%',
+ bottom: 8,
+ transform: 'translateX(-50%)',
+ width: tabWidth,
+ height: tabHeight,
+ background: 'rgba(30,30,30,0.85)',
+ border: '1px solid #ccc',
+ borderRadius: 20,
+ boxShadow: '0 1px 6px rgba(0,0,0,0.10)',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ padding: 0,
+ pointerEvents: 'auto',
+ transition,
+ }}
+ >
+ {content}
+ </div>
</div>
- </div>
+ <Toast message={error} onClose={() => setError('')} />
+ </>
);
};
diff --git a/main.js b/main.js
index c72cfb0e1..b7fd45baf 100644
--- a/main.js
+++ b/main.js
@@ -26,7 +26,6 @@ function createWindow() {
frame: false,
alwaysOnTop: true,
resizable: false,
- skipTaskbar: true,
transparent: true,
show: true, // Always show
})