Skip to content

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

chore: v1.4.3 release — type safety, code cleanup, and docs

Gabriel Steinbcbadfa8eec1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 919fd56a7..b49ade8d9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,8 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [1.4.3] - 2026-02-08
+
### Added
- **Mistral Voxtral Transcription**: Added Mistral as a cloud transcription provider with Voxtral Mini model and custom dictionary support via context_bias
+- **TypeScript Compilation**: Added TypeScript as an explicit dev dependency with project-level `tsconfig.json`
+
+### Fixed
+- **Linux Wayland Clipboard**: Persistent clipboard ownership on Wayland so Ctrl+V works reliably after transcription
+- **Linux Window Flickering**: Fixed transparent window flickering on Wayland and X11 compositors
+- **Windows Modifier-Only Hotkeys**: Support modifier-only hotkeys on Windows via native keyboard hook
+- **Update Installation**: Resolved quitAndInstall hang by removing close listeners that block window shutdown during updates
+- **Custom System Prompts**: Pass custom system prompt to local and Anthropic BYOK reasoning
+- **Audio Cue Audibility**: Improved dictation start/stop audio cue volume
+- **Language Selector**: Fixed dropdown positioning and sizing inside settings modal
+- **Type Safety**: Tightened Electron IPC callback return types, model picker styles, toast variant types, and event handler signatures across the codebase
+
+### Changed
+- **Code Cleanup**: Removed excess comments, section dividers, and redundant JSDoc across components, hooks, and utilities
## [1.4.2] - 2026-02-07
diff --git a/README.md b/README.md
index 7bb0c4031..7a5b82e99 100644
--- a/README.md
+++ b/README.md
@@ -352,7 +352,7 @@ Improve transcription accuracy for specific words, names, or technical terms:
- Free plan: 2,000 words/week with 7-day Pro trial for new accounts
- Pro plan: unlimited transcriptions
- **Bring Your Own Key (BYOK)**:
- - Use your own API keys from OpenAI, Groq, AssemblyAI, or custom endpoints
+ - Use your own API keys from OpenAI, Groq, Mistral, AssemblyAI, or custom endpoints
- Full control over provider and model selection
- **Local Processing**:
- Install Whisper or NVIDIA Parakeet through the Control Panel
@@ -639,14 +639,14 @@ A: OpenWhispr supports 58 languages including English, Spanish, French, German,
## Project Status
-OpenWhispr is actively maintained and ready for production use. Current version: 1.4.2
+OpenWhispr is actively maintained and ready for production use. Current version: 1.4.3
- ✅ Core functionality complete
- ✅ Cross-platform support (macOS, Windows, Linux)
- ✅ OpenWhispr Cloud with account system and usage tracking
- ✅ Free and Pro plans with Stripe billing
- ✅ Local and cloud processing
-- ✅ Multi-provider AI (OpenAI, Anthropic, Gemini, Groq, Local)
+- ✅ Multi-provider AI (OpenAI, Anthropic, Gemini, Groq, Mistral, Local)
- ✅ Compound hotkey support
- ✅ Windows Push-to-Talk with native key listener
- ✅ Custom dictionary for improved transcription accuracy
diff --git a/main.js b/main.js
index 178bc8b83..c3b6f5d77 100644
--- a/main.js
+++ b/main.js
@@ -625,7 +625,7 @@ async function startApp() {
globeKeyManager.start();
// Reset native key state when hotkey changes
- ipcMain.on("hotkey-changed", (_event, newHotkey) => {
+ ipcMain.on("hotkey-changed", (_event, _newHotkey) => {
globeKeyDownTime = 0;
globeKeyIsRecording = false;
rightModDownTime = 0;
diff --git a/package-lock.json b/package-lock.json
index c83ee40f7..0242e4053 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "open-whispr",
- "version": "1.4.2",
+ "version": "1.4.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "open-whispr",
- "version": "1.4.2",
+ "version": "1.4.3",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@@ -57,6 +57,7 @@
"postcss": "^8.5.6",
"prettier": "^3.4.2",
"tailwindcss": "^4.1.10",
+ "typescript": "^5.9.3",
"typescript-eslint": "^8.20.0",
"vite": "^6.3.5"
}
@@ -15743,7 +15744,6 @@
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"license": "Apache-2.0",
- "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
diff --git a/package.json b/package.json
index 869737ca4..ee5db9067 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "open-whispr",
- "version": "1.4.2",
+ "version": "1.4.3",
"description": "A desktop dictation application using whisper.cpp for speech-to-text transcription",
"main": "main.js",
"private": true,
@@ -78,6 +78,7 @@
"postcss": "^8.5.6",
"prettier": "^3.4.2",
"tailwindcss": "^4.1.10",
+ "typescript": "^5.9.3",
"typescript-eslint": "^8.20.0",
"vite": "^6.3.5"
},
diff --git a/src/App.jsx b/src/App.jsx
index 13a33bf4f..5d872c445 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -99,7 +99,7 @@ export default function App() {
});
});
- const unsubscribeFailed = window.electronAPI?.onHotkeyRegistrationFailed?.((data) => {
+ const unsubscribeFailed = window.electronAPI?.onHotkeyRegistrationFailed?.((_data) => {
toast({
title: "Hotkey Unavailable",
description: `Could not register hotkey. Please set a different hotkey in Settings.`,
diff --git a/src/components/LocalModelPicker.tsx b/src/components/LocalModelPicker.tsx
index 25ba7a1cb..544a28d8e 100644
--- a/src/components/LocalModelPicker.tsx
+++ b/src/components/LocalModelPicker.tsx
@@ -133,7 +133,7 @@ export default function LocalModelPicker({
);
const currentProvider = providers.find((p) => p.id === selectedProvider);
- const models = currentProvider?.models || [];
+ const models = useMemo(() => currentProvider?.models || [], [currentProvider?.models]);
const progressDisplay = useMemo(() => {
if (!downloadingModel) return null;
diff --git a/src/components/LocalWhisperPicker.tsx b/src/components/LocalWhisperPicker.tsx
index 2608e8e1f..462f5aa5d 100644
--- a/src/components/LocalWhisperPicker.tsx
+++ b/src/components/LocalWhisperPicker.tsx
@@ -154,10 +154,11 @@ export default function LocalWhisperPicker({
<ModelCardList
models={models.map((model): ModelCardOption => {
const modelId = model.model;
- const info = WHISPER_MODEL_INFO[modelId] || {
+ const info = WHISPER_MODEL_INFO[modelId] ?? {
name: modelId,
description: "Model",
size: "Unknown",
+ recommended: false,
};
return {
value: modelId,
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index 2c022f7ad..2fc202b2a 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -51,6 +51,7 @@ import { Skeleton } from "./ui/skeleton";
import { Progress } from "./ui/progress";
import { useToast } from "./ui/Toast";
import { useTheme } from "../hooks/useTheme";
+import type { LocalTranscriptionProvider } from "../types/electron";
import logger from "../utils/logger";
import { SettingsRow } from "./ui/SettingsSection";
import { useUsage } from "../hooks/useUsage";
@@ -72,8 +73,6 @@ interface SettingsPageProps {
activeSection?: SettingsSectionType;
}
-// ── Reusable layout primitives ──────────────────────────────────────
-
function SettingsPanel({
children,
className = "",
@@ -111,8 +110,6 @@ function SectionHeader({ title, description }: { title: string; description?: st
);
}
-// ── Transcription section (extracted for clarity) ───────────────────
-
interface TranscriptionSectionProps {
isSignedIn: boolean;
cloudTranscriptionMode: string;
@@ -125,7 +122,7 @@ interface TranscriptionSectionProps {
cloudTranscriptionModel: string;
setCloudTranscriptionModel: (model: string) => void;
localTranscriptionProvider: string;
- setLocalTranscriptionProvider: (provider: string) => void;
+ setLocalTranscriptionProvider: (provider: LocalTranscriptionProvider) => void;
whisperModel: string;
setWhisperModel: (model: string) => void;
parakeetModel: string;
@@ -143,7 +140,7 @@ interface TranscriptionSectionProps {
toast: (opts: {
title: string;
description: string;
- variant?: string;
+ variant?: "default" | "destructive" | "success";
duration?: number;
}) => void;
}
@@ -353,8 +350,6 @@ function TranscriptionSection({
);
}
-// ── AI Models section (extracted for clarity) ───────────────────────
-
interface AiModelsSectionProps {
isSignedIn: boolean;
cloudReasoningMode: string;
@@ -381,7 +376,7 @@ interface AiModelsSectionProps {
toast: (opts: {
title: string;
description: string;
- variant?: string;
+ variant?: "default" | "destructive" | "success";
duration?: number;
}) => void;
}
@@ -582,8 +577,6 @@ function AiModelsSection({
);
}
-// ── Main component ──────────────────────────────────────────────────
-
export default function SettingsPage({ activeSection = "general" }: SettingsPageProps) {
const {
confirmDialog,
@@ -1169,9 +1162,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
- // ───────────────────────────────────────────────────
- // GENERAL — Updates, Appearance, Hotkey, Startup, Mic
- // ───────────────────────────────────────────────────
case "general":
return (
<div className="space-y-6">
@@ -1461,9 +1451,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
- // ───────────────────────────────────────────────────
- // TRANSCRIPTION
- // ───────────────────────────────────────────────────
case "transcription":
return (
<TranscriptionSection
@@ -1487,6 +1474,8 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
setOpenaiApiKey={setOpenaiApiKey}
groqApiKey={groqApiKey}
setGroqApiKey={setGroqApiKey}
+ mistralApiKey={mistralApiKey}
+ setMistralApiKey={setMistralApiKey}
customTranscriptionApiKey={customTranscriptionApiKey}
setCustomTranscriptionApiKey={setCustomTranscriptionApiKey}
cloudTranscriptionBaseUrl={cloudTranscriptionBaseUrl}
@@ -1495,9 +1484,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
/>
);
- // ───────────────────────────────────────────────────
- // DICTIONARY
- // ───────────────────────────────────────────────────
case "dictionary":
return (
<div className="space-y-5">
@@ -1633,9 +1619,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
- // ───────────────────────────────────────────────────
- // AI MODELS
- // ───────────────────────────────────────────────────
case "aiModels":
return (
<AiModelsSection
@@ -1668,9 +1651,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
/>
);
- // ───────────────────────────────────────────────────
- // AGENT CONFIG
- // ───────────────────────────────────────────────────
case "agentConfig":
return (
<div className="space-y-5">
@@ -1772,9 +1752,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
- // ───────────────────────────────────────────────────
- // PROMPTS
- // ───────────────────────────────────────────────────
case "prompts":
return (
<div className="space-y-5">
@@ -1787,9 +1764,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
- // ───────────────────────────────────────────────────
- // PRIVACY
- // ───────────────────────────────────────────────────
case "privacy":
return (
<div className="space-y-6">
@@ -1826,9 +1800,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
- // ───────────────────────────────────────────────────
- // PERMISSIONS (new — extracted from General)
- // ───────────────────────────────────────────────────
case "permissions":
return (
<div className="space-y-5">
@@ -1908,9 +1879,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
- // ───────────────────────────────────────────────────
- // DEVELOPER (+ data management moved here)
- // ───────────────────────────────────────────────────
case "developer":
return (
<div className="space-y-6">
diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx
index 499e9d4fb..818ec4c11 100644
--- a/src/components/TitleBar.tsx
+++ b/src/components/TitleBar.tsx
@@ -30,7 +30,7 @@ export default function TitleBar({
try {
await window.electronAPI?.appQuit?.();
} catch {
- // Silently handle if API not available
+ // noop
}
};
@@ -38,7 +38,8 @@ export default function TitleBar({
if (!actions) return null;
if (platform !== "darwin" && React.isValidElement(actions)) {
- const childrenArray = React.Children.toArray(actions.props.children);
+ const el = actions as React.ReactElement<{ children?: React.ReactNode }>;
+ const childrenArray = React.Children.toArray(el.props.children);
return <>{[...childrenArray].reverse()}</>;
}
diff --git a/src/components/TranscriptionModelPicker.tsx b/src/components/TranscriptionModelPicker.tsx
index cf1e875c7..5a7745ffc 100644
--- a/src/components/TranscriptionModelPicker.tsx
+++ b/src/components/TranscriptionModelPicker.tsx
@@ -16,7 +16,11 @@ import {
WHISPER_MODEL_INFO,
PARAKEET_MODEL_INFO,
} from "../models/ModelRegistry";
-import { MODEL_PICKER_COLORS, type ColorScheme } from "../utils/modelPickerStyles";
+import {
+ MODEL_PICKER_COLORS,
+ type ColorScheme,
+ type ModelPickerStyles,
+} from "../utils/modelPickerStyles";
import { getProviderIcon, isMonochromeProvider } from "../utils/providerIcons";
import { API_ENDPOINTS } from "../config/constants";
import { createExternalLinkHandler } from "../utils/externalLinks";
@@ -44,7 +48,7 @@ interface LocalModelCardProps {
onDelete: () => void;
onDownload: () => void;
onCancel: () => void;
- styles: ReturnType<(typeof MODEL_PICKER_COLORS)[keyof typeof MODEL_PICKER_COLORS]>;
+ styles: ModelPickerStyles;
}
function LocalModelCard({
@@ -208,7 +212,7 @@ const CLOUD_PROVIDER_TABS = [
const VALID_CLOUD_PROVIDER_IDS = CLOUD_PROVIDER_TABS.map((p) => p.id);
-const LOCAL_PROVIDER_TABS = [
+const LOCAL_PROVIDER_TABS: Array<{ id: string; name: string; disabled?: boolean }> = [
{ id: "whisper", name: "OpenAI Whisper" },
{ id: "nvidia", name: "NVIDIA Parakeet" },
];
@@ -643,10 +647,11 @@ export default function TranscriptionModelPicker({
<div className="space-y-0.5">
{modelsToRender.map((model) => {
const modelId = model.model;
- const info = WHISPER_MODEL_INFO[modelId] || {
+ const info = WHISPER_MODEL_INFO[modelId] ?? {
name: modelId,
description: "Model",
size: "Unknown",
+ recommended: false,
};
return (
@@ -715,11 +720,12 @@ export default function TranscriptionModelPicker({
<div className="space-y-0.5">
{modelsToRender.map((model) => {
const modelId = model.model;
- const info = PARAKEET_MODEL_INFO[modelId] || {
+ const info = PARAKEET_MODEL_INFO[modelId] ?? {
name: modelId,
description: "NVIDIA Parakeet Model",
size: "Unknown",
language: "en",
+ recommended: false,
};
return (
diff --git a/src/components/ui/MarkdownRenderer.tsx b/src/components/ui/MarkdownRenderer.tsx
index 4b8e3577a..88925a519 100644
--- a/src/components/ui/MarkdownRenderer.tsx
+++ b/src/components/ui/MarkdownRenderer.tsx
@@ -8,50 +8,51 @@ interface MarkdownRendererProps {
export function MarkdownRenderer({ content, className }: MarkdownRendererProps) {
return (
- <Markdown
- className={cn("prose prose-sm max-w-none", className)}
- components={{
- h1: ({ children }) => (
- <h1 className="text-lg font-bold mb-2 mt-3 first:mt-0">{children}</h1>
- ),
- h2: ({ children }) => (
- <h2 className="text-base font-semibold mb-2 mt-3 first:mt-0">{children}</h2>
- ),
- h3: ({ children }) => (
- <h3 className="text-sm font-semibold mb-1.5 mt-2 first:mt-0">{children}</h3>
- ),
- p: ({ children }) => <p className="mb-2 last:mb-0">{children}</p>,
- ul: ({ children }) => <ul className="list-disc pl-4 mb-2 space-y-1">{children}</ul>,
- ol: ({ children }) => <ol className="list-decimal pl-4 mb-2 space-y-1">{children}</ol>,
- li: ({ children }) => <li className="pl-1">{children}</li>,
- a: ({ href, children }) => (
- <a
- href={href}
- target="_blank"
- rel="noopener noreferrer"
- className="text-link underline decoration-link/30 hover:decoration-link/60 transition-colors"
- >
- {children}
- </a>
- ),
- code: ({ children }) => (
- <code className="bg-black/10 px-1 py-0.5 rounded text-xs font-mono">{children}</code>
- ),
- pre: ({ children }) => (
- <pre className="bg-black/10 p-2 rounded overflow-x-auto text-xs mb-2">{children}</pre>
- ),
- strong: ({ children }) => <strong className="font-semibold">{children}</strong>,
- em: ({ children }) => <em className="italic">{children}</em>,
- blockquote: ({ children }) => (
- <blockquote className="border-l-2 border-current/30 pl-3 italic my-2">
- {children}
- </blockquote>
- ),
- hr: () => <hr className="border-current/20 my-3" />,
- }}
- >
- {content}
- </Markdown>
+ <div className={cn("prose prose-sm max-w-none", className)}>
+ <Markdown
+ components={{
+ h1: ({ children }) => (
+ <h1 className="text-lg font-bold mb-2 mt-3 first:mt-0">{children}</h1>
+ ),
+ h2: ({ children }) => (
+ <h2 className="text-base font-semibold mb-2 mt-3 first:mt-0">{children}</h2>
+ ),
+ h3: ({ children }) => (
+ <h3 className="text-sm font-semibold mb-1.5 mt-2 first:mt-0">{children}</h3>
+ ),
+ p: ({ children }) => <p className="mb-2 last:mb-0">{children}</p>,
+ ul: ({ children }) => <ul className="list-disc pl-4 mb-2 space-y-1">{children}</ul>,
+ ol: ({ children }) => <ol className="list-decimal pl-4 mb-2 space-y-1">{children}</ol>,
+ li: ({ children }) => <li className="pl-1">{children}</li>,
+ a: ({ href, children }) => (
+ <a
+ href={href}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-link underline decoration-link/30 hover:decoration-link/60 transition-colors"
+ >
+ {children}
+ </a>
+ ),
+ code: ({ children }) => (
+ <code className="bg-black/10 px-1 py-0.5 rounded text-xs font-mono">{children}</code>
+ ),
+ pre: ({ children }) => (
+ <pre className="bg-black/10 p-2 rounded overflow-x-auto text-xs mb-2">{children}</pre>
+ ),
+ strong: ({ children }) => <strong className="font-semibold">{children}</strong>,
+ em: ({ children }) => <em className="italic">{children}</em>,
+ blockquote: ({ children }) => (
+ <blockquote className="border-l-2 border-current/30 pl-3 italic my-2">
+ {children}
+ </blockquote>
+ ),
+ hr: () => <hr className="border-current/20 my-3" />,
+ }}
+ >
+ {content}
+ </Markdown>
+ </div>
);
}
diff --git a/src/components/ui/Toast.tsx b/src/components/ui/Toast.tsx
index af141dd37..bff026691 100644
--- a/src/components/ui/Toast.tsx
+++ b/src/components/ui/Toast.tsx
@@ -48,7 +48,6 @@ export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ childre
const startExitAnimation = React.useCallback((id: string) => {
setToasts((prev) => prev.map((t) => (t.id === id ? { ...t, isExiting: true } : t)));
- // Remove after exit animation completes
setTimeout(() => {
setToasts((prev) => prev.filter((t) => t.id !== id));
}, 200);
@@ -109,10 +108,9 @@ export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ childre
[startExitAnimation]
);
- // Cleanup on unmount
React.useEffect(() => {
+ const timers = timersRef.current;
return () => {
- const timers = timersRef.current;
for (const id in timers) {
clearTimeout(timers[id]);
}
@@ -138,7 +136,6 @@ const ToastViewport: React.FC<{
onPauseTimer: (id: string) => void;
onResumeTimer: (id: string, remainingTime: number) => void;
}> = ({ toasts, onDismiss, onPauseTimer, onResumeTimer }) => {
- // Detect if we're in the dictation panel (minimal overlay with mic button)
const isDictationPanel = React.useMemo(() => {
return (
window.location.pathname.indexOf("control") === -1 &&
@@ -174,10 +171,8 @@ const variantConfig = {
default: {
icon: Info,
containerClass: cn(
- // Glass morphism base
"bg-card/90 dark:bg-surface-2/95",
"border border-border/60 dark:border-white/10",
- // Metallic highlight
"shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06),0_4px_12px_-2px_rgba(0,0,0,0.15),0_2px_4px_-1px_rgba(0,0,0,0.1)]",
"dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.05),0_8px_24px_-4px_rgba(0,0,0,0.4),0_2px_8px_-2px_rgba(0,0,0,0.3)]"
),
@@ -189,10 +184,8 @@ const variantConfig = {
destructive: {
icon: AlertCircle,
containerClass: cn(
- // Subtle red tint with glass
"bg-destructive/8 dark:bg-destructive/12",
"border border-destructive/20 dark:border-destructive/25",
- // Colored glow
"shadow-[inset_0_1px_0_0_rgba(255,255,255,0.04),0_4px_12px_-2px_rgba(220,38,38,0.15),0_2px_4px_-1px_rgba(0,0,0,0.1)]",
"dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.03),0_8px_24px_-4px_rgba(220,38,38,0.25),0_2px_8px_-2px_rgba(0,0,0,0.3)]"
),
@@ -204,10 +197,8 @@ const variantConfig = {
success: {
icon: CheckCircle2,
containerClass: cn(
- // Subtle green tint with glass
"bg-success/8 dark:bg-success/12",
"border border-success/20 dark:border-success/25",
- // Colored glow
"shadow-[inset_0_1px_0_0_rgba(255,255,255,0.04),0_4px_12px_-2px_rgba(22,163,74,0.15),0_2px_4px_-1px_rgba(0,0,0,0.1)]",
"dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.03),0_8px_24px_-4px_rgba(22,163,74,0.25),0_2px_8px_-2px_rgba(0,0,0,0.3)]"
),
@@ -257,28 +248,21 @@ const Toast: React.FC<
return (
<div
className={cn(
- // Layout
"pointer-events-auto relative flex items-start gap-2.5 w-[320px]",
"px-3 py-2.5 pr-8 overflow-hidden",
- // Tight radius matching buttons
"rounded-[6px]",
- // Glass blur
"backdrop-blur-xl",
- // Animation states
"transition-all duration-200 ease-out",
isExiting
? "opacity-0 translate-x-2 scale-[0.98]"
: "opacity-100 translate-x-0 scale-100 animate-in slide-in-from-right-4 fade-in-0 duration-300",
- // Variant styling
config.containerClass
)}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
- {/* Status Icon */}
<Icon className={cn("size-4 shrink-0 mt-0.5", config.iconClass)} />
- {/* Content */}
<div className="flex-1 min-w-0">
{title && (
<div className={cn("text-[13px] font-medium leading-tight", config.titleClass)}>
@@ -292,10 +276,8 @@ const Toast: React.FC<
)}
</div>
- {/* Action slot */}
{action && <div className="shrink-0 self-center">{action}</div>}
- {/* Close button */}
{onClose && (
<button
onClick={onClose}
@@ -313,7 +295,6 @@ const Toast: React.FC<
</button>
)}
- {/* Progress indicator - subtle bottom bar */}
{duration > 0 && !isExiting && (
<div className="absolute bottom-0 left-0 right-0 h-[2px] overflow-hidden">
<div
@@ -328,7 +309,6 @@ const Toast: React.FC<
);
};
-// Helper function for common toast patterns
export const toast = {
success: (message: string) => ({
title: "Success",
diff --git a/src/helpers/hotkeyManager.js b/src/helpers/hotkeyManager.js
index 839a47ca8..46d874f39 100644
--- a/src/helpers/hotkeyManager.js
+++ b/src/helpers/hotkeyManager.js
@@ -16,8 +16,18 @@ function isRightSideModifier(hotkey) {
// Modifier-only combos (e.g. "Control+Super") bypass globalShortcut on Windows
// and use the native low-level keyboard hook instead.
const MODIFIER_NAMES = new Set([
- "control", "ctrl", "alt", "option", "shift", "super",
- "meta", "win", "command", "cmd", "commandorcontrol", "cmdorctrl",
+ "control",
+ "ctrl",
+ "alt",
+ "option",
+ "shift",
+ "super",
+ "meta",
+ "win",
+ "command",
+ "cmd",
+ "commandorcontrol",
+ "cmdorctrl",
]);
function isModifierOnlyHotkey(hotkey) {
diff --git a/src/helpers/llamaCppInstaller.ts b/src/helpers/llamaCppInstaller.ts
index daaebd6ac..aa35bc846 100644
--- a/src/helpers/llamaCppInstaller.ts
+++ b/src/helpers/llamaCppInstaller.ts
@@ -5,7 +5,7 @@ import fs from "fs";
import { promises as fsPromises } from "fs";
import https from "https";
import { createWriteStream } from "fs";
-import tar from "tar";
+import * as tar from "tar";
import os from "os";
// Only import unzipper in main process
diff --git a/src/hooks/useLocalModels.ts b/src/hooks/useLocalModels.ts
index 8863eb74c..cf39a904f 100644
--- a/src/hooks/useLocalModels.ts
+++ b/src/hooks/useLocalModels.ts
@@ -8,7 +8,7 @@ interface ModelWithStatus extends ModelDefinition {
downloadProgress: number;
}
-interface DownloadProgress {
+interface LLMDownloadProgressEvent {
modelId: string;
progress: number;
downloadedSize: number;
@@ -19,7 +19,7 @@ export function useLocalModels() {
const [models, setModels] = useState<ModelWithStatus[]>([]);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
- const [progressMap, setProgressMap] = useState<Map<string, DownloadProgress>>(new Map());
+ const [progressMap, setProgressMap] = useState<Map<string, LLMDownloadProgressEvent>>(new Map());
const loadModels = useCallback(async () => {
try {
@@ -38,8 +38,7 @@ export function useLocalModels() {
useEffect(() => {
loadModels();
- // Set up progress listener
- const handleProgress = (_event: any, data: DownloadProgress) => {
+ const handleProgress = (_event: any, data: LLMDownloadProgressEvent) => {
setProgressMap((prev) => new Map(prev).set(data.modelId, data));
};
diff --git a/src/hooks/useModelDownload.ts b/src/hooks/useModelDownload.ts
index bcd70407d..65d127879 100644
--- a/src/hooks/useModelDownload.ts
+++ b/src/hooks/useModelDownload.ts
@@ -4,7 +4,7 @@ import { useToast } from "../components/ui/Toast";
import type { WhisperDownloadProgressData } from "../types/electron";
import "../types/electron";
-const PROGRESS_THROTTLE_MS = 100; // Throttle UI updates to prevent flashing
+const PROGRESS_THROTTLE_MS = 100;
export interface DownloadProgress {
percentage: number;
@@ -85,8 +85,6 @@ export function useModelDownload({
} else if (data.type === "installing") {
setIsInstalling(true);
} else if (data.type === "complete") {
- // Cleanup is handled by the finally block in downloadModel;
- // this handles the IPC progress event for completion
if (isCancellingRef.current) return;
setIsInstalling(false);
setDownloadingModel(null);
@@ -98,10 +96,8 @@ export function useModelDownload({
);
const handleLLMProgress = useCallback((_event: unknown, data: LLMDownloadProgressData) => {
- // Skip if cancellation is in progress
if (isCancellingRef.current) return;
- // Throttle UI updates to prevent flashing (server-side throttling is primary, this is backup)
const now = Date.now();
const isComplete = data.progress >= 100;
if (!isComplete && now - lastProgressUpdateRef.current < PROGRESS_THROTTLE_MS) {
@@ -134,7 +130,6 @@ export function useModelDownload({
const downloadModel = useCallback(
async (modelId: string, onSelectAfterDownload?: (id: string) => void) => {
- // Prevent starting a new download if one is already in progress
if (downloadingModel) {
toast({
title: "Download in Progress",
@@ -171,7 +166,7 @@ export function useModelDownload({
success = result?.success ?? false;
}
} else {
- const result = (await window.electronAPI?.modelDownload?.(modelId)) as
+ const result = (await window.electronAPI?.modelDownload?.(modelId)) as unknown as
| { success: boolean; error?: string }
| undefined;
if (result && !result.success && result.error) {
@@ -190,7 +185,6 @@ export function useModelDownload({
onDownloadCompleteRef.current?.();
} catch (error: unknown) {
- // Skip error display if cancellation is in progress
if (isCancellingRef.current) return;
const errorMessage = error instanceof Error ? error.message : String(error);
diff --git a/src/lib/neonAuth.ts b/src/lib/neonAuth.ts
index 319241aa1..58181aa44 100644
--- a/src/lib/neonAuth.ts
+++ b/src/lib/neonAuth.ts
@@ -90,7 +90,6 @@ export function updateLastSignInTime(): void {
persistLastSignInTime(now);
}
-/** Exported so useAuth can suppress premature sign-outs during grace period. */
export function isWithinGracePeriod(): boolean {
const startedAt = getLastSignInTime();
if (!startedAt) return false;
@@ -106,7 +105,7 @@ export async function refreshSession(): Promise<boolean> {
try {
const result = await authClient.getSession();
- return Boolean(result.data?.session?.user);
+ return Boolean((result.data?.session as any)?.user);
} catch {
return false;
}
@@ -126,11 +125,6 @@ export async function signOut(): Promise<void> {
}
}
-/**
- * Wraps API calls with automatic retry on AUTH_EXPIRED errors.
- * During grace period: retries with exponential backoff while cookies establish.
- * Otherwise: attempts a single session refresh before surfacing the error.
- */
export async function withSessionRefresh<T>(operation: () => Promise<T>): Promise<T> {
const startedInGracePeriod = isWithinGracePeriod();
let graceRetriesUsed = 0;
diff --git a/src/services/ReasoningService.ts b/src/services/ReasoningService.ts
index a00e17bbf..e2b976f5c 100644
--- a/src/services/ReasoningService.ts
+++ b/src/services/ReasoningService.ts
@@ -1075,7 +1075,7 @@ class ReasoningService extends BaseReasoningService {
}
}
- private getCustomDictionary(): string[] {
+ protected getCustomDictionary(): string[] {
try {
const raw = localStorage.getItem("customDictionary");
if (!raw) return [];
diff --git a/src/services/localReasoningBridge.js b/src/services/localReasoningBridge.js
index fe12a5913..12b19d624 100644
--- a/src/services/localReasoningBridge.js
+++ b/src/services/localReasoningBridge.js
@@ -11,7 +11,7 @@ class LocalReasoningService {
await modelManager.ensureLlamaCpp();
const models = await modelManager.getAllModels();
return models.some((model) => model.isDownloaded);
- } catch (error) {
+ } catch {
return false;
}
}
diff --git a/src/tsconfig.json b/src/tsconfig.json
new file mode 100644
index 000000000..0460fbd08
--- /dev/null
+++ b/src/tsconfig.json
@@ -0,0 +1,29 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "jsx": "react-jsx",
+ "strict": false,
+ "noEmit": true,
+ "allowJs": true,
+ "checkJs": false,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "paths": {
+ "@/*": ["./*"]
+ },
+ "baseUrl": "."
+ },
+ "include": [
+ "**/*.ts",
+ "**/*.tsx",
+ "**/*.js",
+ "**/*.jsx"
+ ],
+ "exclude": ["node_modules", "dist"]
+}
diff --git a/src/types/electron.ts b/src/types/electron.ts
index ef41f8509..4e2bf5941 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -169,9 +169,9 @@ declare global {
pasteText: (text: string, options?: { fromStreaming?: boolean }) => Promise<void>;
hideWindow: () => Promise<void>;
showDictationPanel: () => Promise<void>;
- onToggleDictation: (callback: () => void) => (() => void) | void;
- onStartDictation?: (callback: () => void) => (() => void) | void;
- onStopDictation?: (callback: () => void) => (() => void) | void;
+ onToggleDictation: (callback: () => void) => () => void;
+ onStartDictation?: (callback: () => void) => () => void;
+ onStopDictation?: (callback: () => void) => () => void;
// Database operations
saveTranscription: (text: string) => Promise<{ id: number; success: boolean }>;
@@ -184,11 +184,9 @@ declare global {
setDictionary: (words: string[]) => Promise<{ success: boolean }>;
// Database event listeners
- onTranscriptionAdded?: (callback: (item: TranscriptionItem) => void) => (() => void) | void;
- onTranscriptionDeleted?: (callback: (payload: { id: number }) => void) => (() => void) | void;
- onTranscriptionsCleared?: (
- callback: (payload: { cleared: number }) => void
- ) => (() => void) | void;
+ onTranscriptionAdded?: (callback: (item: TranscriptionItem) => void) => () => void;
+ onTranscriptionDeleted?: (callback: (payload: { id: number }) => void) => () => void;
+ onTranscriptionsCleared?: (callback: (payload: { cleared: number }) => void) => () => void;
// API key management
getOpenAIKey: () => Promise<string>;
@@ -211,7 +209,7 @@ declare global {
checkPasteTools: () => Promise<PasteToolsResult>;
// Audio
- onNoAudioDetected: (callback: (event: any, data?: any) => void) => (() => void) | void;
+ onNoAudioDetected: (callback: (event: any, data?: any) => void) => () => void;
// Whisper operations (whisper.cpp)
transcribeLocalWhisper: (audioBlob: Blob | ArrayBuffer, options?: any) => Promise<any>;
@@ -219,7 +217,7 @@ declare global {
downloadWhisperModel: (modelName: string) => Promise<WhisperModelResult>;
onWhisperDownloadProgress: (
callback: (event: any, data: WhisperDownloadProgressData) => void
- ) => (() => void) | void;
+ ) => () => void;
checkModelStatus: (modelName: string) => Promise<WhisperModelResult>;
listWhisperModels: () => Promise<WhisperModelsListResult>;
deleteWhisperModel: (modelName: string) => Promise<WhisperModelDeleteResult>;
@@ -245,7 +243,7 @@ declare global {
downloadParakeetModel: (modelName: string) => Promise<ParakeetModelResult>;
onParakeetDownloadProgress: (
callback: (event: any, data: ParakeetDownloadProgressData) => void
- ) => (() => void) | void;
+ ) => () => void;
checkParakeetModelStatus: (modelName: string) => Promise<ParakeetModelResult>;
listParakeetModels: () => Promise<ParakeetModelsListResult>;
deleteParakeetModel: (modelName: string) => Promise<ParakeetModelDeleteResult>;
@@ -271,7 +269,7 @@ declare global {
modelDeleteAll: () => Promise<{ success: boolean; error?: string; code?: string }>;
modelCheckRuntime: () => Promise<boolean>;
modelCancelDownload: (modelId: string) => Promise<{ success: boolean; error?: string }>;
- onModelDownloadProgress: (callback: (event: any, data: any) => void) => (() => void) | void;
+ onModelDownloadProgress: (callback: (event: any, data: any) => void) => () => void;
// Local reasoning
processLocalReasoning: (
@@ -318,16 +316,13 @@ declare global {
getUpdateInfo: () => Promise<UpdateInfoResult | null>;
// Update event listeners
- onUpdateAvailable: (callback: (event: any, info: any) => void) => (() => void) | void;
- onUpdateNotAvailable: (callback: (event: any, info: any) => void) => (() => void) | void;
- onUpdateDownloaded: (callback: (event: any, info: any) => void) => (() => void) | void;
- onUpdateDownloadProgress: (
- callback: (event: any, progressObj: any) => void
- ) => (() => void) | void;
- onUpdateError: (callback: (event: any, error: any) => void) => (() => void) | void;
+ onUpdateAvailable: (callback: (event: any, info: any) => void) => () => void;
+ onUpdateNotAvailable: (callback: (event: any, info: any) => void) => () => void;
+ onUpdateDownloaded: (callback: (event: any, info: any) => void) => () => void;
+ onUpdateDownloadProgress: (callback: (event: any, progressObj: any) => void) => () => void;
+ onUpdateError: (callback: (event: any, error: any) => void) => () => void;
- // External URL operations
- openExternal: (url: string) => Promise<{ success: boolean; error?: string } | void>;
+ openExternal: (url: string) => Promise<{ success: boolean; error?: string }>;
// Hotkey management
updateHotkey: (key: string) => Promise<{ success: boolean; message: string }>;
@@ -480,7 +475,7 @@ declare global {
notifyLimitReached?: (data: { wordsUsed: number; limit: number }) => void;
onLimitReached?: (
callback: (data: { wordsUsed: number; limit: number }) => void
- ) => (() => void) | void;
+ ) => () => void;
// AssemblyAI Streaming
assemblyAiStreamingWarmup?: (options?: {
diff --git a/src/utils/SecureCache.ts b/src/utils/SecureCache.ts
index 46daf3a0c..b1db80738 100644
--- a/src/utils/SecureCache.ts
+++ b/src/utils/SecureCache.ts
@@ -35,6 +35,10 @@ export class SecureCache<T> {
return entry.value;
}
+ get size(): number {
+ return this.cache.size;
+ }
+
has(key: string): boolean {
return this.get(key) !== undefined;
}
@@ -47,7 +51,6 @@ export class SecureCache<T> {
this.cache.clear();
}
- // Clean up expired entries
cleanup(): void {
const now = Date.now();
const entries = Array.from(this.cache.entries());
@@ -58,7 +61,6 @@ export class SecureCache<T> {
}
}
- // Auto cleanup on interval
startAutoCleanup(intervalMs: number = 60000): () => void {
const interval = setInterval(() => this.cleanup(), intervalMs);
return () => clearInterval(interval);
diff --git a/src/utils/agentName.ts b/src/utils/agentName.ts
index 5d90835ad..33bcbdbd4 100644
--- a/src/utils/agentName.ts
+++ b/src/utils/agentName.ts
@@ -11,7 +11,6 @@ export const setAgentName = (name: string): void => {
localStorage.setItem(AGENT_NAME_KEY, name);
};
-/** Only sets agent name if one isn't already stored (preserves existing user preferences) */
export const setAgentNameIfEmpty = (name: string): void => {
if (!localStorage.getItem(AGENT_NAME_KEY)) {
localStorage.setItem(AGENT_NAME_KEY, name);
diff --git a/src/utils/externalLinks.ts b/src/utils/externalLinks.ts
index bbc3d7409..630ec3530 100644
--- a/src/utils/externalLinks.ts
+++ b/src/utils/externalLinks.ts
@@ -1,21 +1,13 @@
-/**
- * Opens a URL in the user's default system browser (not inside Electron window)
- */
export function openExternalLink(url: string): void {
if (window.electronAPI?.openExternal) {
window.electronAPI.openExternal(url);
} else {
- // Fallback for non-Electron environments (development, etc.)
window.open(url, "_blank", "noopener,noreferrer");
}
}
-/**
- * Returns an onClick handler that opens a URL in the default browser
- * Prevents default link behavior to avoid opening in Electron window
- */
export function createExternalLinkHandler(url: string) {
- return (e: React.MouseEvent<HTMLAnchorElement>) => {
+ return (e: React.MouseEvent) => {
e.preventDefault();
openExternalLink(url);
};
diff --git a/src/utils/providerIcons.ts b/src/utils/providerIcons.ts
index 3d3c71ed3..0d72fc6dd 100644
--- a/src/utils/providerIcons.ts
+++ b/src/utils/providerIcons.ts
@@ -1,4 +1,3 @@
-// Import SVG icons as URLs for proper Vite bundling
import openaiIcon from "@/assets/icons/providers/openai.svg";
import anthropicIcon from "@/assets/icons/providers/anthropic.svg";
import geminiIcon from "@/assets/icons/providers/gemini.svg";
@@ -26,10 +25,8 @@ export function getProviderIcon(provider: string): string | undefined {
return PROVIDER_ICONS[provider];
}
-/** Providers with monochrome icons that should invert in dark mode */
export const MONOCHROME_PROVIDERS = ["openai", "whisper", "anthropic", "openai-oss"] as const;
-/** Check if a provider has a monochrome icon that needs dark mode inversion */
export function isMonochromeProvider(provider: string): boolean {
return (MONOCHROME_PROVIDERS as readonly string[]).includes(provider);
}
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts
new file mode 100644
index 000000000..9c82537ea
--- /dev/null
+++ b/src/vite-env.d.ts
@@ -0,0 +1,29 @@
+/// <reference types="vite/client" />
+
+import "react";
+
+declare module "react" {
+ interface CSSProperties {
+ WebkitAppRegion?: "drag" | "no-drag";
+ }
+}
+
+declare module "*.png" {
+ const src: string;
+ export default src;
+}
+
+declare module "*.svg" {
+ const src: string;
+ export default src;
+}
+
+declare module "*.jpg" {
+ const src: string;
+ export default src;
+}
+
+declare module "*.gif" {
+ const src: string;
+ export default src;
+}