Skip to content

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

Dark mode (#159)

Gabriel Stein6ae83bbe555b
diff --git a/.gitignore b/.gitignore
index c7130780a..c65c2fe6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -271,6 +271,37 @@ $RECYCLE.BIN/
.agent/
.agents/
+# AI agent skills (keep local)
+.agents/
+.agent/
+.claude/skills/
+.cline/
+.codebuddy/
+.codex/
+.commandcode/
+.continue/
+.crush/
+.cursor/
+.factory/
+.gemini/
+.github/skills/
+.goose/
+.kilocode/
+.kiro/
+.mcpjam/
+.mux/
+.neovate/
+.opencode/
+.openhands/
+.pi/
+.qoder/
+.qwen/
+.roo/
+.trae/
+.windsurf/
+.zencoder/
+skills/
+
# OS generated files
.DS_Store
.DS_Store?
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f84252af8..02c9d48a4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [Unreleased]
+
+### Added
+- **Cancel Processing Button**: Added ability to cancel ongoing transcription processing
+- **Dark Mode Icon Inversion**: Monochrome provider icons now automatically invert in dark mode for better visibility
+- **Dynamic Window Resizing**: Window automatically resizes based on command menu and toast visibility
+
+### Changed
+- **Design System Overhaul**: Complete refactor of styling to use design tokens throughout the codebase
+ - Button component now uses `text-foreground`, `bg-muted`, `border-border` instead of hardcoded hex values
+ - Removed hardcoded classes and inline styles across components
+ - Improved button and badge consistency
+- **Settings UI Redesign**: Overhauled all settings pages with unified panel system, redesigned sidebar, and extracted permissions section
+- **Dark Mode Polish**: Premium button styling, glass morphism toasts, and streamlined visuals
+- **Onboarding Improvements**:
+ - Streamlined to 4-step flow
+ - Extended to support multiple local transcription providers (Whisper and NVIDIA Parakeet)
+ - Improved contrast and design system usage
+
+### Fixed
+- **Light Mode UI Visibility**: Fixed multiple UI elements that were invisible or hard to see in light mode:
+ - Settings gear icon in permission cards now uses `text-foreground`
+ - Troubleshoot button uses proper foreground color
+ - Reset button in developer settings now correctly shows destructive color
+ - Settings and Help icons in the toolbar are now properly visible
+ - Check for Updates button now renders correctly in light mode
+- **Provider Tab Flashing**: Resolved TranscriptionModelPicker tab flashing by extracting ModeToggle component and syncing internal state with props
+- **Local Reasoning Model Persistence**: Fixed local reasoning model selection not persisting correctly
+- **Parakeet Model Status**: Added dedicated IPC channel for Parakeet model status checks
+- **Groq Qwen3 Models**: Removed thinking tokens from Qwen3 models on Groq provider
+
## [1.3.3] - 2026-01-28
### Added
diff --git a/package-lock.json b/package-lock.json
index 1bdc5f361..440d8cc05 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "open-whispr",
- "version": "1.3.3",
+ "version": "1.3.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "open-whispr",
- "version": "1.3.3",
+ "version": "1.3.4",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
diff --git a/package.json b/package.json
index 6aab2af4e..358105083 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "open-whispr",
- "version": "1.3.3",
+ "version": "1.3.4",
"description": "A desktop dictation application using whisper.cpp for speech-to-text transcription",
"main": "main.js",
"private": true,
diff --git a/preload.js b/preload.js
index 9161b7611..b9ab37d2a 100644
--- a/preload.js
+++ b/preload.js
@@ -145,6 +145,8 @@ contextBridge.exposeInMainWorld("electronAPI", {
stopWindowDrag: () => ipcRenderer.invoke("stop-window-drag"),
setMainWindowInteractivity: (interactive) =>
ipcRenderer.invoke("set-main-window-interactivity", interactive),
+ resizeMainWindow: (sizeKey) =>
+ ipcRenderer.invoke("resize-main-window", sizeKey),
// Update functions
checkForUpdates: () => ipcRenderer.invoke("check-for-updates"),
diff --git a/src/App.jsx b/src/App.jsx
index ee7afcb8e..892c667f7 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -55,12 +55,12 @@ const Tooltip = ({ children, content, emoji }) => {
</div>
{isVisible && (
<div
- className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-1 py-1 text-white bg-gradient-to-r from-neutral-800 to-neutral-700 rounded-md whitespace-nowrap z-10 transition-opacity duration-150"
- style={{ fontSize: "9.7px" }}
+ className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-1 py-1 text-popover-foreground bg-popover border border-border rounded-md whitespace-nowrap z-10 transition-opacity duration-150 shadow-lg"
+ style={{ fontSize: "9.7px", maxWidth: "96px" }}
>
{emoji && <span className="mr-1">{emoji}</span>}
{content}
- <div className="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-transparent border-t-neutral-800"></div>
+ <div className="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-transparent border-t-popover"></div>
</div>
)}
</div>
@@ -72,7 +72,7 @@ export default function App() {
const [isCommandMenuOpen, setIsCommandMenuOpen] = useState(false);
const commandMenuRef = useRef(null);
const buttonRef = useRef(null);
- const { toast } = useToast();
+ const { toast, toastCount } = useToast();
const { hotkey } = useHotkey();
const { isDragging, handleMouseDown, handleMouseUp } = useWindowDrag();
const [dragStartPos, setDragStartPos] = useState(null);
@@ -111,21 +111,37 @@ export default function App() {
}, [toast]);
useEffect(() => {
- if (isCommandMenuOpen) {
+ if (isCommandMenuOpen || toastCount > 0) {
setWindowInteractivity(true);
} else if (!isHovered) {
setWindowInteractivity(false);
}
- }, [isCommandMenuOpen, isHovered, setWindowInteractivity]);
+ }, [isCommandMenuOpen, isHovered, toastCount, setWindowInteractivity]);
+
+ useEffect(() => {
+ const resizeWindow = () => {
+ if (isCommandMenuOpen && toastCount > 0) {
+ window.electronAPI?.resizeMainWindow?.("EXPANDED");
+ } else if (isCommandMenuOpen) {
+ window.electronAPI?.resizeMainWindow?.("WITH_MENU");
+ } else if (toastCount > 0) {
+ window.electronAPI?.resizeMainWindow?.("WITH_TOAST");
+ } else {
+ window.electronAPI?.resizeMainWindow?.("BASE");
+ }
+ };
+ resizeWindow();
+ }, [isCommandMenuOpen, toastCount]);
const handleDictationToggle = React.useCallback(() => {
setIsCommandMenuOpen(false);
setWindowInteractivity(false);
}, [setWindowInteractivity]);
- const { isRecording, isProcessing, toggleListening, cancelRecording } = useAudioRecording(toast, {
- onToggle: handleDictationToggle,
- });
+ const { isRecording, isProcessing, toggleListening, cancelRecording, cancelProcessing } =
+ useAudioRecording(toast, {
+ onToggle: handleDictationToggle,
+ });
const handleClose = () => {
window.electronAPI.hideWindow();
@@ -182,23 +198,19 @@ export default function App() {
switch (micState) {
case "idle":
- return {
- className: `${baseClasses} bg-black/50 cursor-pointer`,
- tooltip: `Press [${hotkey}] to speak`,
- };
case "hover":
return {
className: `${baseClasses} bg-black/50 cursor-pointer`,
- tooltip: `Press [${hotkey}] to speak`,
+ tooltip: `[${hotkey}] to speak`,
};
case "recording":
return {
- className: `${baseClasses} bg-blue-600 cursor-pointer`,
+ className: `${baseClasses} bg-primary cursor-pointer`,
tooltip: "Recording...",
};
case "processing":
return {
- className: `${baseClasses} bg-purple-600 cursor-not-allowed`,
+ className: `${baseClasses} bg-accent cursor-not-allowed`,
tooltip: "Processing...",
};
default:
@@ -213,8 +225,8 @@ export default function App() {
const micProps = getMicButtonProps();
return (
- <>
- {/* Fixed bottom-right voice button */}
+ <div className="dictation-window">
+ {/* Bottom-right voice button - window expands upward/leftward */}
<div className="fixed bottom-6 right-6 z-50">
<div
className="relative flex items-center gap-2"
@@ -229,19 +241,17 @@ export default function App() {
}
}}
>
- {isRecording && isHovered && (
- <Tooltip content="Cancel recording">
- <button
- aria-label="Cancel recording"
- onClick={(e) => {
- e.stopPropagation();
- cancelRecording();
- }}
- className="w-7 h-7 rounded-full bg-neutral-800/90 hover:bg-red-500 border border-white/20 hover:border-red-400 flex items-center justify-center transition-all duration-150 shadow-lg backdrop-blur-sm"
- >
- <X size={12} strokeWidth={2.5} color="white" />
- </button>
- </Tooltip>
+ {(isRecording || isProcessing) && isHovered && (
+ <button
+ aria-label={isRecording ? "Cancel recording" : "Cancel processing"}
+ onClick={(e) => {
+ e.stopPropagation();
+ isRecording ? cancelRecording() : cancelProcessing();
+ }}
+ className="w-5 h-5 rounded-full bg-card/90 hover:bg-destructive border border-border hover:border-destructive flex items-center justify-center transition-all duration-150 shadow-lg backdrop-blur-sm"
+ >
+ <X size={10} strokeWidth={2.5} color="white" />
+ </button>
)}
<Tooltip content={micProps.tooltip}>
<button
@@ -320,19 +330,19 @@ export default function App() {
{/* State indicator ring for recording */}
{micState === "recording" && (
- <div className="absolute inset-0 rounded-full border-2 border-blue-300 animate-pulse"></div>
+ <div className="absolute inset-0 rounded-full border-2 border-primary/50 animate-pulse"></div>
)}
{/* State indicator ring for processing */}
{micState === "processing" && (
- <div className="absolute inset-0 rounded-full border-2 border-purple-300 opacity-50"></div>
+ <div className="absolute inset-0 rounded-full border-2 border-primary/30 opacity-50"></div>
)}
</button>
</Tooltip>
{isCommandMenuOpen && (
<div
ref={commandMenuRef}
- className="absolute bottom-full right-0 mb-3 w-48 rounded-lg border border-white/10 bg-neutral-900/95 text-white shadow-lg backdrop-blur-sm"
+ className="absolute bottom-full right-0 mb-3 w-48 rounded-lg border border-border bg-popover text-popover-foreground shadow-lg backdrop-blur-sm"
onMouseEnter={() => {
setWindowInteractivity(true);
}}
@@ -343,16 +353,16 @@ export default function App() {
}}
>
<button
- className="w-full px-3 py-2 text-left text-sm font-medium hover:bg-white/10 focus:bg-white/10 focus:outline-none"
+ className="w-full px-3 py-2 text-left text-sm font-medium hover:bg-muted focus:bg-muted focus:outline-none"
onClick={() => {
toggleListening();
}}
>
{isRecording ? "Stop listening" : "Start listening"}
</button>
- <div className="h-px bg-white/10" />
+ <div className="h-px bg-border" />
<button
- className="w-full px-3 py-2 text-left text-sm hover:bg-white/10 focus:bg-white/10 focus:outline-none"
+ className="w-full px-3 py-2 text-left text-sm hover:bg-muted focus:bg-muted focus:outline-none"
onClick={() => {
setIsCommandMenuOpen(false);
setWindowInteractivity(false);
@@ -365,6 +375,6 @@ export default function App() {
)}
</div>
</div>
- </>
+ </div>
);
}
diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsx
index 798e91443..ce7ad4e3a 100644
--- a/src/components/ControlPanel.tsx
+++ b/src/components/ControlPanel.tsx
@@ -1,8 +1,17 @@
import { useState, useEffect } from "react";
-import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";
import { Button } from "./ui/button";
-import { Trash2, Settings, FileText, Mic, Download, RefreshCw, Loader2 } from "lucide-react";
-import SettingsModal from "./SettingsModal";
+import {
+ Trash2,
+ Settings,
+ FileText,
+ Mic,
+ Download,
+ RefreshCw,
+ Loader2,
+ Sparkles,
+ X,
+} from "lucide-react";
+import SettingsModal, { SettingsSectionType } from "./SettingsModal";
import TitleBar from "./TitleBar";
import SupportDropdown from "./ui/SupportDropdown";
import TranscriptionItem from "./ui/TranscriptionItem";
@@ -11,19 +20,24 @@ import { useDialogs } from "../hooks/useDialogs";
import { useHotkey } from "../hooks/useHotkey";
import { useToast } from "./ui/Toast";
import { useUpdater } from "../hooks/useUpdater";
+import { useSettings } from "../hooks/useSettings";
import {
useTranscriptions,
initializeTranscriptions,
removeTranscription as removeFromStore,
clearTranscriptions as clearStoreTranscriptions,
} from "../stores/transcriptionStore";
+import { formatHotkeyLabel } from "../utils/hotkeys";
export default function ControlPanel() {
const history = useTranscriptions();
const [isLoading, setIsLoading] = useState(true);
const [showSettings, setShowSettings] = useState(false);
+ const [settingsSection, setSettingsSection] = useState<SettingsSectionType | undefined>();
+ const [aiCTADismissed, setAiCTADismissed] = useState(false);
const { hotkey } = useHotkey();
const { toast } = useToast();
+ const { useReasoningModel } = useSettings();
// Use centralized updater hook to prevent EventEmitter memory leaks
const {
@@ -106,20 +120,22 @@ export default function ControlPanel() {
const clearHistory = async () => {
showConfirmDialog({
title: "Clear History",
- description:
- "Are you certain you wish to clear all inscribed records? This action cannot be undone.",
+ description: "Are you sure you want to clear all transcriptions? This cannot be undone.",
onConfirm: async () => {
try {
const result = await window.electronAPI.clearTranscriptions();
clearStoreTranscriptions();
- showAlertDialog({
- title: "History Cleared",
- description: `Successfully cleared ${result.cleared} transcriptions from your chronicles.`,
+ toast({
+ title: "History cleared",
+ description: `${result.cleared} transcription${result.cleared !== 1 ? "s" : ""} removed`,
+ variant: "success",
+ duration: 3000,
});
} catch (error) {
- showAlertDialog({
- title: "Error",
- description: "Failed to clear history. Please try again.",
+ toast({
+ title: "Failed to clear",
+ description: "Please try again",
+ variant: "destructive",
});
}
},
@@ -199,7 +215,7 @@ export default function ControlPanel() {
return (
<>
<Loader2 size={14} className="animate-spin" />
- <span>{downloadProgress}%</span>
+ <span>{Math.round(downloadProgress)}%</span>
</>
);
}
@@ -223,7 +239,7 @@ export default function ControlPanel() {
};
return (
- <div className="min-h-screen bg-white">
+ <div className="min-h-screen bg-background">
<ConfirmDialog
open={confirmDialog.open}
onOpenChange={hideConfirmDialog}
@@ -255,107 +271,135 @@ export default function ControlPanel() {
size="sm"
onClick={handleUpdateClick}
disabled={isInstalling || isDownloading}
- className={`gap-1.5 text-xs ${
- updateStatus.updateDownloaded
- ? "bg-blue-600 hover:bg-blue-700 text-white"
- : "border-blue-300 text-blue-600 hover:bg-blue-50"
- }`}
+ className="gap-1.5 text-xs"
>
{getUpdateButtonContent()}
</Button>
)}
<SupportDropdown />
- <Button variant="ghost" size="icon" onClick={() => setShowSettings(!showSettings)}>
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={() => {
+ setSettingsSection(undefined);
+ setShowSettings(true);
+ }}
+ className="text-foreground/70 hover:text-foreground hover:bg-foreground/10"
+ >
<Settings size={16} />
</Button>
</>
}
/>
- <SettingsModal open={showSettings} onOpenChange={setShowSettings} />
+ <SettingsModal
+ open={showSettings}
+ onOpenChange={(open) => {
+ setShowSettings(open);
+ if (!open) setSettingsSection(undefined);
+ }}
+ initialSection={settingsSection}
+ />
{/* Main content */}
- <div className="p-6">
- <div className="space-y-6 max-w-4xl mx-auto">
- <Card>
- <CardHeader>
- <div className="flex items-center justify-between">
- <CardTitle className="flex items-center gap-2">
- <FileText size={18} className="text-indigo-600" />
- Recent Transcriptions
- </CardTitle>
- <div className="flex gap-2">
- {history.length > 0 && (
- <Button
- onClick={clearHistory}
- variant="ghost"
- size="icon"
- className="text-red-600 hover:text-red-700 hover:bg-red-50"
- >
- <Trash2 size={16} />
- </Button>
- )}
- </div>
- </div>
- </CardHeader>
- <CardContent>
- {isLoading ? (
- <div className="text-center py-8">
- <div className="w-8 h-8 mx-auto mb-3 bg-indigo-600 rounded-lg flex items-center justify-center">
- <span className="text-white text-sm">πŸ“</span>
- </div>
- <p className="text-neutral-600">Loading transcriptions...</p>
+ <div className="p-4">
+ <div className="max-w-3xl mx-auto">
+ {/* Header row */}
+ <div className="flex items-center justify-between mb-3 px-1">
+ <div className="flex items-center gap-2">
+ <FileText size={14} className="text-primary" />
+ <h2 className="text-sm font-semibold text-foreground">Transcriptions</h2>
+ {history.length > 0 && (
+ <span className="text-[11px] text-muted-foreground tabular-nums">
+ ({history.length})
+ </span>
+ )}
+ </div>
+ {history.length > 0 && (
+ <Button
+ onClick={clearHistory}
+ variant="ghost"
+ size="sm"
+ className="h-7 px-2 text-[11px] text-muted-foreground hover:text-destructive hover:bg-destructive/10"
+ >
+ <Trash2 size={12} className="mr-1" />
+ Clear
+ </Button>
+ )}
+ </div>
+
+ {/* AI Enhancement CTA */}
+ {!useReasoningModel && !aiCTADismissed && (
+ <div className="mb-3 relative rounded-lg border border-primary/20 bg-primary/5 dark:bg-primary/10 p-3">
+ <button
+ onClick={() => setAiCTADismissed(true)}
+ className="absolute top-2 right-2 p-1 rounded-sm text-muted-foreground hover:text-foreground hover:bg-black/5 dark:hover:bg-white/5 transition-colors"
+ >
+ <X size={14} />
+ </button>
+ <div className="flex items-start gap-3 pr-6">
+ <div className="shrink-0 w-8 h-8 rounded-md bg-primary/10 dark:bg-primary/20 flex items-center justify-center">
+ <Sparkles size={16} className="text-primary" />
</div>
- ) : history.length === 0 ? (
- <div className="text-center py-12">
- <div className="w-16 h-16 mx-auto mb-4 bg-neutral-100 rounded-full flex items-center justify-center">
- <Mic className="w-8 h-8 text-neutral-400" />
- </div>
- <h3 className="text-lg font-medium text-neutral-900 mb-2">
- No transcriptions yet
- </h3>
- <p className="text-neutral-600 mb-4 max-w-sm mx-auto">
- Press your hotkey to start recording and create your first transcription.
+ <div className="flex-1 min-w-0">
+ <p className="text-[13px] font-medium text-foreground mb-0.5">
+ Enhance your transcriptions with AI
</p>
- <div className="bg-neutral-50 border border-neutral-200 rounded-lg p-4 max-w-md mx-auto">
- <h4 className="font-medium text-neutral-800 mb-2">Quick Start:</h4>
- <ol className="text-sm text-neutral-600 text-left space-y-1">
- <li>1. Click in any text field</li>
- <li>
- 2. Press{" "}
- <kbd className="bg-white px-2 py-1 rounded text-xs font-mono border border-neutral-300">
- {hotkey}
- </kbd>{" "}
- to start recording
- </li>
- <li>3. Speak your text</li>
- <li>
- 4. Press{" "}
- <kbd className="bg-white px-2 py-1 rounded text-xs font-mono border border-neutral-300">
- {hotkey}
- </kbd>{" "}
- again to stop
- </li>
- <li>5. Your text will appear automatically!</li>
- </ol>
- </div>
+ <p className="text-[12px] text-muted-foreground mb-2">
+ Automatically fix grammar, punctuation, and formatting as you speak.
+ </p>
+ <Button
+ variant="default"
+ size="sm"
+ className="h-7 text-[11px]"
+ onClick={() => {
+ setSettingsSection("aiModels");
+ setShowSettings(true);
+ }}
+ >
+ Enable AI Enhancement
+ </Button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Content area */}
+ <div className="rounded-lg border border-border bg-card/50 dark:bg-card/30 backdrop-blur-sm">
+ {isLoading ? (
+ <div className="flex items-center justify-center gap-2 py-8">
+ <Loader2 size={14} className="animate-spin text-primary" />
+ <span className="text-sm text-muted-foreground">Loading…</span>
+ </div>
+ ) : history.length === 0 ? (
+ <div className="flex flex-col items-center justify-center py-12 px-4">
+ <div className="w-10 h-10 rounded-md bg-muted/50 dark:bg-white/4 flex items-center justify-center mb-3">
+ <Mic size={18} className="text-muted-foreground" />
</div>
- ) : (
- <div className="space-y-3 max-h-80 overflow-y-auto">
- {history.map((item, index) => (
- <TranscriptionItem
- key={item.id}
- item={item}
- index={index}
- total={history.length}
- onCopy={copyToClipboard}
- onDelete={deleteTranscription}
- />
- ))}
+ <p className="text-sm text-muted-foreground mb-3">No transcriptions yet</p>
+ <div className="flex items-center gap-2 text-[12px] text-muted-foreground">
+ <span>Press</span>
+ <kbd className="inline-flex items-center h-5 px-1.5 rounded-sm bg-surface-1 dark:bg-white/6 border border-border text-[11px] font-mono font-medium">
+ {formatHotkeyLabel(hotkey)}
+ </kbd>
+ <span>to start</span>
</div>
- )}
- </CardContent>
- </Card>
+ </div>
+ ) : (
+ <div className="divide-y divide-border/50 max-h-[calc(100vh-180px)] overflow-y-auto">
+ {history.map((item, index) => (
+ <TranscriptionItem
+ key={item.id}
+ item={item}
+ index={index}
+ total={history.length}
+ onCopy={copyToClipboard}
+ onDelete={deleteTranscription}
+ />
+ ))}
+ </div>
+ )}
+ </div>
</div>
</div>
</div>
diff --git a/src/components/DeveloperSection.tsx b/src/components/DeveloperSection.tsx
index 7a0e37daa..e4ef42868 100644
--- a/src/components/DeveloperSection.tsx
+++ b/src/components/DeveloperSection.tsx
@@ -1,7 +1,8 @@
import { useState, useEffect } from "react";
import { Button } from "./ui/button";
-import { FolderOpen, Info, Wrench, Copy, Check, AlertCircle, FileText } from "lucide-react";
+import { FolderOpen, Copy, Check } from "lucide-react";
import { useToast } from "./ui/Toast";
+import { Toggle } from "./ui/toggle";
export default function DeveloperSection() {
const [debugEnabled, setDebugEnabled] = useState(false);
@@ -46,8 +47,6 @@ export default function DeveloperSection() {
}
setDebugEnabled(newState);
-
- // Reload the state to get updated log path
await loadDebugState();
toast({
@@ -106,193 +105,151 @@ export default function DeveloperSection() {
};
return (
- <div className="space-y-6">
- {/* Header */}
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">Troubleshooting</h3>
- <p className="text-sm text-gray-600">
- Enable debug logging to diagnose issues and share logs for support
+ <div className="space-y-8">
+ <div className="mb-5">
+ <h3 className="text-[15px] font-semibold text-foreground tracking-tight">Debug Logging</h3>
+ <p className="text-[12px] text-muted-foreground mt-1 leading-relaxed">
+ Capture detailed logs to help diagnose issues
</p>
</div>
- {/* Main Debug Logging Card */}
- <div className="space-y-4 p-6 bg-linear-to-br from-slate-50 via-slate-50 to-slate-100 border border-slate-200 rounded-xl shadow-sm">
- {/* Header with status */}
- <div className="flex items-center justify-between mb-3">
- <div className="flex items-center gap-3">
- <div className="p-2 bg-slate-800 rounded-lg">
- <Wrench className="w-5 h-5 text-slate-100" />
- </div>
- <div>
- <h4 className="font-semibold text-slate-900">Debug Logging</h4>
- <div className="flex items-center gap-2 mt-1">
+ {/* Debug Toggle */}
+ <div className="rounded-xl border border-border/60 dark:border-border-subtle bg-card dark:bg-surface-2 divide-y divide-border/40 dark:divide-border-subtle">
+ <div className="px-5 py-4">
+ <div className="flex items-center justify-between gap-6">
+ <div className="min-w-0 flex-1">
+ <div className="flex items-center gap-2">
+ <p className="text-[13px] font-medium text-foreground">Debug mode</p>
<div
- className={`w-2 h-2 rounded-full ${
- debugEnabled
- ? "bg-emerald-500 animate-pulse shadow-lg shadow-emerald-500/50"
- : "bg-slate-300"
+ className={`h-1.5 w-1.5 rounded-full transition-colors ${
+ debugEnabled ? "bg-success" : "bg-muted-foreground/30"
}`}
/>
- <span className="text-xs font-medium text-slate-600">
- {isLoading ? "Loading..." : debugEnabled ? "Active" : "Inactive"}
- </span>
</div>
+ <p className="text-[12px] text-muted-foreground mt-0.5 leading-relaxed">
+ {debugEnabled
+ ? "Logging audio processing, API requests, and system operations"
+ : "Enable to capture detailed diagnostic information"}
+ </p>
+ </div>
+ <div className="shrink-0">
+ <Toggle
+ checked={debugEnabled}
+ onChange={handleToggleDebug}
+ disabled={isLoading || isToggling}
+ />
</div>
</div>
</div>
- {/* Description */}
- <p className="text-sm text-slate-600 leading-relaxed">
- Captures detailed logs of audio processing, transcription, and system operations. Enable
- this when experiencing issues to help diagnose problems.
- </p>
-
- {/* Log Path Display - Only when active */}
+ {/* Log Path β€” only when active */}
{debugEnabled && logPath && (
- <div className="space-y-2">
- <label className="text-xs font-medium text-slate-600 uppercase tracking-wide">
- Current Log File
- </label>
- <div className="flex gap-2">
- <div className="flex-1 p-3 bg-slate-900 rounded-lg border border-slate-700 overflow-hidden">
- <code className="text-xs text-emerald-400 break-all leading-relaxed">
- {logPath}
- </code>
- </div>
+ <div className="px-5 py-4">
+ <p className="text-[11px] font-medium text-muted-foreground/60 uppercase tracking-wider mb-2">
+ Current log file
+ </p>
+ <div className="flex items-center gap-2">
+ <code className="flex-1 text-[11px] text-muted-foreground font-mono break-all leading-relaxed bg-muted/30 dark:bg-surface-raised/30 px-3 py-2 rounded-lg border border-border/30">
+ {logPath}
+ </code>
<Button
onClick={handleCopyPath}
- variant="outline"
- size="icon"
- className="h-12 w-12 border-slate-300 hover:bg-slate-100"
- title="Copy log path"
+ variant="ghost"
+ size="sm"
+ className="shrink-0 h-8 w-8 p-0"
>
{copiedPath ? (
- <Check className="h-4 w-4 text-emerald-600" />
+ <Check className="h-3.5 w-3.5 text-success" />
) : (
- <Copy className="h-4 w-4 text-slate-600" />
+ <Copy className="h-3.5 w-3.5 text-muted-foreground" />
)}
</Button>
</div>
</div>
)}
- {/* Action Buttons */}
- <div className="flex gap-3 pt-2">
- <Button
- onClick={handleToggleDebug}
- disabled={isLoading || isToggling}
- className={`flex-1 font-medium ${
- debugEnabled
- ? "bg-amber-600 hover:bg-amber-700 text-white shadow-md shadow-amber-600/20"
- : "bg-slate-800 hover:bg-slate-900 text-white shadow-md shadow-slate-800/20"
- }`}
- >
- {isToggling ? (
- <>
- <div className="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2" />
- {debugEnabled ? "Disabling..." : "Enabling..."}
- </>
- ) : (
- <>{debugEnabled ? "Disable Debug Mode" : "Enable Debug Mode"}</>
- )}
- </Button>
+ {/* Actions */}
+ {debugEnabled && (
+ <div className="px-5 py-4">
+ <Button onClick={handleOpenLogsFolder} variant="outline" size="sm" className="w-full">
+ <FolderOpen className="mr-2 h-3.5 w-3.5" />
+ Open Logs Folder
+ </Button>
+ </div>
+ )}
+ </div>
- <Button
- onClick={handleOpenLogsFolder}
- variant="outline"
- disabled={!debugEnabled || isLoading}
- className={`flex-1 font-medium ${
- debugEnabled
- ? "border-slate-300 hover:bg-slate-100 hover:border-slate-400"
- : "opacity-50 cursor-not-allowed"
- }`}
- >
- <FolderOpen className="mr-2 h-4 w-4" />
- Open Logs Folder
- </Button>
+ {/* What gets logged */}
+ <div>
+ <div className="mb-5">
+ <h3 className="text-[15px] font-semibold text-foreground tracking-tight">
+ What gets logged
+ </h3>
+ </div>
+ <div className="rounded-xl border border-border/60 dark:border-border-subtle bg-card dark:bg-surface-2">
+ <div className="px-5 py-4">
+ <div className="grid grid-cols-2 gap-x-6 gap-y-2">
+ {[
+ "Audio processing",
+ "API requests",
+ "FFmpeg operations",
+ "System diagnostics",
+ "Transcription pipeline",
+ "Error details",
+ ].map((item) => (
+ <div key={item} className="flex items-center gap-2">
+ <div className="h-1 w-1 rounded-full bg-muted-foreground/30 shrink-0" />
+ <span className="text-[12px] text-muted-foreground">{item}</span>
+ </div>
+ ))}
+ </div>
+ </div>
</div>
</div>
- {/* Sharing Instructions - Only when enabled */}
+ {/* Performance note β€” conditional */}
{debugEnabled && (
- <div className="p-5 bg-linear-to-br from-indigo-50 to-blue-50 border border-indigo-200 rounded-xl">
- <div className="flex items-start gap-3">
- <div className="p-2 bg-indigo-600 rounded-lg mt-0.5">
- <FileText className="w-4 h-4 text-white" />
- </div>
- <div className="flex-1">
- <h4 className="font-semibold text-indigo-900 mb-2">How to Share Logs for Support</h4>
- <div className="text-sm text-indigo-800 space-y-2">
- <p>To help us diagnose your issue:</p>
- <ol className="space-y-1 ml-4 list-decimal">
- <li>Reproduce the issue while debug mode is enabled</li>
- <li>Click "Open Logs Folder" above</li>
- <li>Find the most recent log file (sorted by date)</li>
- <li>Attach the log file to your bug report or support email</li>
- </ol>
- <p className="text-xs text-indigo-700 mt-3 pt-3 border-t border-indigo-200">
- Your logs don't contain API keys or sensitive data
- </p>
- </div>
- </div>
+ <div className="rounded-xl border border-warning/20 bg-warning/5 dark:bg-warning/10">
+ <div className="px-5 py-4">
+ <p className="text-[12px] text-muted-foreground leading-relaxed">
+ <span className="font-medium text-warning">Note</span> β€” Debug logging writes to disk
+ continuously and may slightly affect performance. Disable when not troubleshooting.
+ </p>
</div>
</div>
)}
- {/* Information Cards */}
- <div className="grid grid-cols-1 gap-4">
- {/* What Gets Logged */}
- <div className="p-4 bg-blue-50 border border-blue-200 rounded-lg">
- <div className="flex items-start gap-3">
- <Info className="w-5 h-5 text-blue-600 mt-0.5 flex-shrink-0" />
- <div className="flex-1 min-w-0">
- <h4 className="font-medium text-blue-900 mb-2">What Gets Logged</h4>
- <div className="grid grid-cols-2 gap-x-4 gap-y-1 text-sm text-blue-800">
- <div className="flex items-center gap-2">
- <div className="w-1 h-1 rounded-full bg-blue-600" />
- <span>Audio processing</span>
- </div>
- <div className="flex items-center gap-2">
- <div className="w-1 h-1 rounded-full bg-blue-600" />
- <span>API requests</span>
- </div>
- <div className="flex items-center gap-2">
- <div className="w-1 h-1 rounded-full bg-blue-600" />
- <span>FFmpeg operations</span>
- </div>
- <div className="flex items-center gap-2">
- <div className="w-1 h-1 rounded-full bg-blue-600" />
- <span>System diagnostics</span>
- </div>
- <div className="flex items-center gap-2">
- <div className="w-1 h-1 rounded-full bg-blue-600" />
- <span>Transcription pipeline</span>
- </div>
- <div className="flex items-center gap-2">
- <div className="w-1 h-1 rounded-full bg-blue-600" />
- <span>Error details</span>
- </div>
- </div>
- </div>
+ {/* Sharing instructions β€” conditional */}
+ {debugEnabled && (
+ <div>
+ <div className="mb-5">
+ <h3 className="text-[15px] font-semibold text-foreground tracking-tight">
+ Sharing logs for support
+ </h3>
</div>
- </div>
-
- {/* Performance Note */}
- {debugEnabled && (
- <div className="p-4 bg-amber-50 border border-amber-200 rounded-lg">
- <div className="flex items-start gap-3">
- <AlertCircle className="w-5 h-5 text-amber-600 mt-0.5 flex-shrink-0" />
- <div className="flex-1">
- <h4 className="font-medium text-amber-900 mb-1">Performance Note</h4>
- <p className="text-sm text-amber-800">
- Debug logging writes detailed information to disk and may have a minor impact on
- app performance. Disable it when not troubleshooting.
- </p>
+ <div className="rounded-xl border border-border/60 dark:border-border-subtle bg-card dark:bg-surface-2">
+ <div className="px-5 py-4">
+ <div className="space-y-2">
+ {[
+ "Reproduce the issue while debug mode is enabled",
+ 'Click "Open Logs Folder" above',
+ "Attach the most recent log file to your bug report",
+ ].map((step, i) => (
+ <div key={i} className="flex items-start gap-3">
+ <span className="shrink-0 text-[11px] font-mono text-muted-foreground/40 mt-0.5 w-4 text-right">
+ {i + 1}
+ </span>
+ <p className="text-[12px] text-muted-foreground leading-relaxed">{step}</p>
+ </div>
+ ))}
</div>
+ <p className="text-[11px] text-muted-foreground/40 mt-4 pt-3 border-t border-border/20">
+ Logs do not contain API keys or sensitive data
+ </p>
</div>
</div>
- )}
- </div>
+ </div>
+ )}
</div>
);
}
diff --git a/src/components/LocalModelPicker.tsx b/src/components/LocalModelPicker.tsx
index 21361086b..700f7b14f 100644
--- a/src/components/LocalModelPicker.tsx
+++ b/src/components/LocalModelPicker.tsx
@@ -1,13 +1,12 @@
import { useState, useEffect, useCallback, useMemo } from "react";
-import { Button } from "./ui/button";
-import { Download, Trash2, Check, X } from "lucide-react";
-import { ProviderIcon } from "./ui/ProviderIcon";
import { ProviderTabs } from "./ui/ProviderTabs";
import { DownloadProgressBar } from "./ui/DownloadProgressBar";
import { ConfirmDialog } from "./ui/dialog";
+import ModelCardList, { type ModelCardOption } from "./ui/ModelCardList";
import { useDialogs } from "../hooks/useDialogs";
import { useModelDownload, type ModelType } from "../hooks/useModelDownload";
import { MODEL_PICKER_COLORS, type ColorScheme } from "../utils/modelPickerStyles";
+import { getProviderIcon, isMonochromeProvider } from "../utils/providerIcons";
export interface LocalModel {
id: string;
@@ -141,10 +140,8 @@ export default function LocalModelPicker({
const modelName = models.find((m) => m.id === downloadingModel)?.name || downloadingModel;
- return (
- <DownloadProgressBar modelName={modelName} progress={downloadProgress} styles={styles} />
- );
- }, [downloadingModel, downloadProgress, models, styles]);
+ return <DownloadProgressBar modelName={modelName} progress={downloadProgress} />;
+ }, [downloadingModel, downloadProgress, models]);
return (
<div className={`${styles.container} ${className}`}>
@@ -161,96 +158,28 @@ export default function LocalModelPicker({
<div className="p-4">
<h5 className={`${styles.header} mb-3`}>Available Models</h5>
- <div className="space-y-2">
- {models.length === 0 ? (
- <p className="text-sm text-gray-500">No models available for this provider</p>
- ) : (
- models.map((model) => {
- const isSelected = model.id === selectedModel;
- const isDownloading = isDownloadingModel(model.id);
- const isDownloaded =
- downloadedModels.has(model.id) || model.isDownloaded || model.downloaded;
-
- return (
- <div
- key={model.id}
- className={`p-3 rounded-lg border-2 transition-all ${
- isSelected ? styles.modelCard.selected : styles.modelCard.default
- }`}
- >
- <div className="flex items-center justify-between">
- <div className="flex-1">
- <div className="flex items-center gap-2">
- <ProviderIcon provider={selectedProvider} className="w-4 h-4" />
- <span className="font-medium text-gray-900">{model.name}</span>
- {isSelected && <span className={styles.badges.selected}>βœ“ Selected</span>}
- {model.recommended && (
- <span className={styles.badges.recommended}>Recommended</span>
- )}
- </div>
- <div className="text-xs text-gray-600 mt-1">{model.description}</div>
- <div className="flex items-center gap-2 mt-1">
- <span className="text-xs text-gray-500">Size: {model.size}</span>
- {isDownloaded && (
- <span className={styles.badges.downloaded}>
- <Check className="inline w-3 h-3 mr-1" />
- Downloaded
- </span>
- )}
- </div>
- </div>
-
- <div className="flex gap-2">
- {isDownloaded ? (
- <>
- {!isSelected && (
- <Button
- onClick={() => onModelSelect(model.id)}
- size="sm"
- variant="outline"
- className={styles.buttons.select}
- >
- Select
- </Button>
- )}
- <Button
- onClick={() => handleDelete(model.id)}
- size="sm"
- variant="outline"
- className={styles.buttons.delete}
- >
- <Trash2 size={14} />
- <span className="ml-1">Delete</span>
- </Button>
- </>
- ) : isDownloading ? (
- <Button
- onClick={cancelDownload}
- disabled={isCancelling}
- size="sm"
- variant="outline"
- className="text-red-600 border-red-300 hover:bg-red-50"
- >
- <X size={14} />
- <span className="ml-1">{isCancelling ? "..." : "Cancel"}</span>
- </Button>
- ) : (
- <Button
- onClick={() => handleDownload(model.id)}
- size="sm"
- className={styles.buttons.download}
- >
- <Download size={14} />
- <span className="ml-1">Download</span>
- </Button>
- )}
- </div>
- </div>
- </div>
- );
+ <ModelCardList
+ models={models.map(
+ (model): ModelCardOption => ({
+ value: model.id,
+ label: model.name,
+ description: model.size,
+ icon: getProviderIcon(selectedProvider),
+ invertInDark: isMonochromeProvider(selectedProvider),
+ recommended: model.recommended,
+ isDownloaded:
+ downloadedModels.has(model.id) || model.isDownloaded || model.downloaded,
+ isDownloading: isDownloadingModel(model.id),
})
)}
- </div>
+ selectedModel={selectedModel}
+ onModelSelect={onModelSelect}
+ onDownload={handleDownload}
+ onDelete={handleDelete}
+ onCancelDownload={cancelDownload}
+ isCancelling={isCancelling}
+ colorScheme={colorScheme}
+ />
</div>
<ConfirmDialog
diff --git a/src/components/LocalWhisperPicker.tsx b/src/components/LocalWhisperPicker.tsx
index f9dc57826..2608e8e1f 100644
--- a/src/components/LocalWhisperPicker.tsx
+++ b/src/components/LocalWhisperPicker.tsx
@@ -1,13 +1,12 @@
import { useState, useEffect, useCallback, useMemo, useRef } from "react";
-import { Button } from "./ui/button";
-import { Download, Trash2, Check, X } from "lucide-react";
-import { ProviderIcon } from "./ui/ProviderIcon";
import { DownloadProgressBar } from "./ui/DownloadProgressBar";
import { ConfirmDialog } from "./ui/dialog";
+import ModelCardList, { type ModelCardOption } from "./ui/ModelCardList";
import { useDialogs } from "../hooks/useDialogs";
import { useModelDownload } from "../hooks/useModelDownload";
import { WHISPER_MODEL_INFO } from "../models/ModelRegistry";
import { MODEL_PICKER_COLORS, type ColorScheme } from "../utils/modelPickerStyles";
+import { getProviderIcon } from "../utils/providerIcons";
interface WhisperModel {
model: string;
@@ -104,6 +103,13 @@ export default function LocalWhisperPicker({
downloadingModelRef.current = downloadingModel;
}, [downloadingModel]);
+ const handleDownload = useCallback(
+ (modelId: string) => {
+ downloadModel(modelId, onModelSelect);
+ },
+ [downloadModel, onModelSelect]
+ );
+
const handleDelete = useCallback(
(modelId: string) => {
showConfirmDialog({
@@ -132,10 +138,11 @@ export default function LocalWhisperPicker({
<DownloadProgressBar
modelName={modelInfo?.name || downloadingModel}
progress={downloadProgress}
- styles={styles}
/>
);
- }, [downloadingModel, downloadProgress, styles]);
+ }, [downloadingModel, downloadProgress]);
+
+ const whisperIcon = getProviderIcon("whisper");
return (
<div className={`${styles.container} ${className}`}>
@@ -144,99 +151,33 @@ export default function LocalWhisperPicker({
<div className="p-4">
<h5 className={`${styles.header} mb-3`}>Whisper Models</h5>
- <div className="space-y-2">
- {models.map((model) => {
+ <ModelCardList
+ models={models.map((model): ModelCardOption => {
const modelId = model.model;
const info = WHISPER_MODEL_INFO[modelId] || {
name: modelId,
description: "Model",
size: "Unknown",
};
- const isSelected = modelId === selectedModel;
- const isDownloading = isDownloadingModel(modelId);
- const isDownloaded = model.downloaded;
-
- return (
- <div
- key={modelId}
- className={`p-3 rounded-lg border-2 transition-all ${
- isSelected ? styles.modelCard.selected : styles.modelCard.default
- }`}
- >
- <div className="flex items-center justify-between">
- <div className="flex-1">
- <div className="flex items-center gap-2">
- <ProviderIcon provider="whisper" className="w-4 h-4" />
- <span className="font-medium text-gray-900">{info.name}</span>
- {isSelected && <span className={styles.badges.selected}>βœ“ Selected</span>}
- {info.recommended && (
- <span className={styles.badges.recommended}>Recommended</span>
- )}
- </div>
- <div className="flex items-center gap-2 mt-1">
- <span className="text-xs text-gray-600">{info.description}</span>
- <span className="text-xs text-gray-500">
- β€’ {model.size_mb ? `${model.size_mb}MB` : info.size}
- </span>
- {isDownloaded && (
- <span className={styles.badges.downloaded}>
- <Check className="inline w-3 h-3 mr-1" />
- Downloaded
- </span>
- )}
- </div>
- </div>
-
- <div className="flex gap-2">
- {isDownloaded ? (
- <>
- {!isSelected && (
- <Button
- onClick={() => onModelSelect(modelId)}
- size="sm"
- variant="outline"
- className={styles.buttons.select}
- >
- Select
- </Button>
- )}
- <Button
- onClick={() => handleDelete(modelId)}
- size="sm"
- variant="outline"
- className={styles.buttons.delete}
- >
- <Trash2 size={14} />
- <span className="ml-1">Delete</span>
- </Button>
- </>
- ) : isDownloading ? (
- <Button
- onClick={cancelDownload}
- disabled={isCancelling}
- size="sm"
- variant="outline"
- className="text-red-600 border-red-300 hover:bg-red-50"
- >
- <X size={14} />
- <span className="ml-1">{isCancelling ? "..." : "Cancel"}</span>
- </Button>
- ) : (
- <Button
- onClick={() => downloadModel(modelId, onModelSelect)}
- size="sm"
- className={styles.buttons.download}
- >
- <Download size={14} />
- <span className="ml-1">Download</span>
- </Button>
- )}
- </div>
- </div>
- </div>
- );
+ return {
+ value: modelId,
+ label: info.name,
+ description: model.size_mb ? `${model.size_mb}MB` : info.size,
+ icon: whisperIcon,
+ invertInDark: true,
+ recommended: info.recommended,
+ isDownloaded: model.downloaded,
+ isDownloading: isDownloadingModel(modelId),
+ };
})}
- </div>
+ selectedModel={selectedModel}
+ onModelSelect={onModelSelect}
+ onDownload={handleDownload}
+ onDelete={handleDelete}
+ onCancelDownload={cancelDownload}
+ isCancelling={isCancelling}
+ colorScheme={colorScheme}
+ />
</div>
<ConfirmDialog
diff --git a/src/components/OnboardingFlow.tsx b/src/components/OnboardingFlow.tsx
index 86320373c..a1879c4d1 100644
--- a/src/components/OnboardingFlow.tsx
+++ b/src/components/OnboardingFlow.tsx
@@ -1,7 +1,6 @@
import React, { useState, useEffect, useCallback, useRef } from "react";
import { Card, CardContent } from "./ui/card";
import { Button } from "./ui/button";
-import { Input } from "./ui/input";
import { Textarea } from "./ui/textarea";
import {
ChevronRight,
@@ -12,11 +11,9 @@ import {
Shield,
Command,
Sparkles,
- User,
} from "lucide-react";
import TitleBar from "./TitleBar";
import TranscriptionModelPicker from "./TranscriptionModelPicker";
-import ProcessingModeSelector from "./ui/ProcessingModeSelector";
import PermissionCard from "./ui/PermissionCard";
import MicPermissionWarning from "./ui/MicPermissionWarning";
import PasteToolsInfo from "./ui/PasteToolsInfo";
@@ -27,8 +24,7 @@ import { useDialogs } from "../hooks/useDialogs";
import { usePermissions } from "../hooks/usePermissions";
import { useClipboard } from "../hooks/useClipboard";
import { useSettings } from "../hooks/useSettings";
-import LanguageSelector from "./ui/LanguageSelector";
-import { setAgentName as saveAgentName } from "../utils/agentName";
+import { setAgentNameIfEmpty as saveAgentName } from "../utils/agentName";
import { formatHotkeyLabel, getDefaultHotkey } from "../utils/hotkeys";
import { HotkeyInput } from "./ui/HotkeyInput";
import { useHotkeyRegistration } from "../hooks/useHotkeyRegistration";
@@ -39,8 +35,8 @@ interface OnboardingFlowProps {
}
export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
- // Max valid step index for the current onboarding flow (5 steps, index 0-4)
- const MAX_STEP = 4;
+ // Max valid step index for the current onboarding flow (4 steps, index 0-3)
+ const MAX_STEP = 3;
const [currentStep, setCurrentStep, removeCurrentStep] = useLocalStorage(
"onboardingCurrentStep",
@@ -61,7 +57,8 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
const {
useLocalWhisper,
whisperModel,
- preferredLanguage,
+ localTranscriptionProvider,
+ parakeetModel,
cloudTranscriptionProvider,
cloudTranscriptionModel,
cloudTranscriptionBaseUrl,
@@ -72,7 +69,6 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
dictationKey,
activationMode,
setActivationMode,
- setWhisperModel,
setDictationKey,
setOpenaiApiKey,
setGroqApiKey,
@@ -80,19 +76,16 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
} = useSettings();
const [hotkey, setHotkey] = useState(dictationKey || getDefaultHotkey());
- const [agentName, setAgentName] = useState("Agent");
+ const agentName = "OpenWhispr"; // Default agent name, editable in settings
const [isModelDownloaded, setIsModelDownloaded] = useState(false);
const [isUsingGnomeHotkeys, setIsUsingGnomeHotkeys] = useState(false);
const readableHotkey = formatHotkeyLabel(hotkey);
const { alertDialog, confirmDialog, showAlertDialog, hideAlertDialog, hideConfirmDialog } =
useDialogs();
- const practiceTextareaRef = useRef<HTMLInputElement>(null);
- // Ref to prevent React.StrictMode double-invocation of auto-registration
const autoRegisterInFlightRef = useRef(false);
const hotkeyStepInitializedRef = useRef(false);
- // Shared hotkey registration hook
const { registerHotkey, isRegistering: isHotkeyRegistering } = useHotkeyRegistration({
onSuccess: (registeredHotkey) => {
setHotkey(registeredHotkey);
@@ -109,8 +102,7 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
{ title: "Welcome", icon: Sparkles },
{ title: "Setup", icon: Settings },
{ title: "Permissions", icon: Shield },
- { title: "Hotkey & Test", icon: Command },
- { title: "Agent Name", icon: User },
+ { title: "Activation", icon: Command },
];
useEffect(() => {
@@ -128,16 +120,19 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
checkHotkeyMode();
}, [setActivationMode]);
- // Check if selected whisper model is downloaded
useEffect(() => {
- if (!useLocalWhisper || !whisperModel) {
+ const modelToCheck = localTranscriptionProvider === "nvidia" ? parakeetModel : whisperModel;
+ if (!useLocalWhisper || !modelToCheck) {
setIsModelDownloaded(false);
return;
}
- const checkModelStatus = async () => {
+ const checkStatus = async () => {
try {
- const result = await window.electronAPI?.checkModelStatus(whisperModel);
+ const result =
+ localTranscriptionProvider === "nvidia"
+ ? await window.electronAPI?.checkParakeetModelStatus(modelToCheck)
+ : await window.electronAPI?.checkModelStatus(modelToCheck);
setIsModelDownloaded(result?.downloaded ?? false);
} catch (error) {
console.error("Failed to check model status:", error);
@@ -145,16 +140,8 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
}
};
- checkModelStatus();
- }, [useLocalWhisper, whisperModel]);
-
- useEffect(() => {
- if (currentStep === 4) {
- if (practiceTextareaRef.current) {
- practiceTextareaRef.current.focus();
- }
- }
- }, [currentStep]);
+ checkStatus();
+ }, [useLocalWhisper, whisperModel, parakeetModel, localTranscriptionProvider]);
// Auto-register default hotkey when entering the hotkey step (step 3)
useEffect(() => {
@@ -260,7 +247,6 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
const newStep = currentStep + 1;
setCurrentStep(newStep);
- // Show dictation panel when moving from permissions step (2) to hotkey & test step (3)
if (currentStep === 2 && newStep === 3) {
if (window.electronAPI?.showDictationPanel) {
window.electronAPI.showDictationPanel();
@@ -280,7 +266,6 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
if (!saved) {
return;
}
- // Clear the onboarding step since we're done
removeCurrentStep();
onComplete();
}, [saveSettings, removeCurrentStep, onComplete]);
@@ -289,49 +274,65 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
switch (currentStep) {
case 0: // Welcome
return (
- <div className="text-center space-y-6">
- <div className="w-16 h-16 mx-auto bg-blue-100 rounded-full flex items-center justify-center">
- <Sparkles className="w-8 h-8 text-blue-600" />
+ <div className="text-center space-y-5">
+ {/* App logo */}
+ <div className="relative w-16 h-16 mx-auto">
+ <div className="absolute inset-0 bg-primary/30 rounded-2xl blur-xl" />
+ <img
+ src="./assets/icon.png"
+ alt="OpenWhispr"
+ className="relative w-16 h-16 rounded-2xl shadow-lg"
+ />
</div>
- <div>
- <h2 className="text-2xl font-bold text-stone-900 mb-2">Welcome to OpenWhispr</h2>
- <p className="text-stone-600">
- Let's set up your voice dictation in just a few simple steps.
+
+ {/* Title */}
+ <div className="space-y-1">
+ <h2 className="text-xl font-semibold text-foreground tracking-tight">
+ Welcome to OpenWhispr
+ </h2>
+ <p className="text-sm text-muted-foreground">
+ Professional voice-to-text for your computer
</p>
</div>
- <div className="bg-blue-50/50 p-4 rounded-lg border border-blue-200/60">
- <p className="text-sm text-blue-800">
- 🎀 Turn your voice into text instantly
- <br />
- ⚑ Works anywhere on your computer
- <br />
- πŸ”’ Your privacy is protected
- </p>
+
+ {/* Feature grid - compact and refined */}
+ <div className="grid grid-cols-3 gap-2">
+ <div className="flex flex-col items-center gap-1.5 p-3 rounded-xl bg-white/5 dark:bg-white/3 border border-white/10 dark:border-white/5">
+ <div className="w-8 h-8 rounded-lg bg-primary/15 flex items-center justify-center">
+ <Mic className="w-4 h-4 text-primary" />
+ </div>
+ <span className="text-xs font-medium text-foreground">Voice to Text</span>
+ <span className="text-[10px] text-muted-foreground">Instant</span>
+ </div>
+ <div className="flex flex-col items-center gap-1.5 p-3 rounded-xl bg-white/5 dark:bg-white/3 border border-white/10 dark:border-white/5">
+ <div className="w-8 h-8 rounded-lg bg-primary/15 flex items-center justify-center">
+ <Command className="w-4 h-4 text-primary" />
+ </div>
+ <span className="text-xs font-medium text-foreground">Works Anywhere</span>
+ <span className="text-[10px] text-muted-foreground">Any app</span>
+ </div>
+ <div className="flex flex-col items-center gap-1.5 p-3 rounded-xl bg-white/5 dark:bg-white/3 border border-white/10 dark:border-white/5">
+ <div className="w-8 h-8 rounded-lg bg-primary/15 flex items-center justify-center">
+ <Shield className="w-4 h-4 text-primary" />
+ </div>
+ <span className="text-xs font-medium text-foreground">Private</span>
+ <span className="text-[10px] text-muted-foreground">Your choice</span>
+ </div>
</div>
</div>
);
case 1: // Setup - Choose Mode & Configure
return (
- <div className="space-y-6">
- <div className="text-center">
- <h2 className="text-2xl font-bold text-gray-900 mb-2">Setup Your Transcription</h2>
- <p className="text-gray-600">
- Choose between local (private) or cloud (faster) processing
- </p>
- </div>
-
- {/* Mode Selector */}
- <div className="space-y-4">
- <ProcessingModeSelector
- useLocalWhisper={useLocalWhisper}
- setUseLocalWhisper={(useLocal) =>
- updateTranscriptionSettings({ useLocalWhisper: useLocal })
- }
- />
+ <div className="space-y-3">
+ <div className="text-center space-y-0.5">
+ <h2 className="text-lg font-semibold text-foreground tracking-tight">
+ Transcription Setup
+ </h2>
+ <p className="text-xs text-muted-foreground">Choose your mode and provider</p>
</div>
- {/* Configuration for selected mode */}
+ {/* Unified configuration with integrated mode toggle */}
<TranscriptionModelPicker
selectedCloudProvider={cloudTranscriptionProvider}
onCloudProviderSelect={(provider) =>
@@ -341,10 +342,24 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
onCloudModelSelect={(model) =>
updateTranscriptionSettings({ cloudTranscriptionModel: model })
}
- selectedLocalModel={whisperModel}
- onLocalModelSelect={setWhisperModel}
+ selectedLocalModel={
+ localTranscriptionProvider === "nvidia" ? parakeetModel : whisperModel
+ }
+ onLocalModelSelect={(modelId) => {
+ if (localTranscriptionProvider === "nvidia") {
+ updateTranscriptionSettings({ parakeetModel: modelId });
+ } else {
+ updateTranscriptionSettings({ whisperModel: modelId });
+ }
+ }}
+ selectedLocalProvider={localTranscriptionProvider}
+ onLocalProviderSelect={(provider) =>
+ updateTranscriptionSettings({
+ localTranscriptionProvider: provider as "whisper" | "nvidia",
+ })
+ }
useLocalWhisper={useLocalWhisper}
- onModeChange={() => {}}
+ onModeChange={(isLocal) => updateTranscriptionSettings({ useLocalWhisper: isLocal })}
openaiApiKey={openaiApiKey}
setOpenaiApiKey={setOpenaiApiKey}
groqApiKey={groqApiKey}
@@ -357,26 +372,6 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
}
variant="onboarding"
/>
-
- {/* Language Selection - shown for both modes */}
- <div className="space-y-4 p-4 bg-gray-50 border border-gray-200 rounded-xl">
- <h4 className="font-medium text-gray-900 mb-3">🌍 Preferred Language</h4>
- <label className="block text-sm font-medium text-gray-700 mb-2">
- Which language do you primarily speak?
- </label>
- <LanguageSelector
- value={preferredLanguage}
- onChange={(value) => {
- updateTranscriptionSettings({ preferredLanguage: value });
- }}
- className="w-full"
- />
- <p className="text-xs text-gray-600 mt-1">
- {useLocalWhisper
- ? "Helps Whisper better understand your speech"
- : "Improves transcription speed and accuracy. AI text enhancement is enabled by default."}
- </p>
- </div>
</div>
);
@@ -385,160 +380,131 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
const isMacOS = platform === "darwin";
return (
- <div className="space-y-6">
+ <div className="space-y-4">
+ {/* Header - compact */}
<div className="text-center">
- <h2 className="text-2xl font-bold text-gray-900 mb-2">Grant Permissions</h2>
- <p className="text-gray-600">
- {isMacOS
- ? "OpenWhispr needs a couple of permissions to work properly"
- : "OpenWhispr needs microphone access to record your voice"}
+ <h2 className="text-lg font-semibold text-foreground tracking-tight">Permissions</h2>
+ <p className="text-xs text-muted-foreground mt-0.5">
+ {isMacOS ? "Required for OpenWhispr to work" : "Microphone access required"}
</p>
</div>
- <div className="space-y-4">
+ {/* Permission cards - tight stack */}
+ <div className="space-y-1.5">
<PermissionCard
icon={Mic}
- title="Microphone Access"
- description="Required to record your voice"
+ title="Microphone"
+ description="To capture your voice"
granted={permissionsHook.micPermissionGranted}
onRequest={permissionsHook.requestMicPermission}
- buttonText="Grant Access"
+ buttonText="Grant"
/>
- {!permissionsHook.micPermissionGranted && (
- <MicPermissionWarning
- error={permissionsHook.micPermissionError}
- onOpenSoundSettings={permissionsHook.openSoundInputSettings}
- onOpenPrivacySettings={permissionsHook.openMicPrivacySettings}
- />
- )}
-
{isMacOS && (
<PermissionCard
icon={Shield}
- title="Accessibility Permission"
- description="Required to paste text automatically"
+ title="Accessibility"
+ description="To paste text into apps"
granted={permissionsHook.accessibilityPermissionGranted}
onRequest={permissionsHook.testAccessibilityPermission}
buttonText="Test & Grant"
onOpenSettings={permissionsHook.openAccessibilitySettings}
/>
)}
-
- {/* Only show PasteToolsInfo on Linux when tools are NOT available (to show install instructions) */}
- {platform === "linux" &&
- permissionsHook.pasteToolsInfo &&
- !permissionsHook.pasteToolsInfo.available && (
- <PasteToolsInfo
- pasteToolsInfo={permissionsHook.pasteToolsInfo}
- isChecking={permissionsHook.isCheckingPasteTools}
- onCheck={permissionsHook.checkPasteToolsAvailability}
- />
- )}
</div>
- <div className="bg-amber-50 p-4 rounded-lg">
- <h4 className="font-medium text-amber-900 mb-2">πŸ”’ Privacy Note</h4>
- <p className="text-sm text-amber-800">
- OpenWhispr only uses these permissions for dictation.
- {useLocalWhisper
- ? " With local processing, your voice never leaves your device."
- : " Your voice is sent to OpenAI's servers for transcription."}
- </p>
- </div>
- </div>
- );
-
- case 3: // Hotkey & Test (combined)
- return (
- <div className="space-y-6">
- <div className="text-center">
- <h2 className="text-2xl font-bold text-gray-900 mb-2">Set Your Hotkey & Test</h2>
- <p className="text-gray-600">Choose your hotkey and activation style</p>
- </div>
-
- <HotkeyInput
- value={hotkey}
- onChange={async (newHotkey) => {
- const success = await registerHotkey(newHotkey);
- if (success) {
- setHotkey(newHotkey);
- }
- }}
- disabled={isHotkeyRegistering}
- />
-
- {!isUsingGnomeHotkeys && (
- <div className="pt-2">
- <label className="block text-sm font-medium text-gray-700 mb-3">
- Activation Mode
- </label>
- <ActivationModeSelector value={activationMode} onChange={setActivationMode} />
- </div>
+ {/* Error state - only show when there's actually an issue */}
+ {!permissionsHook.micPermissionGranted && permissionsHook.micPermissionError && (
+ <MicPermissionWarning
+ error={permissionsHook.micPermissionError}
+ onOpenSoundSettings={permissionsHook.openSoundInputSettings}
+ onOpenPrivacySettings={permissionsHook.openMicPrivacySettings}
+ />
)}
- <div className="bg-blue-50/50 p-5 rounded-lg border border-blue-200/60">
- <h3 className="font-semibold text-blue-900 mb-3">Try It Now</h3>
- <p className="text-sm text-blue-800 mb-3">
- {activationMode === "tap" || isUsingGnomeHotkeys ? (
- <>
- Click in the text area, press{" "}
- <kbd className="bg-white px-2 py-1 rounded text-xs font-mono border border-blue-200">
- {readableHotkey}
- </kbd>{" "}
- to start recording, speak, then press it again to stop.
- </>
- ) : (
- <>
- Click in the text area, hold{" "}
- <kbd className="bg-white px-2 py-1 rounded text-xs font-mono border border-blue-200">
- {readableHotkey}
- </kbd>{" "}
- while speaking, then release to process.
- </>
- )}
- </p>
-
- <div>
- <label className="block text-sm font-medium text-stone-700 mb-2">
- Test your dictation:
- </label>
- <Textarea rows={3} placeholder="Click here, then use your hotkey to dictate..." />
- </div>
- </div>
+ {/* Linux paste tools - only when needed */}
+ {platform === "linux" &&
+ permissionsHook.pasteToolsInfo &&
+ !permissionsHook.pasteToolsInfo.available && (
+ <PasteToolsInfo
+ pasteToolsInfo={permissionsHook.pasteToolsInfo}
+ isChecking={permissionsHook.isCheckingPasteTools}
+ onCheck={permissionsHook.checkPasteToolsAvailability}
+ />
+ )}
</div>
);
- case 4: // Agent Name (final step)
+ case 3: // Hotkey & Activation Mode
return (
- <div className="space-y-6">
- <div className="text-center">
- <h2 className="text-2xl font-bold text-stone-900 mb-2">Name Your Agent</h2>
- <p className="text-stone-600">
- Give your agent a name so you can address it specifically when giving instructions.
- </p>
+ <div className="space-y-4">
+ {/* Header */}
+ <div className="text-center space-y-0.5">
+ <h2 className="text-lg font-semibold text-foreground tracking-tight">
+ Activation Setup
+ </h2>
+ <p className="text-xs text-muted-foreground">Configure how you trigger dictation</p>
</div>
- <div className="space-y-4 p-4 bg-gradient-to-r from-purple-50 to-blue-50 border border-purple-200 rounded-xl">
- <h4 className="font-medium text-purple-900 mb-3">How this helps:</h4>
- <ul className="text-sm text-purple-800 space-y-1">
- <li>
- β€’ Say "Hey {agentName || "Agent"}, write a formal email" for specific instructions
- </li>
- <li>β€’ Use the name to distinguish between dictation and commands</li>
- <li>β€’ Makes interactions feel more natural and personal</li>
- </ul>
+ {/* Unified control surface */}
+ <div className="rounded-lg border border-border-subtle bg-surface-1 overflow-hidden">
+ {/* Hotkey section */}
+ <div className="p-4 border-b border-border-subtle">
+ <div className="flex items-center justify-between mb-3">
+ <span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
+ Hotkey
+ </span>
+ </div>
+ <HotkeyInput
+ value={hotkey}
+ onChange={async (newHotkey) => {
+ const success = await registerHotkey(newHotkey);
+ if (success) {
+ setHotkey(newHotkey);
+ }
+ }}
+ disabled={isHotkeyRegistering}
+ variant="hero"
+ />
+ </div>
+
+ {/* Mode section - inline with hotkey */}
+ {!isUsingGnomeHotkeys && (
+ <div className="p-4 flex items-center justify-between gap-4">
+ <div className="flex-1 min-w-0">
+ <span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
+ Mode
+ </span>
+ <p className="text-[11px] text-muted-foreground/70 mt-0.5">
+ {activationMode === "tap" ? "Press to start/stop" : "Hold while speaking"}
+ </p>
+ </div>
+ <ActivationModeSelector
+ value={activationMode}
+ onChange={setActivationMode}
+ variant="compact"
+ />
+ </div>
+ )}
</div>
- <div className="space-y-4">
- <label className="block text-sm font-medium text-gray-700 mb-2">Agent Name</label>
- <Input
- placeholder="e.g., Assistant, Jarvis, Alex..."
- value={agentName}
- onChange={(e) => setAgentName(e.target.value)}
- className="text-center text-lg font-mono"
+ {/* Test area - minimal chrome */}
+ <div className="space-y-2">
+ <div className="flex items-center gap-2">
+ <span className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
+ Test
+ </span>
+ <span className="text-[10px] text-muted-foreground/60">
+ {activationMode === "tap" || isUsingGnomeHotkeys
+ ? `${readableHotkey} to start/stop`
+ : `Hold ${readableHotkey}`}
+ </span>
+ </div>
+ <Textarea
+ rows={2}
+ placeholder="Click here and use your hotkey to dictate..."
+ className="text-sm resize-none"
/>
- <p className="text-xs text-gray-500 mt-2">You can change this anytime in settings</p>
</div>
</div>
);
@@ -555,7 +521,9 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
case 1:
// Setup - check if configuration is complete
if (useLocalWhisper) {
- return whisperModel !== "" && isModelDownloaded;
+ const modelToCheck =
+ localTranscriptionProvider === "nvidia" ? parakeetModel : whisperModel;
+ return modelToCheck !== "" && isModelDownloaded;
} else {
// For cloud mode, check if appropriate API key is set
if (cloudTranscriptionProvider === "openai") {
@@ -580,9 +548,7 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
return true;
}
case 3:
- return hotkey.trim() !== ""; // Hotkey & Test step
- case 4:
- return agentName.trim() !== ""; // Agent name step (final)
+ return hotkey.trim() !== ""; // Activation step (final)
default:
return false;
}
@@ -602,7 +568,7 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
return (
<div
- className="h-screen flex flex-col bg-gradient-to-br from-stone-50 via-white to-blue-50/30"
+ className="h-screen flex flex-col bg-background"
style={{
paddingTop: "env(safe-area-inset-top, 0px)",
}}
@@ -629,59 +595,60 @@ export default function OnboardingFlow({ onComplete }: OnboardingFlowProps) {
<div className="flex-shrink-0 z-10">
<TitleBar
showTitle={true}
- className="bg-white/95 backdrop-blur-xl border-b border-stone-200/60 shadow-sm"
+ className="bg-background backdrop-blur-xl border-b border-border shadow-sm"
></TitleBar>
</div>
{/* Progress Bar */}
- <div className="flex-shrink-0 bg-white/90 backdrop-blur-xl border-b border-stone-200/60 p-6 md:px-16 z-10">
- <div className="max-w-4xl mx-auto">
+ <div className="flex-shrink-0 bg-background/80 backdrop-blur-2xl border-b border-white/5 px-6 md:px-12 py-4 z-10">
+ <div className="max-w-3xl mx-auto">
<StepProgress steps={steps} currentStep={currentStep} />
</div>
</div>
{/* Content - This will grow to fill available space */}
- <div className="flex-1 px-6 md:pl-16 md:pr-6 py-12 overflow-y-auto">
- <div className="max-w-4xl mx-auto">
- <Card className="bg-white/95 backdrop-blur-xl border border-stone-200/60 shadow-lg rounded-2xl overflow-hidden">
- <CardContent className="p-12 md:p-16">
- <div className="space-y-8">{renderStep()}</div>
+ <div className="flex-1 px-6 md:px-12 py-6 overflow-y-auto">
+ <div className="max-w-3xl mx-auto">
+ <Card className="bg-card/80 backdrop-blur-2xl border border-white/10 dark:border-white/5 shadow-xl rounded-2xl overflow-hidden">
+ <CardContent className="p-8 md:p-10">
+ <div className="space-y-6">{renderStep()}</div>
</CardContent>
</Card>
</div>
</div>
{/* Footer - This will stick to the bottom */}
- <div className="flex-shrink-0 bg-white/95 backdrop-blur-xl border-t border-stone-200/60 px-6 md:pl-16 md:pr-6 py-8 z-10 shadow-sm">
- <div className="max-w-4xl mx-auto flex items-center justify-between">
+ <div className="flex-shrink-0 bg-background/80 backdrop-blur-2xl border-t border-white/5 px-6 md:px-12 py-3 z-10">
+ <div className="max-w-3xl mx-auto flex items-center justify-between">
<Button
onClick={prevStep}
variant="outline"
disabled={currentStep === 0}
- className="px-8 py-3 h-12 text-sm font-medium"
+ className="h-8 px-5 rounded-full text-xs"
>
- <ChevronLeft className="w-4 h-4 mr-2" />
- Previous
+ <ChevronLeft className="w-3.5 h-3.5" />
+ Back
</Button>
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-2">
{currentStep === steps.length - 1 ? (
<Button
onClick={finishOnboarding}
disabled={!canProceed()}
- className="bg-green-600 hover:bg-green-700 px-8 py-3 h-12 text-sm font-medium"
+ variant="success"
+ className="h-8 px-6 rounded-full text-xs"
>
- <Check className="w-4 h-4 mr-2" />
- Complete Setup
+ <Check className="w-3.5 h-3.5" />
+ Complete
</Button>
) : (
<Button
onClick={nextStep}
disabled={!canProceed()}
- className="px-8 py-3 h-12 text-sm font-medium"
+ className="h-8 px-6 rounded-full text-xs"
>
Next
- <ChevronRight className="w-4 h-4 ml-2" />
+ <ChevronRight className="w-3.5 h-3.5" />
</Button>
)}
</div>
diff --git a/src/components/ReasoningModelSelector.tsx b/src/components/ReasoningModelSelector.tsx
index 703b0b455..3d6f877ef 100644
--- a/src/components/ReasoningModelSelector.tsx
+++ b/src/components/ReasoningModelSelector.tsx
@@ -9,7 +9,7 @@ import { ProviderTabs } from "./ui/ProviderTabs";
import { API_ENDPOINTS, buildApiUrl, normalizeBaseUrl } from "../config/constants";
import { REASONING_PROVIDERS } from "../models/ModelRegistry";
import { modelRegistry } from "../models/ModelRegistry";
-import { getProviderIcon } from "../utils/providerIcons";
+import { getProviderIcon, isMonochromeProvider } from "../utils/providerIcons";
import { isSecureEndpoint } from "../utils/urlUtils";
import { createExternalLinkHandler } from "../utils/externalLinks";
@@ -19,6 +19,7 @@ type CloudModelOption = {
description?: string;
icon?: string;
ownedBy?: string;
+ invertInDark?: boolean;
};
const OWNED_BY_ICON_RULES: Array<{ match: RegExp; provider: string }> = [
@@ -32,14 +33,17 @@ const OWNED_BY_ICON_RULES: Array<{ match: RegExp; provider: string }> = [
{ match: /(openrouter|oss)/, provider: "openai-oss" },
];
-const resolveOwnedByIcon = (ownedBy?: string): string | undefined => {
- if (!ownedBy) return undefined;
+const resolveOwnedByIcon = (ownedBy?: string): { icon?: string; invertInDark: boolean } => {
+ if (!ownedBy) return { icon: undefined, invertInDark: false };
const normalized = ownedBy.toLowerCase();
const rule = OWNED_BY_ICON_RULES.find(({ match }) => match.test(normalized));
if (rule) {
- return getProviderIcon(rule.provider);
+ return {
+ icon: getProviderIcon(rule.provider),
+ invertInDark: isMonochromeProvider(rule.provider),
+ };
}
- return undefined;
+ return { icon: undefined, invertInDark: false };
};
interface ReasoningModelSelectorProps {
@@ -201,7 +205,7 @@ export default function ReasoningModelSelector({
const value = (item?.id || item?.name) as string | undefined;
if (!value) return null;
const ownedBy = typeof item?.owned_by === "string" ? item.owned_by : undefined;
- const icon = resolveOwnedByIcon(ownedBy);
+ const { icon, invertInDark } = resolveOwnedByIcon(ownedBy);
return {
value,
label: (item?.id || item?.name || value) as string,
@@ -209,6 +213,7 @@ export default function ReasoningModelSelector({
(item?.description as string) || (ownedBy ? `Owner: ${ownedBy}` : undefined),
icon,
ownedBy,
+ invertInDark,
} as CloudModelOption;
})
.filter(Boolean) as CloudModelOption[];
@@ -288,6 +293,7 @@ export default function ReasoningModelSelector({
return REASONING_PROVIDERS.openai.models.map((model) => ({
...model,
icon: iconUrl,
+ invertInDark: true,
}));
}, []);
@@ -299,9 +305,11 @@ export default function ReasoningModelSelector({
if (!provider?.models) return [];
const iconUrl = getProviderIcon(selectedCloudProvider);
+ const invertInDark = isMonochromeProvider(selectedCloudProvider);
return provider.models.map((model) => ({
...model,
icon: iconUrl,
+ invertInDark,
}));
}, [selectedCloudProvider, openaiModelOptions, displayedCustomModels]);
@@ -473,87 +481,59 @@ export default function ReasoningModelSelector({
}
};
+ const MODE_TABS = [
+ { id: "cloud", name: "Cloud" },
+ { id: "local", name: "Local" },
+ ];
+
+ const renderModeIcon = (id: string) => {
+ if (id === "cloud") return <Cloud className="w-4 h-4" />;
+ return <Lock className="w-4 h-4" />;
+ };
+
return (
<div className="space-y-6">
- <div className="flex items-center justify-between p-4 bg-green-50 border border-green-200 rounded-xl">
+ <div className="flex items-center justify-between p-4 bg-card border border-border rounded-xl">
<div>
- <label className="text-sm font-medium text-green-800">Enable AI Text Enhancement</label>
- <p className="text-xs text-green-700">
+ <label className="text-sm font-medium text-foreground">Enable AI Text Enhancement</label>
+ <p className="text-xs text-muted-foreground">
Use AI to automatically improve transcription quality
</p>
</div>
- <label className="relative inline-flex items-center cursor-pointer">
- <input
- type="checkbox"
- className="sr-only"
- checked={useReasoningModel}
- onChange={(e) => setUseReasoningModel(e.target.checked)}
- />
- <div
- className={`w-11 h-6 bg-gray-200 rounded-full transition-colors duration-200 ${
- useReasoningModel ? "bg-green-600" : "bg-gray-300"
+ <button
+ onClick={() => setUseReasoningModel(!useReasoningModel)}
+ className={`relative inline-flex h-5 w-9 items-center rounded-full transition-colors duration-200 ${
+ useReasoningModel ? "bg-primary" : "bg-muted-foreground/25"
+ }`}
+ >
+ <span
+ className={`inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform duration-200 ${
+ useReasoningModel ? "translate-x-4.5" : "translate-x-0.75"
}`}
- >
- <div
- className={`absolute top-0.5 left-0.5 bg-white border border-gray-300 rounded-full h-5 w-5 transition-transform duration-200 ${
- useReasoningModel ? "translate-x-5" : "translate-x-0"
- }`}
- />
- </div>
- </label>
+ />
+ </button>
</div>
{useReasoningModel && (
<>
- <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
- <button
- onClick={() => handleModeChange("cloud")}
- className={`p-4 border-2 rounded-xl text-left transition-all cursor-pointer ${
- selectedMode === "cloud"
- ? "border-indigo-500 bg-indigo-50"
- : "border-neutral-200 bg-white hover:border-neutral-300"
- }`}
- >
- <div className="flex items-center justify-between mb-2">
- <div className="flex items-center gap-3">
- <Cloud className="w-6 h-6 text-blue-600" />
- <h4 className="font-medium text-neutral-900">Cloud AI</h4>
- </div>
- <span className="text-xs text-green-600 bg-green-100 px-2 py-1 rounded-full">
- Powerful
- </span>
- </div>
- <p className="text-sm text-neutral-600">
- Advanced models via API. Fast and capable, requires internet.
- </p>
- </button>
-
- <button
- onClick={() => handleModeChange("local")}
- className={`p-4 border-2 rounded-xl text-left transition-all cursor-pointer ${
- selectedMode === "local"
- ? "border-indigo-500 bg-indigo-50"
- : "border-neutral-200 bg-white hover:border-neutral-300"
- }`}
- >
- <div className="flex items-center justify-between mb-2">
- <div className="flex items-center gap-3">
- <Lock className="w-6 h-6 text-purple-600" />
- <h4 className="font-medium text-neutral-900">Local AI</h4>
- </div>
- <span className="text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full">
- Private
- </span>
- </div>
- <p className="text-sm text-neutral-600">
- Runs on your device. Complete privacy, works offline.
- </p>
- </button>
+ <div className="space-y-3">
+ <ProviderTabs
+ providers={MODE_TABS}
+ selectedId={selectedMode}
+ onSelect={(id) => handleModeChange(id as "cloud" | "local")}
+ renderIcon={renderModeIcon}
+ colorScheme="purple"
+ />
+ <p className="text-xs text-muted-foreground text-center">
+ {selectedMode === "local"
+ ? "Runs on your device. Complete privacy, works offline."
+ : "Advanced models via API. Fast and capable, requires internet."}
+ </p>
</div>
{selectedMode === "cloud" ? (
<div className="space-y-4">
- <div className="border border-gray-200 rounded-xl overflow-hidden">
+ <div className="border border-border rounded-xl overflow-hidden">
<ProviderTabs
providers={cloudProviders}
selectedId={selectedCloudProvider}
@@ -566,7 +546,7 @@ export default function ReasoningModelSelector({
<>
{/* 1. Endpoint URL - TOP */}
<div className="space-y-3">
- <h4 className="font-medium text-gray-900">Endpoint URL</h4>
+ <h4 className="font-medium text-foreground">Endpoint URL</h4>
<Input
value={customBaseInput}
onChange={(event) => setCustomBaseInput(event.target.value)}
@@ -574,18 +554,16 @@ export default function ReasoningModelSelector({
placeholder="https://api.openai.com/v1"
className="text-sm"
/>
- <p className="text-xs text-gray-500">
- Examples:{" "}
- <code className="text-purple-600">http://localhost:11434/v1</code>{" "}
- (Ollama),{" "}
- <code className="text-purple-600">http://localhost:8080/v1</code>{" "}
+ <p className="text-xs text-muted-foreground">
+ Examples: <code className="text-primary">http://localhost:11434/v1</code>{" "}
+ (Ollama), <code className="text-primary">http://localhost:8080/v1</code>{" "}
(LocalAI).
</p>
</div>
{/* 2. API Key - SECOND */}
<div className="space-y-3 pt-4">
- <h4 className="font-medium text-gray-900">API Key (Optional)</h4>
+ <h4 className="font-medium text-foreground">API Key (Optional)</h4>
<ApiKeyInput
apiKey={customReasoningApiKey}
setApiKey={setCustomReasoningApiKey || (() => {})}
@@ -597,7 +575,7 @@ export default function ReasoningModelSelector({
{/* 3. Model Selection - THIRD */}
<div className="space-y-3 pt-4">
<div className="flex items-center justify-between">
- <h4 className="text-sm font-medium text-gray-700">Available Models</h4>
+ <h4 className="text-sm font-medium text-foreground">Available Models</h4>
<div className="flex gap-2">
<Button
type="button"
@@ -626,7 +604,7 @@ export default function ReasoningModelSelector({
</Button>
</div>
</div>
- <p className="text-xs text-gray-500">
+ <p className="text-xs text-muted-foreground">
We'll query{" "}
<code>
{hasCustomBase
@@ -636,30 +614,30 @@ export default function ReasoningModelSelector({
for available models.
</p>
{isCustomBaseDirty && (
- <p className="text-xs text-blue-600">
+ <p className="text-xs text-primary">
Models will reload when you click away from the URL field or click
"Apply & Refresh".
</p>
)}
{!hasCustomBase && (
- <p className="text-xs text-amber-600">
+ <p className="text-xs text-warning">
Enter an endpoint URL above to load models.
</p>
)}
{hasCustomBase && (
<>
{customModelsLoading && (
- <p className="text-xs text-blue-600">
+ <p className="text-xs text-primary">
Fetching model list from endpoint...
</p>
)}
{customModelsError && (
- <p className="text-xs text-red-600">{customModelsError}</p>
+ <p className="text-xs text-destructive">{customModelsError}</p>
)}
{!customModelsLoading &&
!customModelsError &&
customModelOptions.length === 0 && (
- <p className="text-xs text-amber-600">
+ <p className="text-xs text-warning">
No models returned. Check your endpoint URL.
</p>
)}
@@ -678,7 +656,7 @@ export default function ReasoningModelSelector({
{selectedCloudProvider === "openai" && (
<div className="space-y-3">
<div className="flex items-baseline justify-between">
- <h4 className="font-medium text-gray-900">API Key</h4>
+ <h4 className="font-medium text-foreground">API Key</h4>
<a
href="https://platform.openai.com/api-keys"
target="_blank"
@@ -686,7 +664,7 @@ export default function ReasoningModelSelector({
onClick={createExternalLinkHandler(
"https://platform.openai.com/api-keys"
)}
- className="text-xs text-blue-600 hover:text-blue-700 underline cursor-pointer"
+ className="text-xs text-primary hover:text-primary/80 underline cursor-pointer"
>
Get your API key β†’
</a>
@@ -703,7 +681,7 @@ export default function ReasoningModelSelector({
{selectedCloudProvider === "anthropic" && (
<div className="space-y-3">
<div className="flex items-baseline justify-between">
- <h4 className="font-medium text-gray-900">API Key</h4>
+ <h4 className="font-medium text-foreground">API Key</h4>
<a
href="https://console.anthropic.com/settings/keys"
target="_blank"
@@ -711,7 +689,7 @@ export default function ReasoningModelSelector({
onClick={createExternalLinkHandler(
"https://console.anthropic.com/settings/keys"
)}
- className="text-xs text-blue-600 hover:text-blue-700 underline cursor-pointer"
+ className="text-xs text-primary hover:text-primary/80 underline cursor-pointer"
>
Get your API key β†’
</a>
@@ -729,7 +707,7 @@ export default function ReasoningModelSelector({
{selectedCloudProvider === "gemini" && (
<div className="space-y-3">
<div className="flex items-baseline justify-between">
- <h4 className="font-medium text-gray-900">API Key</h4>
+ <h4 className="font-medium text-foreground">API Key</h4>
<a
href="https://aistudio.google.com/app/api-keys"
target="_blank"
@@ -737,7 +715,7 @@ export default function ReasoningModelSelector({
onClick={createExternalLinkHandler(
"https://aistudio.google.com/app/api-keys"
)}
- className="text-xs text-blue-600 hover:text-blue-700 underline cursor-pointer"
+ className="text-xs text-primary hover:text-primary/80 underline cursor-pointer"
>
Get your API key β†’
</a>
@@ -755,13 +733,13 @@ export default function ReasoningModelSelector({
{selectedCloudProvider === "groq" && (
<div className="space-y-3">
<div className="flex items-baseline justify-between">
- <h4 className="font-medium text-gray-900">API Key</h4>
+ <h4 className="font-medium text-foreground">API Key</h4>
<a
href="https://console.groq.com/keys"
target="_blank"
rel="noopener noreferrer"
onClick={createExternalLinkHandler("https://console.groq.com/keys")}
- className="text-xs text-blue-600 hover:text-blue-700 underline cursor-pointer"
+ className="text-xs text-primary hover:text-primary/80 underline cursor-pointer"
>
Get your API key β†’
</a>
@@ -778,7 +756,7 @@ export default function ReasoningModelSelector({
{/* 2. Model Selection - BOTTOM */}
<div className="pt-4 space-y-3">
- <h4 className="text-sm font-medium text-gray-700">Select Model</h4>
+ <h4 className="text-sm font-medium text-foreground">Select Model</h4>
<ModelCardList
models={selectedCloudModels}
selectedModel={reasoningModel}
diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx
index ae5695d7f..d2d891a74 100644
--- a/src/components/SettingsModal.tsx
+++ b/src/components/SettingsModal.tsx
@@ -1,26 +1,85 @@
-import React from "react";
-import { Settings, Mic, Brain, User, Sparkles, Wrench, BookOpen } from "lucide-react";
+import React, { useEffect } from "react";
+import { Settings, Mic, Brain, User, Sparkles, Wrench, BookOpen, ShieldCheck } from "lucide-react";
import SidebarModal, { SidebarItem } from "./ui/SidebarModal";
import SettingsPage, { SettingsSectionType } from "./SettingsPage";
+export type { SettingsSectionType };
+
interface SettingsModalProps {
open: boolean;
onOpenChange: (open: boolean) => void;
+ initialSection?: SettingsSectionType;
}
-export default function SettingsModal({ open, onOpenChange }: SettingsModalProps) {
+export default function SettingsModal({ open, onOpenChange, initialSection }: SettingsModalProps) {
const sidebarItems: SidebarItem<SettingsSectionType>[] = [
- { id: "general", label: "General", icon: Settings },
- { id: "transcription", label: "Transcription Mode", icon: Mic },
- { id: "dictionary", label: "Custom Dictionary", icon: BookOpen },
- { id: "aiModels", label: "AI Text Cleanup", icon: Brain },
- { id: "agentConfig", label: "Agent Configuration", icon: User },
- { id: "prompts", label: "AI Prompts", icon: Sparkles },
- { id: "developer", label: "Troubleshooting", icon: Wrench },
+ {
+ id: "general",
+ label: "General",
+ icon: Settings,
+ description: "Appearance, hotkey & startup",
+ group: "App",
+ },
+ {
+ id: "transcription",
+ label: "Transcription",
+ icon: Mic,
+ description: "Speech-to-text engine",
+ group: "Speech",
+ },
+ {
+ id: "dictionary",
+ label: "Dictionary",
+ icon: BookOpen,
+ description: "Custom words & phrases",
+ group: "Speech",
+ },
+ {
+ id: "aiModels",
+ label: "AI Models",
+ icon: Brain,
+ description: "Text cleanup & enhancement",
+ group: "Intelligence",
+ },
+ {
+ id: "agentConfig",
+ label: "Agent",
+ icon: User,
+ description: "Voice agent setup",
+ group: "Intelligence",
+ },
+ {
+ id: "prompts",
+ label: "Prompts",
+ icon: Sparkles,
+ description: "System prompt studio",
+ group: "Intelligence",
+ },
+ {
+ id: "permissions",
+ label: "Permissions",
+ icon: ShieldCheck,
+ description: "Microphone & accessibility",
+ group: "System",
+ },
+ {
+ id: "developer",
+ label: "Developer",
+ icon: Wrench,
+ description: "Logs, diagnostics & data",
+ group: "System",
+ },
];
const [activeSection, setActiveSection] = React.useState<SettingsSectionType>("general");
+ // Navigate to initial section when modal opens
+ useEffect(() => {
+ if (open && initialSection) {
+ setActiveSection(initialSection);
+ }
+ }, [open, initialSection]);
+
return (
<SidebarModal<SettingsSectionType>
open={open}
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index 3a0112757..58664ab55 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -1,10 +1,13 @@
import React, { useState, useCallback, useEffect, useRef, useMemo } from "react";
import { Button } from "./ui/button";
import { Input } from "./ui/input";
-import { RefreshCw, Download, Command, Mic, Shield, FolderOpen } from "lucide-react";
+import { Badge } from "./ui/badge";
+import { RefreshCw, Download, Mic, Shield, FolderOpen, Sun, Moon, Monitor } from "lucide-react";
import MarkdownRenderer from "./ui/MarkdownRenderer";
import MicPermissionWarning from "./ui/MicPermissionWarning";
import MicrophoneSettings from "./ui/MicrophoneSettings";
+import PermissionCard from "./ui/PermissionCard";
+import PasteToolsInfo from "./ui/PasteToolsInfo";
import TranscriptionModelPicker from "./TranscriptionModelPicker";
import { ConfirmDialog, AlertDialog } from "./ui/dialog";
import { useSettings } from "../hooks/useSettings";
@@ -14,15 +17,17 @@ import { useWhisper } from "../hooks/useWhisper";
import { usePermissions } from "../hooks/usePermissions";
import { useClipboard } from "../hooks/useClipboard";
import { useUpdater } from "../hooks/useUpdater";
-import { getTranscriptionProviders } from "../models/ModelRegistry";
-import { formatHotkeyLabel } from "../utils/hotkeys";
+
import PromptStudio from "./ui/PromptStudio";
import ReasoningModelSelector from "./ReasoningModelSelector";
-import type { UpdateInfoResult } from "../types/electron";
+
import { HotkeyInput } from "./ui/HotkeyInput";
import { useHotkeyRegistration } from "../hooks/useHotkeyRegistration";
import { ActivationModeSelector } from "./ui/ActivationModeSelector";
+import { Toggle } from "./ui/toggle";
import DeveloperSection from "./DeveloperSection";
+import { useTheme } from "../hooks/useTheme";
+import { SettingsRow } from "./ui/SettingsSection";
export type SettingsSectionType =
| "general"
@@ -31,12 +36,54 @@ export type SettingsSectionType =
| "aiModels"
| "agentConfig"
| "prompts"
+ | "permissions"
| "developer";
interface SettingsPageProps {
activeSection?: SettingsSectionType;
}
+// ── Reusable layout primitives ──────────────────────────────────────
+
+function SettingsPanel({
+ children,
+ className = "",
+}: {
+ children: React.ReactNode;
+ className?: string;
+}) {
+ return (
+ <div
+ className={`rounded-lg border border-border/50 dark:border-border-subtle/70 bg-card/50 dark:bg-surface-2/50 backdrop-blur-sm divide-y divide-border/30 dark:divide-border-subtle/50 ${className}`}
+ >
+ {children}
+ </div>
+ );
+}
+
+function SettingsPanelRow({
+ children,
+ className = "",
+}: {
+ children: React.ReactNode;
+ className?: string;
+}) {
+ return <div className={`px-4 py-3 ${className}`}>{children}</div>;
+}
+
+function SectionHeader({ title, description }: { title: string; description?: string }) {
+ return (
+ <div className="mb-3">
+ <h3 className="text-[13px] font-semibold text-foreground tracking-tight">{title}</h3>
+ {description && (
+ <p className="text-[11px] text-muted-foreground/80 mt-0.5 leading-relaxed">{description}</p>
+ )}
+ </div>
+ );
+}
+
+// ── Main component ──────────────────────────────────────────────────
+
export default function SettingsPage({ activeSection = "general" }: SettingsPageProps) {
const {
confirmDialog,
@@ -52,7 +99,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
whisperModel,
localTranscriptionProvider,
parakeetModel,
- allowOpenAIFallback,
cloudTranscriptionProvider,
cloudTranscriptionModel,
cloudTranscriptionBaseUrl,
@@ -76,7 +122,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
setWhisperModel,
setLocalTranscriptionProvider,
setParakeetModel,
- setAllowOpenAIFallback,
setCloudTranscriptionProvider,
setCloudTranscriptionModel,
setCloudTranscriptionBaseUrl,
@@ -105,7 +150,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
? "%USERPROFILE%\\.cache\\openwhispr\\whisper-models"
: "~/.cache/openwhispr/whisper-models";
- // Use centralized updater hook to prevent EventEmitter memory leaks
const {
status: updateStatus,
info: updateInfo,
@@ -123,13 +167,13 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
const isUpdateAvailable =
!updateStatus.isDevelopment && (updateStatus.updateAvailable || updateStatus.updateDownloaded);
- const whisperHook = useWhisper(showAlertDialog);
+ const whisperHook = useWhisper();
const permissionsHook = usePermissions(showAlertDialog);
useClipboard(showAlertDialog);
const { agentName, setAgentName } = useAgentName();
+ const { theme, setTheme } = useTheme();
const installTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
- // Shared hotkey registration hook
const { registerHotkey, isRegistering: isHotkeyRegistering } = useHotkeyRegistration({
onSuccess: (registeredHotkey) => {
setDictationKey(registeredHotkey);
@@ -139,20 +183,15 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
showAlert: showAlertDialog,
});
- const [localReasoningProvider, setLocalReasoningProvider] = useState(() => {
- return localStorage.getItem("reasoningProvider") || reasoningProvider;
- });
const [isUsingGnomeHotkeys, setIsUsingGnomeHotkeys] = useState(false);
- // Platform detection for conditional features
const platform = useMemo(() => {
if (typeof window !== "undefined" && window.electronAPI?.getPlatform) {
return window.electronAPI.getPlatform();
}
- return "linux"; // Safe fallback
+ return "linux";
}, []);
- // Custom dictionary state
const [newDictionaryWord, setNewDictionaryWord] = useState("");
const handleAddDictionaryWord = useCallback(() => {
@@ -170,11 +209,9 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
[customDictionary, setCustomDictionary]
);
- // Auto-start state
const [autoStartEnabled, setAutoStartEnabled] = useState(false);
const [autoStartLoading, setAutoStartLoading] = useState(true);
- // Load auto-start state on mount (not supported on Linux)
useEffect(() => {
if (platform === "linux") {
setAutoStartLoading(false);
@@ -245,7 +282,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
checkHotkeyMode();
}, [setActivationMode]);
- // Show alert dialog on update errors
useEffect(() => {
if (updateError) {
showAlertDialog({
@@ -283,18 +319,12 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
}, [installInitiated, showAlertDialog]);
const resetAccessibilityPermissions = () => {
- const message = `πŸ”„ RESET ACCESSIBILITY PERMISSIONS\n\nIf you've rebuilt or reinstalled OpenWhispr and automatic inscription isn't functioning, you may have obsolete permissions from the previous version.\n\nπŸ“‹ STEP-BY-STEP RESTORATION:\n\n1️⃣ Open System Settings (or System Preferences)\n β€’ macOS Ventura+: Apple Menu β†’ System Settings\n β€’ Older macOS: Apple Menu β†’ System Preferences\n\n2️⃣ Navigate to Privacy & Security β†’ Accessibility\n\n3️⃣ Look for obsolete OpenWhispr entries:\n β€’ Any entries named "OpenWhispr"\n β€’ Any entries named "Electron"\n β€’ Any entries with unclear or generic names\n β€’ Entries pointing to old application locations\n\n4️⃣ Remove ALL obsolete entries:\n β€’ Select each old entry\n β€’ Click the minus (-) button\n β€’ Enter your password if prompted\n\n5️⃣ Add the current OpenWhispr:\n β€’ Click the plus (+) button\n β€’ Navigate to and select the CURRENT OpenWhispr app\n β€’ Ensure the checkbox is ENABLED\n\n6️⃣ Restart OpenWhispr completely\n\nπŸ’‘ This is very common during development when rebuilding applications!\n\nClick OK when you're ready to open System Settings.`;
+ const message = `To fix accessibility permissions:\n\n1. Open System Settings > Privacy & Security > Accessibility\n2. Remove any old OpenWhispr or Electron entries\n3. Click (+) and add the current OpenWhispr app\n4. Make sure the checkbox is enabled\n5. Restart OpenWhispr\n\nClick OK to open System Settings.`;
showConfirmDialog({
title: "Reset Accessibility Permissions",
description: message,
onConfirm: () => {
- showAlertDialog({
- title: "Opening System Settings",
- description:
- "Opening System Settings... Look for the Accessibility section under Privacy & Security.",
- });
-
permissionsHook.openAccessibilitySettings();
},
});
@@ -345,414 +375,284 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
const renderSectionContent = () => {
switch (activeSection) {
+ // ───────────────────────────────────────────────────
+ // GENERAL β€” Updates, Appearance, Hotkey, Startup, Mic
+ // ───────────────────────────────────────────────────
case "general":
return (
- <div className="space-y-8">
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">App Updates</h3>
- <p className="text-sm text-gray-600 mb-4">
- Keep OpenWhispr up to date with the latest features and improvements.
- </p>
- </div>
- <div className="flex items-center justify-between p-4 bg-neutral-50 rounded-lg">
- <div>
- <p className="text-sm font-medium text-neutral-800">Current Version</p>
- <p className="text-xs text-neutral-600">{currentVersion || "Loading..."}</p>
- </div>
- <div className="flex items-center gap-2">
- {updateStatus.isDevelopment ? (
- <span className="text-xs text-amber-600 bg-amber-100 px-2 py-1 rounded-full">
- Development Mode
- </span>
- ) : updateStatus.updateAvailable ? (
- <span className="text-xs text-green-600 bg-green-100 px-2 py-1 rounded-full">
- Update Available
- </span>
- ) : (
- <span className="text-xs text-neutral-600 bg-neutral-100 px-2 py-1 rounded-full">
- Up to Date
- </span>
- )}
- </div>
- </div>
- <div className="space-y-3">
- <Button
- onClick={async () => {
- try {
- const result = await checkForUpdates();
- if (result?.updateAvailable) {
- showAlertDialog({
- title: "Update Available",
- description: `Update available: v${result.version || "new version"}`,
- });
- } else {
- showAlertDialog({
- title: "No Updates",
- description: result?.message || "No updates available",
- });
- }
- } catch (error: any) {
- showAlertDialog({
- title: "Update Check Failed",
- description: `Error checking for updates: ${error.message}`,
- });
+ <div className="space-y-6">
+ {/* Updates */}
+ <div>
+ <SectionHeader title="Updates" />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <SettingsRow
+ label="Current version"
+ description={
+ updateStatus.isDevelopment
+ ? "Running in development mode"
+ : isUpdateAvailable
+ ? "A newer version is available"
+ : "You're on the latest version"
}
- }}
- disabled={checkingForUpdates || updateStatus.isDevelopment}
- className="w-full"
- >
- {checkingForUpdates ? (
- <>
- <RefreshCw size={16} className="animate-spin mr-2" />
- Checking for Updates...
- </>
- ) : (
- <>
- <RefreshCw size={16} className="mr-2" />
- Check for Updates
- </>
- )}
- </Button>
+ >
+ <div className="flex items-center gap-2.5">
+ <span className="text-[13px] tabular-nums text-muted-foreground font-mono">
+ {currentVersion || "..."}
+ </span>
+ {updateStatus.isDevelopment ? (
+ <Badge variant="warning">Dev</Badge>
+ ) : isUpdateAvailable ? (
+ <Badge variant="success">Update</Badge>
+ ) : (
+ <Badge variant="outline">Latest</Badge>
+ )}
+ </div>
+ </SettingsRow>
+ </SettingsPanelRow>
- {isUpdateAvailable && !updateStatus.updateDownloaded && (
- <div className="space-y-2">
+ <SettingsPanelRow>
+ <div className="space-y-2.5">
<Button
onClick={async () => {
try {
- await downloadUpdate();
+ const result = await checkForUpdates();
+ if (result?.updateAvailable) {
+ showAlertDialog({
+ title: "Update Available",
+ description: `Update available: v${result.version || "new version"}`,
+ });
+ } else {
+ showAlertDialog({
+ title: "No Updates",
+ description: result?.message || "No updates available",
+ });
+ }
} catch (error: any) {
showAlertDialog({
- title: "Download Failed",
- description: `Failed to download update: ${error.message}`,
+ title: "Update Check Failed",
+ description: `Error checking for updates: ${error.message}`,
});
}
}}
- disabled={downloadingUpdate}
- className="w-full bg-green-600 hover:bg-green-700"
+ disabled={checkingForUpdates || updateStatus.isDevelopment}
+ variant="outline"
+ className="w-full"
+ size="sm"
>
- {downloadingUpdate ? (
- <>
- <Download size={16} className="animate-pulse mr-2" />
- Downloading... {Math.round(updateDownloadProgress)}%
- </>
- ) : (
- <>
- <Download size={16} className="mr-2" />
- Download Update{updateInfo?.version ? ` v${updateInfo.version}` : ""}
- </>
- )}
+ <RefreshCw
+ size={13}
+ className={`mr-1.5 ${checkingForUpdates ? "animate-spin" : ""}`}
+ />
+ {checkingForUpdates ? "Checking..." : "Check for Updates"}
</Button>
- {downloadingUpdate && (
- <div className="space-y-1">
- <div className="h-2 w-full overflow-hidden rounded-full bg-neutral-200">
- <div
- className="h-full bg-green-600 transition-all duration-200"
- style={{
- width: `${Math.min(100, Math.max(0, updateDownloadProgress))}%`,
- }}
+ {isUpdateAvailable && !updateStatus.updateDownloaded && (
+ <div className="space-y-2">
+ <Button
+ onClick={async () => {
+ try {
+ await downloadUpdate();
+ } catch (error: any) {
+ showAlertDialog({
+ title: "Download Failed",
+ description: `Failed to download update: ${error.message}`,
+ });
+ }
+ }}
+ disabled={downloadingUpdate}
+ variant="success"
+ className="w-full"
+ size="sm"
+ >
+ <Download
+ size={13}
+ className={`mr-1.5 ${downloadingUpdate ? "animate-pulse" : ""}`}
/>
- </div>
- <p className="text-xs text-neutral-600 text-right">
- {Math.round(updateDownloadProgress)}% downloaded
- </p>
+ {downloadingUpdate
+ ? `Downloading... ${Math.round(updateDownloadProgress)}%`
+ : `Download Update${updateInfo?.version ? ` v${updateInfo.version}` : ""}`}
+ </Button>
+
+ {downloadingUpdate && (
+ <div className="h-1 w-full overflow-hidden rounded-full bg-muted/50">
+ <div
+ className="h-full bg-success transition-all duration-200 rounded-full"
+ style={{
+ width: `${Math.min(100, Math.max(0, updateDownloadProgress))}%`,
+ }}
+ />
+ </div>
+ )}
</div>
)}
- </div>
- )}
- {updateStatus.updateDownloaded && (
- <Button
- onClick={() => {
- showConfirmDialog({
- title: "Install Update",
- description: `Ready to install update${updateInfo?.version ? ` v${updateInfo.version}` : ""}. The app will restart to complete installation.`,
- confirmText: "Install & Restart",
- onConfirm: async () => {
- try {
- await installUpdateAction();
- showAlertDialog({
- title: "Installing Update",
- description:
- "OpenWhispr will restart automatically to finish installing the newest version.",
- });
- } catch (error: any) {
- showAlertDialog({
- title: "Install Failed",
- description: `Failed to install update: ${error.message}`,
- });
- }
- },
- });
- }}
- disabled={installInitiated}
- className="w-full bg-blue-600 hover:bg-blue-700"
- >
- {installInitiated ? (
- <>
- <RefreshCw size={16} className="animate-spin mr-2" />
- Restarting to Finish Update...
- </>
- ) : (
- <>
- <span className="mr-2">πŸš€</span>
- Quit & Install Update
- </>
+ {updateStatus.updateDownloaded && (
+ <Button
+ onClick={() => {
+ showConfirmDialog({
+ title: "Install Update",
+ description: `Ready to install update${updateInfo?.version ? ` v${updateInfo.version}` : ""}. The app will restart to complete installation.`,
+ confirmText: "Install & Restart",
+ onConfirm: async () => {
+ try {
+ await installUpdateAction();
+ } catch (error: any) {
+ showAlertDialog({
+ title: "Install Failed",
+ description: `Failed to install update: ${error.message}`,
+ });
+ }
+ },
+ });
+ }}
+ disabled={installInitiated}
+ className="w-full"
+ size="sm"
+ >
+ <RefreshCw
+ size={14}
+ className={`mr-2 ${installInitiated ? "animate-spin" : ""}`}
+ />
+ {installInitiated ? "Restarting..." : "Install & Restart"}
+ </Button>
)}
- </Button>
- )}
+ </div>
- {updateInfo?.version && (
- <div className="p-4 bg-blue-50 border border-blue-200 rounded-lg">
- <h4 className="font-medium text-blue-900 mb-2">Update v{updateInfo.version}</h4>
- {updateInfo.releaseDate && (
- <p className="text-sm text-blue-700 mb-2">
- Released: {new Date(updateInfo.releaseDate).toLocaleDateString()}
+ {updateInfo?.releaseNotes && (
+ <div className="mt-4 pt-4 border-t border-border/30">
+ <p className="text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2">
+ What's new in v{updateInfo.version}
</p>
- )}
- {updateInfo.releaseNotes && (
- <div className="text-sm text-blue-800">
- <p className="font-medium mb-1">What's New:</p>
+ <div className="text-[12px] text-muted-foreground">
<MarkdownRenderer content={updateInfo.releaseNotes} />
</div>
- )}
- </div>
- )}
- </div>
+ </div>
+ )}
+ </SettingsPanelRow>
+ </SettingsPanel>
</div>
- <div className="border-t pt-8">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">Dictation Hotkey</h3>
- <p className="text-sm text-gray-600 mb-6">
- Configure the key or key combination you press to start and stop voice dictation.
- </p>
- </div>
- <HotkeyInput
- value={dictationKey}
- onChange={async (newHotkey) => {
- await registerHotkey(newHotkey);
- }}
- disabled={isHotkeyRegistering}
- />
-
- {!isUsingGnomeHotkeys && (
- <div className="mt-6">
- <label className="block text-sm font-medium text-gray-700 mb-3">
- Activation Mode
- </label>
- <ActivationModeSelector value={activationMode} onChange={setActivationMode} />
- </div>
- )}
+ {/* Appearance */}
+ <div>
+ <SectionHeader title="Appearance" description="Control how OpenWhispr looks" />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <SettingsRow label="Theme" description="Choose light, dark, or match your system">
+ <div className="inline-flex items-center gap-px p-0.5 bg-muted/60 dark:bg-surface-2 rounded-md">
+ {(
+ [
+ { value: "light", icon: Sun, label: "Light" },
+ { value: "dark", icon: Moon, label: "Dark" },
+ { value: "auto", icon: Monitor, label: "Auto" },
+ ] as const
+ ).map((option) => {
+ const Icon = option.icon;
+ const isSelected = theme === option.value;
+ return (
+ <button
+ key={option.value}
+ onClick={() => setTheme(option.value)}
+ className={`
+ flex items-center gap-1 px-2.5 py-1 rounded-[5px] text-[11px] font-medium
+ transition-all duration-100
+ ${
+ isSelected
+ ? "bg-background dark:bg-surface-raised text-foreground shadow-sm"
+ : "text-muted-foreground hover:text-foreground"
+ }
+ `}
+ >
+ <Icon className={`w-3 h-3 ${isSelected ? "text-primary" : ""}`} />
+ {option.label}
+ </button>
+ );
+ })}
+ </div>
+ </SettingsRow>
+ </SettingsPanelRow>
+ </SettingsPanel>
</div>
- {/* Auto-start is only supported on macOS and Windows */}
- {platform !== "linux" && (
- <div className="border-t pt-8">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">Startup</h3>
- <p className="text-sm text-gray-600 mb-6">
- Control how OpenWhispr starts when you log in.
- </p>
- </div>
- <div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
- <div>
- <p className="font-medium text-gray-900">Launch at Login</p>
- <p className="text-sm text-gray-600">
- Automatically start OpenWhispr when you log in to your computer
- </p>
- </div>
- <button
- onClick={() => handleAutoStartChange(!autoStartEnabled)}
- disabled={autoStartLoading}
- className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 ${
- autoStartEnabled ? "bg-indigo-600" : "bg-gray-200"
- } ${autoStartLoading ? "opacity-50 cursor-not-allowed" : ""}`}
- >
- <span
- className={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
- autoStartEnabled ? "translate-x-6" : "translate-x-1"
- }`}
- />
- </button>
- </div>
- </div>
- )}
-
- <div className="border-t pt-8">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">Permissions</h3>
- <p className="text-sm text-gray-600 mb-6">
- Test and manage app permissions for microphone and accessibility.
- </p>
- </div>
- <div className="space-y-3">
- <Button
- onClick={permissionsHook.requestMicPermission}
- variant="outline"
- className="w-full"
- >
- <Mic className="mr-2 h-4 w-4" />
- Test Microphone Permission
- </Button>
- <Button
- onClick={permissionsHook.testAccessibilityPermission}
- variant="outline"
- className="w-full"
- >
- <Shield className="mr-2 h-4 w-4" />
- Test Accessibility Permission
- </Button>
- <Button
- onClick={resetAccessibilityPermissions}
- variant="secondary"
- className="w-full"
- >
- <span className="mr-2">βš™οΈ</span>
- Fix Permission Issues
- </Button>
- {!permissionsHook.micPermissionGranted && (
- <MicPermissionWarning
- error={permissionsHook.micPermissionError}
- onOpenSoundSettings={permissionsHook.openSoundInputSettings}
- onOpenPrivacySettings={permissionsHook.openMicPrivacySettings}
+ {/* Dictation Hotkey */}
+ <div>
+ <SectionHeader
+ title="Dictation Hotkey"
+ description="The key combination that starts and stops voice dictation"
+ />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <HotkeyInput
+ value={dictationKey}
+ onChange={async (newHotkey) => {
+ await registerHotkey(newHotkey);
+ }}
+ disabled={isHotkeyRegistering}
/>
- )}
- </div>
- </div>
+ </SettingsPanelRow>
- <div className="border-t pt-8">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">Microphone Input</h3>
- <p className="text-sm text-gray-600 mb-6">
- Choose which microphone to use for dictation. Enable "Prefer Built-in" to prevent
- audio interruptions when using Bluetooth headphones.
- </p>
- </div>
- <MicrophoneSettings
- preferBuiltInMic={preferBuiltInMic}
- selectedMicDeviceId={selectedMicDeviceId}
- onPreferBuiltInChange={setPreferBuiltInMic}
- onDeviceSelect={setSelectedMicDeviceId}
- />
+ {!isUsingGnomeHotkeys && (
+ <SettingsPanelRow>
+ <p className="text-[11px] font-medium text-muted-foreground/80 mb-2">
+ Activation Mode
+ </p>
+ <ActivationModeSelector value={activationMode} onChange={setActivationMode} />
+ </SettingsPanelRow>
+ )}
+ </SettingsPanel>
</div>
- <div className="border-t pt-8">
+ {/* Startup */}
+ {platform !== "linux" && (
<div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">About OpenWhispr</h3>
- <p className="text-sm text-gray-600 mb-6">
- OpenWhispr converts your speech to text using AI. Press your hotkey, speak, and
- we'll type what you said wherever your cursor is.
- </p>
- </div>
- <div className="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm mb-6">
- <div className="text-center p-4 border border-gray-200 rounded-xl bg-white">
- <div className="w-8 h-8 mx-auto mb-2 bg-indigo-600 rounded-lg flex items-center justify-center">
- <Command className="w-4 h-4 text-white" />
- </div>
- <p className="font-medium text-gray-800 mb-1">Default Hotkey</p>
- <p className="text-gray-600 font-mono text-xs">
- {formatHotkeyLabel(dictationKey)}
- </p>
- </div>
- <div className="text-center p-4 border border-gray-200 rounded-xl bg-white">
- <div className="w-8 h-8 mx-auto mb-2 bg-emerald-600 rounded-lg flex items-center justify-center">
- <span className="text-white text-sm">🏷️</span>
- </div>
- <p className="font-medium text-gray-800 mb-1">Version</p>
- <p className="text-gray-600 text-xs">{currentVersion || "0.1.0"}</p>
- </div>
- <div className="text-center p-4 border border-gray-200 rounded-xl bg-white">
- <div className="w-8 h-8 mx-auto mb-2 bg-green-600 rounded-lg flex items-center justify-center">
- <span className="text-white text-sm">βœ“</span>
- </div>
- <p className="font-medium text-gray-800 mb-1">Status</p>
- <p className="text-green-600 text-xs font-medium">Active</p>
- </div>
- </div>
-
- <div className="space-y-3">
- <Button
- onClick={() => {
- showConfirmDialog({
- title: "⚠️ DANGER: Cleanup App Data",
- description:
- "This will permanently delete ALL OpenWhispr data including:\n\nβ€’ Database and transcriptions\nβ€’ Local storage settings\nβ€’ Downloaded Whisper models\nβ€’ Environment files\n\nYou will need to manually remove app permissions in System Settings.\n\nThis action cannot be undone. Are you sure?",
- onConfirm: () => {
- window.electronAPI
- ?.cleanupApp()
- .then(() => {
- showAlertDialog({
- title: "Cleanup Completed",
- description: "βœ… Cleanup completed! All app data has been removed.",
- });
- setTimeout(() => {
- window.location.reload();
- }, 1000);
- })
- .catch((error) => {
- showAlertDialog({
- title: "Cleanup Failed",
- description: `❌ Cleanup failed: ${error.message}`,
- });
- });
- },
- variant: "destructive",
- });
- }}
- variant="outline"
- className="w-full text-red-600 border-red-300 hover:bg-red-50 hover:border-red-400"
- >
- <span className="mr-2">πŸ—‘οΈ</span>
- Clean Up All App Data
- </Button>
+ <SectionHeader title="Startup" />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <SettingsRow
+ label="Launch at login"
+ description="Start OpenWhispr automatically when you log in"
+ >
+ <Toggle
+ checked={autoStartEnabled}
+ onChange={(checked: boolean) => handleAutoStartChange(checked)}
+ disabled={autoStartLoading}
+ />
+ </SettingsRow>
+ </SettingsPanelRow>
+ </SettingsPanel>
</div>
+ )}
- <div className="space-y-3 mt-6 p-4 bg-rose-50 border border-rose-200 rounded-xl">
- <h4 className="font-medium text-rose-900">Local Model Storage</h4>
- <p className="text-sm text-rose-800">
- Remove all downloaded Whisper models from your cache directory to reclaim disk
- space. You can re-download any model later.
- </p>
- <div className="flex gap-2">
- <Button
- variant="outline"
- onClick={() => window.electronAPI?.openWhisperModelsFolder?.()}
- className="flex-1"
- >
- <FolderOpen className="mr-2 h-4 w-4" />
- Open Models Folder
- </Button>
- <Button
- variant="destructive"
- onClick={handleRemoveModels}
- disabled={isRemovingModels}
- className="flex-1"
- >
- {isRemovingModels ? "Removing..." : "Remove All"}
- </Button>
- </div>
- <p className="text-xs text-rose-700">
- Current cache location: <code>{cachePathHint}</code>
- </p>
- </div>
+ {/* Microphone */}
+ <div>
+ <SectionHeader
+ title="Microphone"
+ description="Select which input device to use for dictation"
+ />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <MicrophoneSettings
+ preferBuiltInMic={preferBuiltInMic}
+ selectedMicDeviceId={selectedMicDeviceId}
+ onPreferBuiltInChange={setPreferBuiltInMic}
+ onDeviceSelect={setSelectedMicDeviceId}
+ />
+ </SettingsPanelRow>
+ </SettingsPanel>
</div>
</div>
);
+ // ───────────────────────────────────────────────────
+ // TRANSCRIPTION
+ // ───────────────────────────────────────────────────
case "transcription":
return (
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">
- Speech to Text Processing
- </h3>
- <p className="text-sm text-gray-600 mb-4">
- Choose a cloud provider for fast transcription or use local Whisper models for
- complete privacy.
- </p>
- </div>
+ <div className="space-y-5">
+ <SectionHeader
+ title="Speech to Text"
+ description="Choose a cloud provider for fast transcription or use local Whisper models for complete privacy"
+ />
<TranscriptionModelPicker
selectedCloudProvider={cloudTranscriptionProvider}
@@ -789,92 +689,154 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
+ // ───────────────────────────────────────────────────
+ // DICTIONARY
+ // ───────────────────────────────────────────────────
case "dictionary":
return (
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">Custom Dictionary</h3>
- <p className="text-sm text-gray-600 mb-6">
- Add words, names, or technical terms that OpenWhispr should recognize during
- transcription. These words are used as hints to improve accuracy.
- </p>
- </div>
-
- <div className="space-y-4 p-4 bg-gray-50 border border-gray-200 rounded-xl">
- <h4 className="font-medium text-gray-900">Add Words</h4>
- <div className="flex gap-2">
- <Input
- placeholder="Enter a word or phrase..."
- value={newDictionaryWord}
- onChange={(e) => setNewDictionaryWord(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Enter") {
- handleAddDictionaryWord();
- }
- }}
- className="flex-1"
- />
- <Button onClick={handleAddDictionaryWord} disabled={!newDictionaryWord.trim()}>
- Add
- </Button>
- </div>
- <p className="text-xs text-gray-500">
- Press Enter or click Add to add the word to your dictionary.
- </p>
- </div>
+ <div className="space-y-5">
+ <SectionHeader
+ title="Custom Dictionary"
+ description="Add words, names, or technical terms to improve transcription accuracy"
+ />
- {customDictionary.length > 0 && (
- <div className="space-y-3">
- <h4 className="font-medium text-gray-900">
- Your Dictionary ({customDictionary.length} words)
- </h4>
- <div className="flex flex-wrap gap-2">
- {customDictionary.map((word) => (
- <span
- key={word}
- className="inline-flex items-center gap-1 px-3 py-1 bg-indigo-100 text-indigo-800 rounded-full text-sm"
+ {/* Add Words */}
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <div className="space-y-2">
+ <p className="text-[12px] font-medium text-foreground">Add a word or phrase</p>
+ <div className="flex gap-2">
+ <Input
+ placeholder="e.g. OpenWhispr, Kubernetes, Dr. Martinez..."
+ value={newDictionaryWord}
+ onChange={(e) => setNewDictionaryWord(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ handleAddDictionaryWord();
+ }
+ }}
+ className="flex-1 h-8 text-[12px]"
+ />
+ <Button
+ onClick={handleAddDictionaryWord}
+ disabled={!newDictionaryWord.trim()}
+ size="sm"
+ className="h-8"
>
- {word}
- <button
- onClick={() => handleRemoveDictionaryWord(word)}
- className="ml-1 text-indigo-600 hover:text-indigo-900 font-bold"
- title="Remove word"
- >
- Γ—
- </button>
- </span>
- ))}
+ Add
+ </Button>
+ </div>
+ <p className="text-[10px] text-muted-foreground/50">Press Enter to add</p>
</div>
+ </SettingsPanelRow>
+ </SettingsPanel>
+
+ {/* Word List */}
+ <div>
+ <div className="flex items-center justify-between mb-2">
+ <p className="text-[12px] font-medium text-foreground">
+ Your words
+ {customDictionary.length > 0 && (
+ <span className="ml-1.5 text-muted-foreground/50 font-normal text-[11px]">
+ {customDictionary.length}
+ </span>
+ )}
+ </p>
+ {customDictionary.length > 0 && (
+ <button
+ onClick={() => {
+ showConfirmDialog({
+ title: "Clear dictionary?",
+ description:
+ "This will remove all words from your custom dictionary. This action cannot be undone.",
+ confirmText: "Clear All",
+ variant: "destructive",
+ onConfirm: () => setCustomDictionary([]),
+ });
+ }}
+ className="text-[10px] text-muted-foreground/40 hover:text-destructive transition-colors"
+ >
+ Clear all
+ </button>
+ )}
</div>
- )}
- <div className="p-4 bg-blue-50 border border-blue-200 rounded-xl">
- <h4 className="font-medium text-blue-900 mb-2">How it works</h4>
- <p className="text-sm text-blue-800 mb-3">
- Words in your custom dictionary are provided as context to the speech recognition
- model. This helps improve accuracy for uncommon names, technical jargon, brand
- names, or any words that are frequently misrecognized.
- </p>
- <p className="text-sm text-blue-800">
- <strong>Tip:</strong> For difficult words, try adding context phrases like "The word
- is Synty" alongside the word itself. Adding related terms (e.g., "Synty" and
- "SyntyStudios") also helps the model understand the intended spelling.
- </p>
+ {customDictionary.length > 0 ? (
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <div className="flex flex-wrap gap-1">
+ {customDictionary.map((word) => (
+ <span
+ key={word}
+ className="group inline-flex items-center gap-0.5 pl-2 pr-1 py-0.5 bg-primary/5 dark:bg-primary/10 text-foreground rounded-[5px] text-[11px] border border-border/30 dark:border-border-subtle transition-all hover:border-destructive/40 hover:bg-destructive/5"
+ >
+ {word}
+ <button
+ onClick={() => handleRemoveDictionaryWord(word)}
+ className="ml-0.5 p-0.5 rounded-sm text-muted-foreground/40 hover:text-destructive transition-colors"
+ title="Remove word"
+ >
+ <svg
+ width="9"
+ height="9"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2.5"
+ strokeLinecap="round"
+ >
+ <path d="M18 6L6 18M6 6l12 12" />
+ </svg>
+ </button>
+ </span>
+ ))}
+ </div>
+ </SettingsPanelRow>
+ </SettingsPanel>
+ ) : (
+ <div className="rounded-lg border border-dashed border-border/40 dark:border-border-subtle py-6 flex flex-col items-center justify-center text-center">
+ <p className="text-[11px] text-muted-foreground/50">No words added yet</p>
+ <p className="text-[10px] text-muted-foreground/40 mt-0.5">
+ Words you add will appear here
+ </p>
+ </div>
+ )}
+ </div>
+
+ {/* How it works */}
+ <div>
+ <SectionHeader title="How it works" />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <p className="text-[12px] text-muted-foreground leading-relaxed">
+ Words in your dictionary are provided as context hints to the speech recognition
+ model. This helps it correctly identify uncommon names, technical jargon, brand
+ names, or anything that's frequently misrecognized.
+ </p>
+ </SettingsPanelRow>
+ <SettingsPanelRow>
+ <p className="text-[12px] text-muted-foreground leading-relaxed">
+ <span className="font-medium text-foreground">Tip</span> β€” For difficult words,
+ add context phrases like "The word is Synty" alongside the word itself. Adding
+ related terms (e.g. "Synty" and "SyntyStudios") also helps the model understand
+ the intended spelling.
+ </p>
+ </SettingsPanelRow>
+ </SettingsPanel>
</div>
</div>
);
+ // ───────────────────────────────────────────────────
+ // AI MODELS
+ // ───────────────────────────────────────────────────
case "aiModels":
return (
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">AI Text Enhancement</h3>
- <p className="text-sm text-gray-600 mb-6">
- Configure how AI models clean up and format your transcriptions. This handles
- commands like "scratch that", creates proper lists, and fixes obvious errors while
- preserving your natural tone.
- </p>
- </div>
+ <div className="space-y-5">
+ <SectionHeader
+ title="AI Text Enhancement"
+ description='Configure how AI models clean up and format your transcriptions. Handles commands like "scratch that", creates proper lists, and fixes errors while preserving your natural tone.'
+ />
<ReasoningModelSelector
useReasoningModel={useReasoningModel}
@@ -886,8 +848,8 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
cloudReasoningBaseUrl={cloudReasoningBaseUrl}
reasoningModel={reasoningModel}
setReasoningModel={setReasoningModel}
- localReasoningProvider={localReasoningProvider}
- setLocalReasoningProvider={setLocalReasoningProvider}
+ localReasoningProvider={reasoningProvider}
+ setLocalReasoningProvider={setReasoningProvider}
openaiApiKey={openaiApiKey}
setOpenaiApiKey={setOpenaiApiKey}
anthropicApiKey={anthropicApiKey}
@@ -903,92 +865,297 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
+ // ───────────────────────────────────────────────────
+ // AGENT CONFIG
+ // ───────────────────────────────────────────────────
case "agentConfig":
return (
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">Agent Configuration</h3>
- <p className="text-sm text-gray-600 mb-6">
- Customize your AI assistant's name and behavior to make interactions more personal
- and effective.
- </p>
- </div>
+ <div className="space-y-5">
+ <SectionHeader
+ title="Voice Agent"
+ description="Name your AI assistant so you can address it directly during dictation"
+ />
- <div className="space-y-4 p-4 bg-linear-to-r from-purple-50 to-blue-50 border border-purple-200 rounded-xl">
- <h4 className="font-medium text-purple-900 mb-3">πŸ’‘ How to use agent names:</h4>
- <ul className="text-sm text-purple-800 space-y-2">
- <li>β€’ Say "Hey {agentName}, write a formal email" for specific instructions</li>
- <li>
- β€’ Use "Hey {agentName}, format this as a list" for text enhancement commands
- </li>
- <li>
- β€’ The agent will recognize when you're addressing it directly vs. dictating
- content
- </li>
- <li>
- β€’ Makes conversations feel more natural and helps distinguish commands from
- dictation
- </li>
- </ul>
+ {/* Agent Name */}
+ <div>
+ <p className="text-[13px] font-medium text-foreground mb-3">Agent Name</p>
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <div className="space-y-3">
+ <div className="flex gap-2">
+ <Input
+ placeholder="e.g. Jarvis, Nova, Atlas..."
+ value={agentName}
+ onChange={(e) => setAgentName(e.target.value)}
+ className="flex-1 text-center text-base font-mono"
+ />
+ <Button
+ onClick={() => {
+ setAgentName(agentName.trim());
+ showAlertDialog({
+ title: "Agent Name Updated",
+ description: `Your agent is now named "${agentName.trim()}". Address it by saying "Hey ${agentName.trim()}" followed by your instructions.`,
+ });
+ }}
+ disabled={!agentName.trim()}
+ size="sm"
+ >
+ Save
+ </Button>
+ </div>
+ <p className="text-[11px] text-muted-foreground/60">
+ Pick something short and natural to say aloud
+ </p>
+ </div>
+ </SettingsPanelRow>
+ </SettingsPanel>
</div>
- <div className="space-y-4 p-4 bg-gray-50 border border-gray-200 rounded-xl">
- <h4 className="font-medium text-gray-900">Current Agent Name</h4>
- <div className="flex gap-3">
- <Input
- placeholder="e.g., Assistant, Jarvis, Alex..."
- value={agentName}
- onChange={(e) => setAgentName(e.target.value)}
- className="flex-1 text-center text-lg font-mono"
- />
- <Button
- onClick={() => {
- setAgentName(agentName.trim());
- showAlertDialog({
- title: "Agent Name Updated",
- description: `Your agent is now named "${agentName.trim()}". You can address it by saying "Hey ${agentName.trim()}" followed by your instructions.`,
- });
- }}
- disabled={!agentName.trim()}
- >
- Save
- </Button>
- </div>
- <p className="text-xs text-gray-600 mt-2">
- Choose a name that feels natural to say and remember
- </p>
+ {/* How it works */}
+ <div>
+ <SectionHeader title="How it works" />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <p className="text-[12px] text-muted-foreground leading-relaxed">
+ When you say{" "}
+ <span className="font-medium text-foreground">"Hey {agentName}"</span> followed
+ by an instruction, the AI switches from cleanup mode to instruction mode.
+ Without the trigger phrase, it simply cleans up your dictation.
+ </p>
+ </SettingsPanelRow>
+ </SettingsPanel>
</div>
- <div className="bg-blue-50 p-4 rounded-lg">
- <h4 className="font-medium text-blue-900 mb-2">🎯 Example Usage:</h4>
- <div className="text-sm text-blue-800 space-y-1">
- <p>β€’ "Hey {agentName}, write an email to my team about the meeting"</p>
- <p>β€’ "Hey {agentName}, make this more professional" (after dictating text)</p>
- <p>β€’ "Hey {agentName}, convert this to bullet points"</p>
- <p>β€’ Regular dictation: "This is just normal text" (no agent name needed)</p>
- </div>
+ {/* Examples */}
+ <div>
+ <SectionHeader title="Examples" />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <div className="space-y-2.5">
+ {[
+ {
+ input: `Hey ${agentName}, write a formal email about the budget`,
+ mode: "Instruction",
+ },
+ {
+ input: `Hey ${agentName}, make this more professional`,
+ mode: "Instruction",
+ },
+ {
+ input: `Hey ${agentName}, convert this to bullet points`,
+ mode: "Instruction",
+ },
+ { input: "We should schedule a meeting for next week", mode: "Cleanup" },
+ ].map((example, i) => (
+ <div key={i} className="flex items-start gap-3">
+ <span
+ className={`shrink-0 mt-0.5 text-[10px] font-medium uppercase tracking-wider px-1.5 py-px rounded ${
+ example.mode === "Instruction"
+ ? "bg-primary/10 text-primary dark:bg-primary/15"
+ : "bg-muted text-muted-foreground"
+ }`}
+ >
+ {example.mode}
+ </span>
+ <p className="text-[12px] text-muted-foreground leading-relaxed">
+ "{example.input}"
+ </p>
+ </div>
+ ))}
+ </div>
+ </SettingsPanelRow>
+ </SettingsPanel>
</div>
</div>
);
+ // ───────────────────────────────────────────────────
+ // PROMPTS
+ // ───────────────────────────────────────────────────
case "prompts":
return (
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">Prompt Studio</h3>
- <p className="text-sm text-gray-600 mb-6">
- OpenWhispr uses a single unified system prompt that handles both text cleanup and
- instruction detection. View, customize, and test the prompt that powers your AI
- assistant.
- </p>
- </div>
+ <div className="space-y-5">
+ <SectionHeader
+ title="Prompt Studio"
+ description="View, customize, and test the unified system prompt that powers text cleanup and instruction detection"
+ />
<PromptStudio />
</div>
);
+ // ───────────────────────────────────────────────────
+ // PERMISSIONS (new β€” extracted from General)
+ // ───────────────────────────────────────────────────
+ case "permissions":
+ return (
+ <div className="space-y-5">
+ <SectionHeader
+ title="Permissions"
+ description="Test and manage system permissions required for OpenWhispr to function correctly"
+ />
+
+ {/* Permission Cards - matching onboarding style */}
+ <div className="space-y-3">
+ <PermissionCard
+ icon={Mic}
+ title="Microphone"
+ description="Required for voice recording and dictation"
+ granted={permissionsHook.micPermissionGranted}
+ onRequest={permissionsHook.requestMicPermission}
+ buttonText="Test"
+ onOpenSettings={permissionsHook.openMicPrivacySettings}
+ />
+
+ {platform === "darwin" && (
+ <PermissionCard
+ icon={Shield}
+ title="Accessibility"
+ description="Required for auto-paste to work after transcription"
+ granted={permissionsHook.accessibilityPermissionGranted}
+ onRequest={permissionsHook.testAccessibilityPermission}
+ buttonText="Test & Grant"
+ onOpenSettings={permissionsHook.openAccessibilitySettings}
+ />
+ )}
+ </div>
+
+ {/* Error state for microphone */}
+ {!permissionsHook.micPermissionGranted && permissionsHook.micPermissionError && (
+ <MicPermissionWarning
+ error={permissionsHook.micPermissionError}
+ onOpenSoundSettings={permissionsHook.openSoundInputSettings}
+ onOpenPrivacySettings={permissionsHook.openMicPrivacySettings}
+ />
+ )}
+
+ {/* Linux paste tools info */}
+ {platform === "linux" &&
+ permissionsHook.pasteToolsInfo &&
+ !permissionsHook.pasteToolsInfo.available && (
+ <PasteToolsInfo
+ pasteToolsInfo={permissionsHook.pasteToolsInfo}
+ isChecking={permissionsHook.isCheckingPasteTools}
+ onCheck={permissionsHook.checkPasteToolsAvailability}
+ />
+ )}
+
+ {/* Troubleshooting section for macOS */}
+ {platform === "darwin" && (
+ <div>
+ <p className="text-[13px] font-medium text-foreground mb-3">Troubleshooting</p>
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <SettingsRow
+ label="Reset accessibility permissions"
+ description="Fix issues after reinstalling or rebuilding the app by removing and re-adding OpenWhispr in System Settings"
+ >
+ <Button
+ onClick={resetAccessibilityPermissions}
+ variant="ghost"
+ size="sm"
+ className="text-foreground/70 hover:text-foreground"
+ >
+ Troubleshoot
+ </Button>
+ </SettingsRow>
+ </SettingsPanelRow>
+ </SettingsPanel>
+ </div>
+ )}
+ </div>
+ );
+
+ // ───────────────────────────────────────────────────
+ // DEVELOPER (+ data management moved here)
+ // ───────────────────────────────────────────────────
case "developer":
- return <DeveloperSection />;
+ return (
+ <div className="space-y-6">
+ <DeveloperSection />
+
+ {/* Data Management β€” moved from General */}
+ <div className="border-t border-border/40 pt-8">
+ <SectionHeader
+ title="Data Management"
+ description="Manage cached models and app data"
+ />
+
+ <div className="space-y-4">
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <SettingsRow label="Model cache" description={cachePathHint}>
+ <div className="flex items-center gap-2">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => window.electronAPI?.openWhisperModelsFolder?.()}
+ >
+ <FolderOpen className="mr-1.5 h-3.5 w-3.5" />
+ Open
+ </Button>
+ <Button
+ variant="destructive"
+ size="sm"
+ onClick={handleRemoveModels}
+ disabled={isRemovingModels}
+ >
+ {isRemovingModels ? "Removing..." : "Clear Cache"}
+ </Button>
+ </div>
+ </SettingsRow>
+ </SettingsPanelRow>
+ </SettingsPanel>
+
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <SettingsRow
+ label="Reset app data"
+ description="Permanently delete all settings, transcriptions, and cached data"
+ >
+ <Button
+ onClick={() => {
+ showConfirmDialog({
+ title: "Reset All App Data",
+ description:
+ "This will permanently delete ALL OpenWhispr data including:\n\n- Database and transcriptions\n- Local storage settings\n- Downloaded models\n- Environment files\n\nYou will need to manually remove app permissions in System Settings.\n\nThis action cannot be undone.",
+ onConfirm: () => {
+ window.electronAPI
+ ?.cleanupApp()
+ .then(() => {
+ showAlertDialog({
+ title: "Reset Complete",
+ description:
+ "All app data has been removed. The app will reload.",
+ });
+ setTimeout(() => {
+ window.location.reload();
+ }, 1000);
+ })
+ .catch((error) => {
+ showAlertDialog({
+ title: "Reset Failed",
+ description: `Failed to reset: ${error.message}`,
+ });
+ });
+ },
+ variant: "destructive",
+ confirmText: "Delete Everything",
+ });
+ }}
+ variant="outline"
+ size="sm"
+ className="text-destructive border-destructive/30 hover:bg-destructive/10 hover:border-destructive"
+ >
+ Reset
+ </Button>
+ </SettingsRow>
+ </SettingsPanelRow>
+ </SettingsPanel>
+ </div>
+ </div>
+ </div>
+ );
default:
return null;
diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx
index 297326e94..499e9d4fb 100644
--- a/src/components/TitleBar.tsx
+++ b/src/components/TitleBar.tsx
@@ -46,7 +46,7 @@ export default function TitleBar({
};
return (
- <div className={`bg-white border-b border-gray-100 select-none ${className}`}>
+ <div className={`bg-background border-b border-border select-none ${className}`}>
<div
className="flex items-center justify-between h-12 px-4"
style={{ WebkitAppRegion: "drag" }}
@@ -58,7 +58,7 @@ export default function TitleBar({
variant="ghost"
size="icon"
onClick={() => setShowQuitConfirm(true)}
- className="h-8 w-8 text-red-600 hover:text-red-700 hover:bg-red-50"
+ className="h-8 w-8 text-destructive hover:text-destructive/90 hover:bg-destructive/10"
title="Quit OpenWhispr"
aria-label="Quit OpenWhispr"
>
@@ -69,7 +69,7 @@ export default function TitleBar({
) : (
<>
{showTitle && title && (
- <h1 className="text-sm font-semibold text-gray-900">{title}</h1>
+ <h1 className="text-sm font-semibold text-foreground">{title}</h1>
)}
{children}
</>
@@ -88,7 +88,7 @@ export default function TitleBar({
variant="ghost"
size="icon"
onClick={() => setShowQuitConfirm(true)}
- className="h-8 w-8 text-red-600 hover:text-red-700 hover:bg-red-50"
+ className="h-8 w-8 text-destructive hover:text-destructive/90 hover:bg-destructive/10"
title="Quit OpenWhispr"
aria-label="Quit OpenWhispr"
>
diff --git a/src/components/TranscriptionModelPicker.tsx b/src/components/TranscriptionModelPicker.tsx
index ade12b2b2..20bb435c0 100644
--- a/src/components/TranscriptionModelPicker.tsx
+++ b/src/components/TranscriptionModelPicker.tsx
@@ -1,7 +1,7 @@
import { useState, useEffect, useCallback, useMemo, useRef } from "react";
import { Button } from "./ui/button";
import { Input } from "./ui/input";
-import { Download, Trash2, Check, Cloud, Lock, X } from "lucide-react";
+import { Download, Trash2, Cloud, Lock, X } from "lucide-react";
import { ProviderIcon } from "./ui/ProviderIcon";
import { ProviderTabs } from "./ui/ProviderTabs";
import ModelCardList from "./ui/ModelCardList";
@@ -17,7 +17,7 @@ import {
PARAKEET_MODEL_INFO,
} from "../models/ModelRegistry";
import { MODEL_PICKER_COLORS, type ColorScheme } from "../utils/modelPickerStyles";
-import { getProviderIcon } from "../utils/providerIcons";
+import { getProviderIcon, isMonochromeProvider } from "../utils/providerIcons";
import { API_ENDPOINTS } from "../config/constants";
import { createExternalLinkHandler } from "../utils/externalLinks";
@@ -47,9 +47,6 @@ interface LocalModelCardProps {
styles: ReturnType<(typeof MODEL_PICKER_COLORS)[keyof typeof MODEL_PICKER_COLORS]>;
}
-// Backwards compatibility alias
-type WhisperModel = LocalModel;
-
function LocalModelCard({
modelId,
name,
@@ -69,73 +66,104 @@ function LocalModelCard({
onCancel,
styles: cardStyles,
}: LocalModelCardProps) {
+ // Click to select if downloaded
+ const handleClick = () => {
+ if (isDownloaded && !isSelected) {
+ onSelect();
+ }
+ };
+
return (
<div
- className={`p-3 rounded-lg border-2 transition-all ${
+ onClick={handleClick}
+ className={`relative w-full text-left overflow-hidden rounded-lg border transition-all duration-200 group ${
isSelected ? cardStyles.modelCard.selected : cardStyles.modelCard.default
- }`}
+ } ${isDownloaded && !isSelected ? "cursor-pointer" : ""}`}
>
- <div className="flex items-center justify-between">
- <div className="flex-1">
- <div className="flex items-center gap-2">
- <ProviderIcon provider={provider} className="w-4 h-4" />
- <span className="font-medium text-gray-900">{name}</span>
- {isSelected && <span className={cardStyles.badges.selected}>βœ“ Selected</span>}
- {recommended && <span className={cardStyles.badges.recommended}>Recommended</span>}
- </div>
- <div className="flex items-center gap-2 mt-1">
- <span className="text-xs text-gray-600">{description}</span>
- <span className="text-xs text-gray-500">
- β€’ {actualSizeMb ? `${actualSizeMb}MB` : size}
+ {/* Left accent bar for selected model */}
+ {isSelected && (
+ <div className="absolute left-0 top-0 bottom-0 w-0.5 bg-primary rounded-l-lg" />
+ )}
+ <div className="flex items-center gap-2 p-2.5 pl-3">
+ {/* Status dot with LED glow */}
+ <div className="shrink-0">
+ {isDownloaded ? (
+ <div
+ className={`w-1.5 h-1.5 rounded-full ${
+ isSelected
+ ? "bg-primary shadow-[0_0_6px_oklch(0.62_0.22_260/0.6)]"
+ : "bg-success shadow-[0_0_4px_rgba(34,197,94,0.5)]"
+ }`}
+ />
+ ) : isDownloading ? (
+ <div className="w-1.5 h-1.5 rounded-full bg-amber-500 shadow-[0_0_4px_rgba(245,158,11,0.5)]" />
+ ) : (
+ <div className="w-1.5 h-1.5 rounded-full bg-muted-foreground/20" />
+ )}
+ </div>
+
+ {/* Model info - single line, no description */}
+ <div className="flex-1 min-w-0 flex items-center gap-1.5">
+ <ProviderIcon provider={provider} className="w-3.5 h-3.5 shrink-0" />
+ <span className="font-medium text-sm text-foreground truncate">{name}</span>
+ <span className="text-[10px] text-muted-foreground/60 tabular-nums shrink-0">
+ {actualSizeMb ? `${actualSizeMb}MB` : size}
+ </span>
+ {recommended && <span className={cardStyles.badges.recommended}>Recommended</span>}
+ {languageLabel && (
+ <span className="text-[10px] text-muted-foreground/50 font-medium shrink-0">
+ {languageLabel}
</span>
- {languageLabel && <span className="text-xs text-blue-600">{languageLabel}</span>}
- {isDownloaded && (
- <span className={cardStyles.badges.downloaded}>
- <Check className="inline w-3 h-3 mr-1" />
- Downloaded
- </span>
- )}
- </div>
+ )}
</div>
- <div className="flex gap-2">
+ {/* Actions */}
+ <div className="flex items-center gap-1.5 shrink-0">
{isDownloaded ? (
<>
- {!isSelected && (
- <Button
- onClick={onSelect}
- size="sm"
- variant="outline"
- className={cardStyles.buttons.select}
- >
- Select
- </Button>
+ {isSelected && (
+ <span className="text-[10px] font-medium text-primary px-2 py-0.5 bg-primary/10 rounded-sm">
+ Active
+ </span>
)}
<Button
- onClick={onDelete}
+ onClick={(e) => {
+ e.stopPropagation();
+ onDelete();
+ }}
size="sm"
- variant="outline"
- className={cardStyles.buttons.delete}
+ variant="ghost"
+ className="h-6 w-6 p-0 text-muted-foreground/40 hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity"
>
- <Trash2 size={14} />
- <span className="ml-1">Delete</span>
+ <Trash2 size={12} />
</Button>
</>
) : isDownloading ? (
<Button
- onClick={onCancel}
+ onClick={(e) => {
+ e.stopPropagation();
+ onCancel();
+ }}
disabled={isCancelling}
size="sm"
variant="outline"
- className="text-red-600 border-red-300 hover:bg-red-50"
+ className="h-6 px-2.5 text-[11px] text-destructive border-destructive/25 hover:bg-destructive/8"
>
- <X size={14} />
- <span className="ml-1">{isCancelling ? "..." : "Cancel"}</span>
+ <X size={11} className="mr-0.5" />
+ {isCancelling ? "..." : "Cancel"}
</Button>
) : (
- <Button onClick={onDownload} size="sm" className={cardStyles.buttons.download}>
- <Download size={14} />
- <span className="ml-1">Download</span>
+ <Button
+ onClick={(e) => {
+ e.stopPropagation();
+ onDownload();
+ }}
+ size="sm"
+ variant="default"
+ className="h-6 px-2.5 text-[11px]"
+ >
+ <Download size={11} className="mr-1" />
+ Download
</Button>
)}
</div>
@@ -169,7 +197,7 @@ interface TranscriptionModelPickerProps {
const CLOUD_PROVIDER_TABS = [
{ id: "openai", name: "OpenAI" },
- { id: "groq", name: "Groq" },
+ { id: "groq", name: "Groq", recommended: true },
{ id: "custom", name: "Custom" },
];
@@ -180,6 +208,43 @@ const LOCAL_PROVIDER_TABS = [
{ id: "nvidia", name: "NVIDIA Parakeet" },
];
+// Mode toggle component - defined outside to prevent recreation on every render
+interface ModeToggleProps {
+ useLocalWhisper: boolean;
+ onModeChange: (useLocal: boolean) => void;
+}
+
+function ModeToggle({ useLocalWhisper, onModeChange }: ModeToggleProps) {
+ return (
+ <div className="relative flex p-0.5 rounded-lg bg-surface-raised dark:bg-white/3 border border-border dark:border-white/5">
+ {/* Sliding indicator */}
+ <div
+ className={`absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] rounded-md bg-white dark:bg-white/10 border border-border-hover dark:border-white/15 shadow-[0_1px_2px_rgba(0,0,0,0.06)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.1)] transition-transform duration-200 ease-out ${
+ useLocalWhisper ? "translate-x-[calc(100%+4px)]" : "translate-x-0"
+ }`}
+ />
+ <button
+ onClick={() => onModeChange(false)}
+ className={`relative z-10 flex-1 flex items-center justify-center gap-1.5 py-2 rounded-md transition-colors duration-150 ${
+ !useLocalWhisper ? "text-foreground" : "text-muted-foreground hover:text-foreground"
+ }`}
+ >
+ <Cloud className="w-3.5 h-3.5" />
+ <span className="text-xs font-medium">Cloud</span>
+ </button>
+ <button
+ onClick={() => onModeChange(true)}
+ className={`relative z-10 flex-1 flex items-center justify-center gap-1.5 py-2 rounded-md transition-colors duration-150 ${
+ useLocalWhisper ? "text-foreground" : "text-muted-foreground hover:text-foreground"
+ }`}
+ >
+ <Lock className="w-3.5 h-3.5" />
+ <span className="text-xs font-medium">Local</span>
+ </button>
+ </div>
+ );
+}
+
export default function TranscriptionModelPicker({
selectedCloudProvider,
onCloudProviderSelect,
@@ -202,11 +267,18 @@ export default function TranscriptionModelPicker({
className = "",
variant = "settings",
}: TranscriptionModelPickerProps) {
- const [localModels, setLocalModels] = useState<WhisperModel[]>([]);
- const [parakeetModels, setParakeetModels] = useState<WhisperModel[]>([]);
+ const [localModels, setLocalModels] = useState<LocalModel[]>([]);
+ const [parakeetModels, setParakeetModels] = useState<LocalModel[]>([]);
const [internalLocalProvider, setInternalLocalProvider] = useState(selectedLocalProvider);
const hasLoadedRef = useRef(false);
const hasLoadedParakeetRef = useRef(false);
+
+ // Sync internal state with prop when it changes externally
+ useEffect(() => {
+ if (selectedLocalProvider !== internalLocalProvider) {
+ setInternalLocalProvider(selectedLocalProvider);
+ }
+ }, [selectedLocalProvider]);
const isLoadingRef = useRef(false);
const isLoadingParakeetRef = useRef(false);
const loadLocalModelsRef = useRef<(() => Promise<void>) | null>(null);
@@ -227,7 +299,7 @@ export default function TranscriptionModelPicker({
onLocalModelSelectRef.current = onLocalModelSelect;
}, [onLocalModelSelect]);
- const validateAndSelectModel = useCallback((loadedModels: WhisperModel[]) => {
+ const validateAndSelectModel = useCallback((loadedModels: LocalModel[]) => {
const current = selectedLocalModelRef.current;
if (!current) return;
@@ -324,22 +396,29 @@ export default function TranscriptionModelPicker({
ensureValidCloudSelectionRef.current = ensureValidCloudSelection;
}, [ensureValidCloudSelection]);
+ // Handle local model loading when in local mode
useEffect(() => {
- if (useLocalWhisper) {
- if (internalLocalProvider === "whisper" && !hasLoadedRef.current) {
- hasLoadedRef.current = true;
- loadLocalModelsRef.current?.();
- } else if (internalLocalProvider === "nvidia" && !hasLoadedParakeetRef.current) {
- hasLoadedParakeetRef.current = true;
- loadParakeetModelsRef.current?.();
- }
- } else {
- hasLoadedRef.current = false;
- hasLoadedParakeetRef.current = false;
- ensureValidCloudSelectionRef.current?.();
+ if (!useLocalWhisper) return;
+
+ if (internalLocalProvider === "whisper" && !hasLoadedRef.current) {
+ hasLoadedRef.current = true;
+ loadLocalModelsRef.current?.();
+ } else if (internalLocalProvider === "nvidia" && !hasLoadedParakeetRef.current) {
+ hasLoadedParakeetRef.current = true;
+ loadParakeetModelsRef.current?.();
}
}, [useLocalWhisper, internalLocalProvider]);
+ // Handle cloud mode initialization - only when switching to cloud mode
+ useEffect(() => {
+ if (useLocalWhisper) return;
+
+ // Reset local model load flags when switching to cloud
+ hasLoadedRef.current = false;
+ hasLoadedParakeetRef.current = false;
+ ensureValidCloudSelectionRef.current?.();
+ }, [useLocalWhisper]);
+
useEffect(() => {
const handleModelsCleared = () => loadLocalModels();
window.addEventListener("openwhispr-models-cleared", handleModelsCleared);
@@ -502,6 +581,7 @@ export default function TranscriptionModelPicker({
label: m.name,
description: m.description,
icon: getProviderIcon(selectedCloudProvider),
+ invertInDark: isMonochromeProvider(selectedCloudProvider),
}));
}, [currentCloudProvider, selectedCloudProvider]);
@@ -515,7 +595,6 @@ export default function TranscriptionModelPicker({
modelName={modelInfo?.name || downloadingModel}
progress={downloadProgress}
isInstalling={isInstalling}
- styles={styles}
/>
);
}
@@ -527,7 +606,6 @@ export default function TranscriptionModelPicker({
modelName={modelInfo?.name || downloadingParakeetModel}
progress={parakeetDownloadProgress}
isInstalling={isInstallingParakeet}
- styles={styles}
/>
);
}
@@ -542,43 +620,53 @@ export default function TranscriptionModelPicker({
isInstallingParakeet,
useLocalWhisper,
internalLocalProvider,
- styles,
]);
- const renderLocalModels = () => (
- <div className="space-y-2">
- {localModels.map((model) => {
- const modelId = model.model;
- const info = WHISPER_MODEL_INFO[modelId] || {
- name: modelId,
- description: "Model",
- size: "Unknown",
- };
-
- return (
- <LocalModelCard
- key={modelId}
- modelId={modelId}
- name={info.name}
- description={info.description}
- size={info.size}
- actualSizeMb={model.size_mb}
- isSelected={modelId === selectedLocalModel}
- isDownloaded={model.downloaded ?? false}
- isDownloading={isDownloadingModel(modelId)}
- isCancelling={isCancelling}
- recommended={info.recommended}
- provider="whisper"
- onSelect={() => handleWhisperModelSelect(modelId)}
- onDelete={() => handleDelete(modelId)}
- onDownload={() => downloadModel(modelId, handleWhisperModelSelect)}
- onCancel={cancelDownload}
- styles={styles}
- />
- );
- })}
- </div>
- );
+ const renderLocalModels = () => {
+ const modelsToRender =
+ localModels.length === 0
+ ? Object.entries(WHISPER_MODEL_INFO).map(([modelId, info]) => ({
+ model: modelId,
+ downloaded: false,
+ size_mb: info.sizeMb,
+ }))
+ : localModels;
+
+ return (
+ <div className="space-y-1">
+ {modelsToRender.map((model) => {
+ const modelId = model.model;
+ const info = WHISPER_MODEL_INFO[modelId] || {
+ name: modelId,
+ description: "Model",
+ size: "Unknown",
+ };
+
+ return (
+ <LocalModelCard
+ key={modelId}
+ modelId={modelId}
+ name={info.name}
+ description={info.description}
+ size={info.size}
+ actualSizeMb={model.size_mb}
+ isSelected={modelId === selectedLocalModel}
+ isDownloaded={model.downloaded ?? false}
+ isDownloading={isDownloadingModel(modelId)}
+ isCancelling={isCancelling}
+ recommended={info.recommended}
+ provider="whisper"
+ onSelect={() => handleWhisperModelSelect(modelId)}
+ onDelete={() => handleDelete(modelId)}
+ onDownload={() => downloadModel(modelId, handleWhisperModelSelect)}
+ onCancel={cancelDownload}
+ styles={styles}
+ />
+ );
+ })}
+ </div>
+ );
+ };
const handleParakeetDelete = useCallback(
(modelId: string) => {
@@ -617,7 +705,7 @@ export default function TranscriptionModelPicker({
: parakeetModels;
return (
- <div className="space-y-2">
+ <div className="space-y-1">
{modelsToRender.map((model) => {
const modelId = model.model;
const info = PARAKEET_MODEL_INFO[modelId] || {
@@ -654,100 +742,14 @@ export default function TranscriptionModelPicker({
);
};
- const renderLocalProviderTab = (
- provider: (typeof LOCAL_PROVIDER_TABS)[0],
- isSelected: boolean
- ) => {
- const isDisabled = provider.disabled;
- const tabColorScheme = colorScheme === "purple" ? "purple" : "indigo";
- const colors = {
- purple: { text: "text-purple-700", border: "rgb(147 51 234)", bg: "rgb(250 245 255)" },
- indigo: { text: "text-indigo-700", border: "rgb(99 102 241)", bg: "rgb(238 242 255)" },
- };
- const tabColors = colors[tabColorScheme];
-
- return (
- <button
- key={provider.id}
- onClick={() => !isDisabled && handleLocalProviderChange(provider.id)}
- className={`flex-1 flex items-center justify-center gap-2 px-4 py-3 font-medium transition-all whitespace-nowrap ${
- isDisabled
- ? "text-gray-600 cursor-default"
- : isSelected
- ? `${tabColors.text} border-b-2`
- : "text-gray-600 hover:bg-gray-100"
- }`}
- style={
- isSelected && !isDisabled
- ? { borderBottomColor: tabColors.border, backgroundColor: tabColors.bg }
- : undefined
- }
- >
- <ProviderIcon provider={provider.id} className="w-5 h-5" />
- <span>{provider.name}</span>
- {provider.badge && (
- <span className="text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full">
- {provider.badge}
- </span>
- )}
- </button>
- );
- };
-
return (
- <div className={`space-y-4 ${className}`}>
- {/* Only show mode selector in settings, not in onboarding (which has its own) */}
- {variant === "settings" && (
- <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
- <button
- onClick={() => handleModeChange(false)}
- className={`p-4 border-2 rounded-xl text-left transition-all cursor-pointer ${
- !useLocalWhisper
- ? "border-purple-500 bg-purple-50"
- : "border-neutral-200 bg-white hover:border-neutral-300"
- }`}
- >
- <div className="flex items-center justify-between mb-2">
- <div className="flex items-center gap-3">
- <Cloud className="w-6 h-6 text-blue-600" />
- <h4 className="font-medium text-neutral-900">Cloud</h4>
- </div>
- <span className="text-xs text-green-600 bg-green-100 px-2 py-1 rounded-full">
- Fast
- </span>
- </div>
- <p className="text-sm text-neutral-600">
- Transcription via API. Fast and accurate, requires internet.
- </p>
- </button>
-
- <button
- onClick={() => handleModeChange(true)}
- className={`p-4 border-2 rounded-xl text-left transition-all cursor-pointer ${
- useLocalWhisper
- ? "border-purple-500 bg-purple-50"
- : "border-neutral-200 bg-white hover:border-neutral-300"
- }`}
- >
- <div className="flex items-center justify-between mb-2">
- <div className="flex items-center gap-3">
- <Lock className="w-6 h-6 text-purple-600" />
- <h4 className="font-medium text-neutral-900">Local</h4>
- </div>
- <span className="text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full">
- Private
- </span>
- </div>
- <p className="text-sm text-neutral-600">
- Runs on your device. Complete privacy, works offline.
- </p>
- </button>
- </div>
- )}
+ <div className={`space-y-3 ${className}`}>
+ {/* Integrated mode toggle - always visible */}
+ <ModeToggle useLocalWhisper={useLocalWhisper} onModeChange={handleModeChange} />
{!useLocalWhisper ? (
- <div className="space-y-4">
- <div className={styles.container}>
+ <div className={styles.container}>
+ <div className="p-2.5 pb-0">
<ProviderTabs
providers={CLOUD_PROVIDER_TABS}
selectedId={selectedCloudProvider}
@@ -755,123 +757,96 @@ export default function TranscriptionModelPicker({
colorScheme={colorScheme === "purple" ? "purple" : "indigo"}
scrollable
/>
+ </div>
- <div className="p-4">
- {selectedCloudProvider === "custom" ? (
- <div className="space-y-4">
- <div className="space-y-3">
- <h4 className="text-sm font-medium text-gray-700">
- Custom Endpoint Configuration
- </h4>
- <p className="text-xs text-gray-500">
- Connect to any OpenAI-compatible transcription API.
- </p>
- </div>
-
- {/* 1. Endpoint URL - TOP */}
- <div className="space-y-3">
- <h4 className="font-medium text-gray-900">Endpoint URL</h4>
- <Input
- value={cloudTranscriptionBaseUrl}
- onChange={(e) => setCloudTranscriptionBaseUrl?.(e.target.value)}
- onBlur={handleBaseUrlBlur}
- placeholder="https://your-api.example.com/v1"
- className="text-sm"
- />
- <p className="text-xs text-gray-500">
- Examples: <code className="text-purple-600">http://localhost:11434/v1</code>{" "}
- (Ollama), <code className="text-purple-600">http://localhost:8080/v1</code>{" "}
- (LocalAI).
- <br />
- Known providers (Groq, OpenAI) will be auto-detected.
- </p>
- </div>
-
- {/* 2. API Key - SECOND */}
- <div className="space-y-3 pt-4">
- <h4 className="font-medium text-gray-900">API Key (Optional)</h4>
- <ApiKeyInput
- apiKey={customTranscriptionApiKey}
- setApiKey={setCustomTranscriptionApiKey || (() => {})}
- label=""
- helpText="Optional. Sent as a Bearer token for authentication. This is separate from your OpenAI API key."
- />
- </div>
+ <div className="p-3">
+ {selectedCloudProvider === "custom" ? (
+ <div className="space-y-3">
+ {/* Endpoint URL */}
+ <div className="space-y-1.5">
+ <label className="block text-xs font-medium text-foreground">Endpoint URL</label>
+ <Input
+ value={cloudTranscriptionBaseUrl}
+ onChange={(e) => setCloudTranscriptionBaseUrl?.(e.target.value)}
+ onBlur={handleBaseUrlBlur}
+ placeholder="https://your-api.example.com/v1"
+ className="h-8 text-sm"
+ />
+ </div>
- {/* 3. Model Name - THIRD */}
- <div className="space-y-2 pt-4">
- <label className="block text-sm font-medium text-gray-700">Model Name</label>
- <Input
- value={selectedCloudModel}
- onChange={(e) => onCloudModelSelect(e.target.value)}
- placeholder="whisper-1"
- className="text-sm"
- />
- <p className="text-xs text-gray-500">
- The model name supported by your endpoint (defaults to whisper-1).
- </p>
- </div>
+ {/* API Key */}
+ <ApiKeyInput
+ apiKey={customTranscriptionApiKey}
+ setApiKey={setCustomTranscriptionApiKey || (() => {})}
+ label="API Key (Optional)"
+ helpText=""
+ />
+
+ {/* Model Name */}
+ <div className="space-y-1.5">
+ <label className="block text-xs font-medium text-foreground">Model</label>
+ <Input
+ value={selectedCloudModel}
+ onChange={(e) => onCloudModelSelect(e.target.value)}
+ placeholder="whisper-1"
+ className="h-8 text-sm"
+ />
</div>
- ) : (
- <>
- {/* API Configuration First */}
- <div className="space-y-3 mb-4">
- <div className="flex items-baseline justify-between">
- <h4 className="font-medium text-gray-900">API Key</h4>
- <a
- href={
- selectedCloudProvider === "groq"
- ? "https://console.groq.com/keys"
- : "https://platform.openai.com/api-keys"
- }
- target="_blank"
- rel="noopener noreferrer"
- onClick={createExternalLinkHandler(
- selectedCloudProvider === "groq"
- ? "https://console.groq.com/keys"
- : "https://platform.openai.com/api-keys"
- )}
- className="text-xs text-blue-600 hover:text-blue-700 underline cursor-pointer"
- >
- Get your API key β†’
- </a>
- </div>
- <ApiKeyInput
- apiKey={selectedCloudProvider === "groq" ? groqApiKey : openaiApiKey}
- setApiKey={selectedCloudProvider === "groq" ? setGroqApiKey : setOpenaiApiKey}
- label=""
- helpText=""
- />
+ </div>
+ ) : (
+ <div className="space-y-3">
+ {/* API Key with inline link */}
+ <div className="space-y-1.5">
+ <div className="flex items-center justify-between">
+ <label className="text-xs font-medium text-foreground">API Key</label>
+ <button
+ type="button"
+ onClick={createExternalLinkHandler(
+ selectedCloudProvider === "groq"
+ ? "https://console.groq.com/keys"
+ : "https://platform.openai.com/api-keys"
+ )}
+ className="text-[11px] text-white/70 hover:text-white transition-colors cursor-pointer"
+ >
+ Get key β†’
+ </button>
</div>
+ <ApiKeyInput
+ apiKey={selectedCloudProvider === "groq" ? groqApiKey : openaiApiKey}
+ setApiKey={selectedCloudProvider === "groq" ? setGroqApiKey : setOpenaiApiKey}
+ label=""
+ helpText=""
+ />
+ </div>
- {/* Model Selection Below */}
- <div className="pt-4 space-y-3">
- <h4 className="text-sm font-medium text-gray-700">Select Model</h4>
- <ModelCardList
- models={cloudModelOptions}
- selectedModel={selectedCloudModel}
- onModelSelect={onCloudModelSelect}
- colorScheme={colorScheme === "purple" ? "purple" : "indigo"}
- />
- </div>
- </>
- )}
- </div>
+ {/* Model Selection */}
+ <div className="space-y-1.5">
+ <label className="text-xs font-medium text-foreground">Model</label>
+ <ModelCardList
+ models={cloudModelOptions}
+ selectedModel={selectedCloudModel}
+ onModelSelect={onCloudModelSelect}
+ colorScheme={colorScheme === "purple" ? "purple" : "indigo"}
+ />
+ </div>
+ </div>
+ )}
</div>
</div>
) : (
<div className={styles.container}>
- <div className="flex bg-gray-50 border-b border-gray-200">
- {LOCAL_PROVIDER_TABS.map((provider) =>
- renderLocalProviderTab(provider, internalLocalProvider === provider.id)
- )}
+ <div className="p-2.5 pb-0">
+ <ProviderTabs
+ providers={LOCAL_PROVIDER_TABS}
+ selectedId={internalLocalProvider}
+ onSelect={handleLocalProviderChange}
+ colorScheme={colorScheme === "purple" ? "purple" : "indigo"}
+ />
</div>
{progressDisplay}
- <div className="p-4">
- <h5 className={`${styles.header} mb-3`}>Available Models</h5>
-
+ <div className="p-3">
{internalLocalProvider === "whisper" && renderLocalModels()}
{internalLocalProvider === "nvidia" && renderParakeetModels()}
</div>
diff --git a/src/components/WindowControls.tsx b/src/components/WindowControls.tsx
index 866324670..4f060c930 100644
--- a/src/components/WindowControls.tsx
+++ b/src/components/WindowControls.tsx
@@ -88,7 +88,7 @@ export default function WindowControls() {
variant="ghost"
size="icon"
onClick={handleClose}
- className="h-8 w-8 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-950"
+ className="h-8 w-8 hover:text-destructive hover:bg-destructive/10"
title="Close"
>
<X size={14} />
diff --git a/src/components/ui/ActivationModeSelector.tsx b/src/components/ui/ActivationModeSelector.tsx
index b711b4b1d..9ffd85068 100644
--- a/src/components/ui/ActivationModeSelector.tsx
+++ b/src/components/ui/ActivationModeSelector.tsx
@@ -6,71 +6,68 @@ interface ActivationModeSelectorProps {
value: ActivationMode;
onChange: (mode: ActivationMode) => void;
disabled?: boolean;
+ /** Compact variant for inline use */
+ variant?: "default" | "compact";
}
export function ActivationModeSelector({
value,
onChange,
disabled = false,
+ variant = "default",
}: ActivationModeSelectorProps) {
+ const isCompact = variant === "compact";
+
return (
- <div className="space-y-3">
+ <div
+ className={`
+ relative flex rounded-md border transition-all duration-200
+ bg-surface-1 border-border-subtle
+ ${isCompact ? "p-0.5" : "p-0.5"}
+ ${disabled ? "opacity-50 cursor-not-allowed" : ""}
+ `}
+ >
+ {/* Sliding indicator */}
<div
className={`
- relative flex rounded-xl border-2 p-1 transition-all duration-200
- ${disabled ? "bg-gray-50 border-gray-200 opacity-60" : "bg-gray-100/50 border-gray-200"}
+ absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] rounded
+ bg-surface-raised border border-border-subtle
+ transition-transform duration-200 ease-out
+ ${value === "push" ? "translate-x-[calc(100%+4px)]" : "translate-x-0"}
`}
- >
- <div
- className={`
- absolute top-1 bottom-1 w-[calc(50%-4px)] rounded-lg bg-white shadow-sm
- transition-transform duration-200 ease-out
- ${value === "push" ? "translate-x-[calc(100%+8px)]" : "translate-x-0"}
- `}
- />
-
- <button
- type="button"
- disabled={disabled}
- onClick={() => onChange("tap")}
- className={`
- relative z-10 flex-1 flex flex-col items-center gap-1 px-4 py-3 rounded-lg
- transition-colors duration-200
- ${disabled ? "cursor-not-allowed" : "cursor-pointer"}
- ${value === "tap" ? "text-gray-900" : "text-gray-500 hover:text-gray-700"}
- `}
- >
- <div className="flex items-center gap-2">
- <MousePointerClick className="w-5 h-5" />
- <span className="font-medium text-sm">Tap to Talk</span>
- </div>
- <span className="text-xs text-gray-400">Tap on, tap off</span>
- </button>
+ />
- <button
- type="button"
- disabled={disabled}
- onClick={() => onChange("push")}
- className={`
- relative z-10 flex-1 flex flex-col items-center gap-1 px-4 py-3 rounded-lg
- transition-colors duration-200
- ${disabled ? "cursor-not-allowed" : "cursor-pointer"}
- ${value === "push" ? "text-gray-900" : "text-gray-500 hover:text-gray-700"}
- `}
- >
- <div className="flex items-center gap-2">
- <MicVocal className="w-5 h-5" />
- <span className="font-medium text-sm">Push to Talk</span>
- </div>
- <span className="text-xs text-gray-400">Hold to record</span>
- </button>
- </div>
+ <button
+ type="button"
+ disabled={disabled}
+ onClick={() => onChange("tap")}
+ className={`
+ relative z-10 flex-1 flex items-center justify-center gap-1.5 rounded
+ transition-colors duration-150
+ ${isCompact ? "px-2.5 py-1.5" : "px-3 py-2"}
+ ${disabled ? "cursor-not-allowed" : "cursor-pointer"}
+ ${value === "tap" ? "text-foreground" : "text-muted-foreground hover:text-foreground"}
+ `}
+ >
+ <MousePointerClick className={isCompact ? "w-3.5 h-3.5" : "w-4 h-4"} />
+ <span className={`font-medium ${isCompact ? "text-xs" : "text-sm"}`}>Tap</span>
+ </button>
- <p className="text-xs text-gray-500 text-center">
- {value === "tap"
- ? "Press hotkey to start recording, press again to stop"
- : "Hold hotkey while speaking, release to process"}
- </p>
+ <button
+ type="button"
+ disabled={disabled}
+ onClick={() => onChange("push")}
+ className={`
+ relative z-10 flex-1 flex items-center justify-center gap-1.5 rounded
+ transition-colors duration-150
+ ${isCompact ? "px-2.5 py-1.5" : "px-3 py-2"}
+ ${disabled ? "cursor-not-allowed" : "cursor-pointer"}
+ ${value === "push" ? "text-foreground" : "text-muted-foreground hover:text-foreground"}
+ `}
+ >
+ <MicVocal className={isCompact ? "w-3.5 h-3.5" : "w-4 h-4"} />
+ <span className={`font-medium ${isCompact ? "text-xs" : "text-sm"}`}>Hold</span>
+ </button>
</div>
);
}
diff --git a/src/components/ui/ApiKeyInput.tsx b/src/components/ui/ApiKeyInput.tsx
index 2f19c5bcc..2e9a77136 100644
--- a/src/components/ui/ApiKeyInput.tsx
+++ b/src/components/ui/ApiKeyInput.tsx
@@ -1,7 +1,6 @@
import React from "react";
-import { Button } from "./button";
+import { Check } from "lucide-react";
import { Input } from "./input";
-import { useClipboard } from "../../hooks/useClipboard";
interface ApiKeyInputProps {
apiKey: string;
@@ -22,33 +21,27 @@ export default function ApiKeyInput({
helpText = "Get your API key from platform.openai.com",
variant = "default",
}: ApiKeyInputProps) {
- const { pasteFromClipboardWithFallback } = useClipboard();
-
- const variantClasses = variant === "purple" ? "border-purple-300 focus:border-purple-500" : "";
-
- const buttonVariantClasses =
- variant === "purple" ? "border-purple-300 text-purple-700 hover:bg-purple-50" : "";
+ const hasKey = apiKey.length > 0;
+ const variantClasses = variant === "purple" ? "border-primary focus:border-primary" : "";
return (
<div className={className}>
- <label className="block text-sm font-medium text-neutral-700 mb-2">{label}</label>
- <div className="flex gap-3">
+ {label && <label className="block text-xs font-medium text-foreground mb-1">{label}</label>}
+ <div className="relative">
<Input
type="password"
placeholder={placeholder}
value={apiKey}
onChange={(e) => setApiKey(e.target.value)}
- className={`flex-1 ${variantClasses}`}
+ className={`h-8 text-sm ${hasKey ? "pr-8" : ""} ${variantClasses}`}
/>
- <Button
- variant="outline"
- onClick={() => pasteFromClipboardWithFallback(setApiKey)}
- className={buttonVariantClasses}
- >
- Paste
- </Button>
+ {hasKey && (
+ <div className="absolute right-2.5 top-1/2 -translate-y-1/2">
+ <Check className="w-3.5 h-3.5 text-success" />
+ </div>
+ )}
</div>
- {helpText && <p className="text-xs text-neutral-600 mt-2">{helpText}</p>}
+ {helpText && <p className="text-[11px] text-muted-foreground/70 mt-1">{helpText}</p>}
</div>
);
}
diff --git a/src/components/ui/DownloadProgressBar.tsx b/src/components/ui/DownloadProgressBar.tsx
index fcb3847c0..8410e0f27 100644
--- a/src/components/ui/DownloadProgressBar.tsx
+++ b/src/components/ui/DownloadProgressBar.tsx
@@ -1,42 +1,69 @@
import { formatETA, type DownloadProgress } from "../../hooks/useModelDownload";
-import { type ModelPickerStyles } from "../../utils/modelPickerStyles";
-
interface DownloadProgressBarProps {
modelName: string;
progress: DownloadProgress;
- styles: ModelPickerStyles;
isInstalling?: boolean;
}
export function DownloadProgressBar({
modelName,
progress,
- styles,
isInstalling,
}: DownloadProgressBarProps) {
const { percentage, speed, eta } = progress;
- const progressText = `${Math.round(percentage)}%`;
- const speedText = speed ? ` β€’ ${speed.toFixed(1)} MB/s` : "";
- const etaText = eta ? ` β€’ ETA: ${formatETA(eta)}` : "";
-
- const label = isInstalling ? `Installing ${modelName}...` : `Downloading ${modelName}...`;
+ const pct = Math.round(percentage);
+ const speedText = speed ? `${speed.toFixed(1)} MB/s` : "";
+ const etaText = eta ? formatETA(eta) : "";
return (
- <div className={`${styles.progress} p-3`}>
- <div className="flex items-center justify-between mb-2">
- <span className={`text-sm font-medium ${styles.progressText}`}>{label}</span>
- {!isInstalling && (
- <span className={`text-xs ${styles.progressText}`}>
- {progressText}
- {speedText}
- {etaText}
+ <div className="px-2.5 py-2 border-b border-white/5 dark:border-border-subtle">
+ <div className="flex items-center gap-2 mb-2">
+ {/* Compact percentage with LED glow */}
+ <div className="relative flex items-center justify-center w-6 h-6">
+ <div
+ className={`absolute inset-0 rounded-md bg-primary/15 ${isInstalling ? "animate-pulse" : ""}`}
+ />
+ <span className="relative text-[10px] font-bold text-primary tabular-nums">
+ {isInstalling ? "..." : `${pct}%`}
</span>
- )}
+ </div>
+ <div className="flex-1 min-w-0">
+ <p className="text-xs font-medium text-foreground truncate">
+ {isInstalling ? `Installing ${modelName}` : `Downloading ${modelName}`}
+ </p>
+ {!isInstalling && (speedText || etaText) && (
+ <div className="flex items-center gap-1.5 mt-0.5">
+ {speedText && (
+ <span className="text-[10px] text-muted-foreground/70 tabular-nums">
+ {speedText}
+ </span>
+ )}
+ {etaText && (
+ <>
+ <span className="text-[10px] text-muted-foreground/30">Β·</span>
+ <span className="text-[10px] text-muted-foreground/70 tabular-nums">
+ {etaText}
+ </span>
+ </>
+ )}
+ </div>
+ )}
+ </div>
</div>
- <div className={`w-full ${styles.progressBar} rounded-full h-2`}>
+
+ {/* Progress bar - thinner, premium */}
+ <div
+ className="w-full rounded-full overflow-hidden bg-white/5 dark:bg-white/3"
+ style={{ height: 4 }}
+ >
<div
- className={`${styles.progressFill} h-2 rounded-full transition-all duration-300 ease-out ${isInstalling ? "animate-pulse" : ""}`}
- style={{ width: `${isInstalling ? 100 : Math.min(percentage, 100)}%` }}
+ className={`${isInstalling ? "animate-pulse" : ""} bg-primary shadow-[0_0_8px_oklch(0.62_0.22_260/0.4)]`}
+ style={{
+ height: "100%",
+ width: `${isInstalling ? 100 : Math.min(percentage, 100)}%`,
+ borderRadius: 9999,
+ transition: "width 300ms ease-out",
+ }}
/>
</div>
</div>
diff --git a/src/components/ui/HotkeyInput.tsx b/src/components/ui/HotkeyInput.tsx
index cafc183a1..25f139aac 100644
--- a/src/components/ui/HotkeyInput.tsx
+++ b/src/components/ui/HotkeyInput.tsx
@@ -170,13 +170,18 @@ export function mapKeyboardEventToHotkey(e: KeyboardEvent): string | null {
return modifiers.length > 0 ? [...modifiers, baseKey].join("+") : baseKey;
}
+export interface HotkeyInputVariant {
+ variant?: "default" | "hero";
+}
+
export function HotkeyInput({
value,
onChange,
onBlur,
disabled = false,
autoFocus = false,
-}: HotkeyInputProps) {
+ variant = "default",
+}: HotkeyInputProps & HotkeyInputVariant) {
const [isCapturing, setIsCapturing] = useState(false);
const [activeModifiers, setActiveModifiers] = useState<Set<string>>(new Set());
const containerRef = useRef<HTMLDivElement>(null);
@@ -254,11 +259,11 @@ export function HotkeyInput({
const displayValue = formatHotkeyLabel(value);
const isGlobe = value === "GLOBE";
-
const hotkeyParts = value?.includes("+") ? displayValue.split("+") : [];
- return (
- <div className="space-y-3">
+ // Hero variant: large centered key display for onboarding
+ if (variant === "hero") {
+ return (
<div
ref={containerRef}
tabIndex={disabled ? -1 : 0}
@@ -269,99 +274,169 @@ export function HotkeyInput({
onFocus={handleFocus}
onBlur={handleBlur}
className={`
- relative overflow-hidden
- rounded-xl border-2
- transition-all duration-300 ease-out
- cursor-pointer select-none
- focus:outline-none
+ relative group flex flex-col items-center justify-center py-5 px-6
+ rounded-lg border cursor-pointer select-none outline-none
+ transition-all duration-200
${
disabled
- ? "bg-gray-50 border-gray-200 cursor-not-allowed opacity-60"
+ ? "bg-muted/30 border-border cursor-not-allowed opacity-50"
: isCapturing
- ? "bg-gradient-to-br from-indigo-50 to-purple-50 border-indigo-400 shadow-lg shadow-indigo-100"
- : "bg-white border-gray-200 hover:border-gray-300 hover:shadow-md"
+ ? "bg-primary/5 border-primary/40"
+ : "bg-surface-1 border-border-subtle hover:border-border-hover hover:bg-surface-2"
}
`}
>
- {isCapturing && (
- <div className="absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-indigo-500 via-purple-500 to-indigo-500 animate-pulse" />
- )}
-
- <div className="px-6 py-5">
- {isCapturing ? (
- <div className="space-y-3">
- <div className="flex items-center justify-center gap-2">
- <div className="w-2 h-2 bg-red-500 rounded-full animate-pulse" />
- <span className="text-sm font-medium text-gray-600">Recording</span>
+ {/* Recording state */}
+ {isCapturing ? (
+ <div className="flex flex-col items-center gap-3">
+ <div className="flex items-center gap-2">
+ <div className="w-2 h-2 bg-primary rounded-full animate-pulse" />
+ <span className="text-xs font-medium text-primary">Listening...</span>
+ </div>
+ {activeModifiers.size > 0 ? (
+ <div className="flex items-center gap-1.5">
+ {Array.from(activeModifiers).map((mod) => (
+ <kbd
+ key={mod}
+ className="px-3 py-1.5 bg-primary/10 border border-primary/20 rounded text-sm font-semibold text-primary"
+ >
+ {mod}
+ </kbd>
+ ))}
+ <span className="text-primary/50 text-sm font-medium">+</span>
</div>
-
- {activeModifiers.size > 0 ? (
- <div className="flex items-center justify-center gap-1.5">
- {Array.from(activeModifiers).map((mod) => (
- <kbd
- key={mod}
- className="px-2.5 py-1.5 bg-indigo-100 border border-indigo-200 rounded-lg text-sm font-semibold text-indigo-700 shadow-sm"
- >
- {mod}
+ ) : (
+ <span className="text-xs text-muted-foreground">
+ {isMac ? "Press any key or βŒ˜β‡§K" : "Press any key or Ctrl+Shift+K"}
+ </span>
+ )}
+ </div>
+ ) : value ? (
+ /* Has value: show the hotkey prominently */
+ <div className="flex flex-col items-center gap-2">
+ <div className="flex items-center gap-1.5">
+ {hotkeyParts.length > 0 ? (
+ hotkeyParts.map((part, i) => (
+ <React.Fragment key={part}>
+ {i > 0 && (
+ <span className="text-muted-foreground/40 text-lg font-light">+</span>
+ )}
+ <kbd className="px-3.5 py-2 bg-surface-raised border border-border-subtle rounded text-base font-semibold text-foreground shadow-sm">
+ {part}
</kbd>
- ))}
- <span className="text-indigo-400 font-medium">+</span>
- <span className="px-2.5 py-1.5 border-2 border-dashed border-indigo-300 rounded-lg text-sm text-indigo-400">
- key
- </span>
- </div>
+ </React.Fragment>
+ ))
+ ) : isGlobe ? (
+ <kbd className="px-4 py-2 bg-surface-raised border border-border-subtle rounded text-xl shadow-sm">
+ 🌐
+ </kbd>
) : (
- <p className="text-center text-gray-500">Press any key or combination</p>
+ <kbd className="px-4 py-2 bg-surface-raised border border-border-subtle rounded text-base font-bold text-foreground shadow-sm">
+ {displayValue}
+ </kbd>
)}
+ </div>
+ <span className="text-[10px] text-muted-foreground/60 group-hover:text-muted-foreground transition-colors">
+ Click to change
+ </span>
+ </div>
+ ) : (
+ /* Empty state */
+ <div className="flex flex-col items-center gap-1.5 text-muted-foreground">
+ <span className="text-sm font-medium">Click to set hotkey</span>
+ </div>
+ )}
+ </div>
+ );
+ }
+
+ // Default variant: compact inline display
+ return (
+ <div
+ ref={containerRef}
+ tabIndex={disabled ? -1 : 0}
+ role="button"
+ aria-label="Press a key combination to set hotkey"
+ onKeyDown={handleKeyDown}
+ onKeyUp={handleKeyUp}
+ onFocus={handleFocus}
+ onBlur={handleBlur}
+ className={`
+ relative overflow-hidden rounded-lg border
+ transition-all duration-200 cursor-pointer select-none focus:outline-none
+ ${
+ disabled
+ ? "bg-muted/30 border-border cursor-not-allowed opacity-50"
+ : isCapturing
+ ? "bg-primary/8 border-primary/50 shadow-[0_0_0_2px_rgba(37,99,212,0.15)]"
+ : "bg-surface-1 border-border-subtle hover:border-border-hover hover:bg-surface-2"
+ }
+ `}
+ >
+ {isCapturing && (
+ <div className="absolute top-0 left-0 right-0 h-0.5 bg-primary animate-pulse" />
+ )}
- <p className="text-xs text-center text-gray-400">
- {isMac ? "Try βŒ˜β‡§K or βŒ₯Space" : "Try Ctrl+Shift+K or Alt+Space"}
- </p>
+ <div className="px-4 py-3">
+ {isCapturing ? (
+ <div className="flex items-center justify-center gap-3">
+ <div className="flex items-center gap-1.5">
+ <div className="w-1.5 h-1.5 bg-primary rounded-full animate-pulse" />
+ <span className="text-xs font-medium text-muted-foreground">Recording</span>
</div>
- ) : value ? (
- <div className="flex flex-col items-center gap-2">
+ {activeModifiers.size > 0 ? (
+ <div className="flex items-center gap-1">
+ {Array.from(activeModifiers).map((mod) => (
+ <kbd
+ key={mod}
+ className="px-2 py-1 bg-primary/15 border border-primary/30 rounded text-xs font-semibold text-primary"
+ >
+ {mod}
+ </kbd>
+ ))}
+ <span className="text-primary/40 text-xs">+ key</span>
+ </div>
+ ) : (
+ <span className="text-xs text-muted-foreground">
+ {isMac ? "Try βŒ˜β‡§K" : "Try Ctrl+Shift+K"}
+ </span>
+ )}
+ </div>
+ ) : value ? (
+ <div className="flex items-center justify-between">
+ <span className="text-xs font-medium text-muted-foreground">Hotkey</span>
+ <div className="flex items-center gap-2">
{hotkeyParts.length > 0 ? (
- <div className="flex items-center justify-center gap-1.5">
+ <div className="flex items-center gap-1">
{hotkeyParts.map((part, i) => (
<React.Fragment key={part}>
- {i > 0 && <span className="text-gray-300 font-medium">+</span>}
- <kbd className="px-3 py-2 bg-gray-100 border border-gray-200 rounded-lg text-base font-semibold text-gray-800 shadow-sm">
+ {i > 0 && <span className="text-muted-foreground/30 text-xs">+</span>}
+ <kbd className="px-2 py-1 bg-surface-raised border border-border-subtle rounded text-sm font-semibold text-foreground">
{part}
</kbd>
</React.Fragment>
))}
</div>
) : isGlobe ? (
- <div className="flex items-center gap-2">
- <kbd className="px-4 py-2 bg-gradient-to-b from-gray-50 to-gray-100 border border-gray-200 rounded-xl text-2xl shadow-sm">
+ <div className="flex items-center gap-1.5">
+ <kbd className="px-2 py-1 bg-surface-raised border border-border-subtle rounded text-lg">
🌐
</kbd>
- <span className="text-sm font-medium text-gray-600">Globe/Fn</span>
+ <span className="text-xs text-muted-foreground">Globe</span>
</div>
) : (
- <kbd className="px-5 py-3 bg-gradient-to-b from-gray-50 to-gray-100 border border-gray-200 rounded-xl text-xl font-bold text-gray-800 shadow-sm min-w-[60px] text-center">
+ <kbd className="px-3 py-1.5 bg-surface-raised border border-border-subtle rounded text-sm font-bold text-foreground">
{displayValue}
</kbd>
)}
-
- <p className="text-xs text-gray-400">Click to change</p>
+ <span className="text-[10px] text-muted-foreground/60">click to change</span>
</div>
- ) : (
- <div className="flex flex-col items-center gap-2 py-2">
- <div className="flex items-center gap-2 text-gray-400">
- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={1.5}
- d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707"
- />
- </svg>
- <span className="font-medium">Click to set hotkey</span>
- </div>
- </div>
- )}
- </div>
+ </div>
+ ) : (
+ <div className="flex items-center justify-center gap-2 text-muted-foreground">
+ <span className="text-sm font-medium">Click to set hotkey</span>
+ </div>
+ )}
</div>
</div>
);
diff --git a/src/components/ui/InfoBox.tsx b/src/components/ui/InfoBox.tsx
new file mode 100644
index 000000000..38ba6484c
--- /dev/null
+++ b/src/components/ui/InfoBox.tsx
@@ -0,0 +1,29 @@
+import React from "react";
+import { cn } from "../lib/utils";
+import { cva, type VariantProps } from "class-variance-authority";
+
+const infoBoxVariants = cva("rounded-md border p-4 transition-colors", {
+ variants: {
+ variant: {
+ default: "bg-primary/8 border-primary/20 dark:bg-primary/10 dark:border-primary/20",
+ success: "bg-success/8 border-success/20 dark:bg-success/10 dark:border-success/20",
+ warning: "bg-warning/8 border-warning/20 dark:bg-warning/10 dark:border-warning/20",
+ info: "bg-info/8 border-info/20 dark:bg-info/10 dark:border-info/20",
+ muted: "bg-surface-1 border-border-subtle",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+});
+
+export interface InfoBoxProps
+ extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof infoBoxVariants> {}
+
+export function InfoBox({ variant, className, children, ...props }: InfoBoxProps) {
+ return (
+ <div className={cn(infoBoxVariants({ variant }), className)} {...props}>
+ {children}
+ </div>
+ );
+}
diff --git a/src/components/ui/LanguageSelector.tsx b/src/components/ui/LanguageSelector.tsx
index b41649234..fbc8d3c18 100644
--- a/src/components/ui/LanguageSelector.tsx
+++ b/src/components/ui/LanguageSelector.tsx
@@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect } from "react";
-import { ChevronDown, Search, X } from "lucide-react";
+import { ChevronDown, Search, X, Check } from "lucide-react";
import { LANGUAGE_OPTIONS, getLanguageLabel } from "../../utils/languages";
interface LanguageSelectorProps {
@@ -96,62 +96,68 @@ export default function LanguageSelector({
type="button"
onClick={() => setIsOpen(!isOpen)}
onKeyDown={handleKeyDown}
- className={`w-full flex items-center justify-between px-3 py-2 border border-gray-300 rounded-md bg-white text-left hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none transition-colors ${
- isOpen ? "border-blue-500 ring-1 ring-blue-500" : ""
+ className={`w-full flex items-center justify-between px-3 py-2 border rounded-lg bg-white/5 dark:bg-white/3 text-left transition-all duration-200 ${
+ isOpen
+ ? "border-primary/50 ring-1 ring-primary/20 bg-white/8"
+ : "border-white/10 dark:border-white/5 hover:border-white/20 hover:bg-white/8"
}`}
aria-haspopup="listbox"
aria-expanded={isOpen}
>
- <span className="truncate">{getLanguageLabel(value)}</span>
+ <span className="truncate text-sm text-foreground">{getLanguageLabel(value)}</span>
<ChevronDown
- className={`w-4 h-4 text-gray-400 transition-transform duration-200 ${
+ className={`w-3.5 h-3.5 text-muted-foreground transition-transform duration-200 ${
isOpen ? "rotate-180" : ""
}`}
/>
</button>
{isOpen && (
- <div className="absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-60 overflow-hidden">
- <div className="p-2 border-b border-gray-200">
+ <div className="absolute z-50 w-full mt-1.5 bg-popover/95 backdrop-blur-xl border border-white/10 dark:border-white/5 rounded-xl shadow-xl max-h-60 overflow-hidden">
+ <div className="p-2 border-b border-white/5">
<div className="relative">
- <Search className="absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" />
+ <Search className="absolute left-2.5 top-1/2 transform -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground" />
<input
ref={searchInputRef}
type="text"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
onKeyDown={handleKeyDown}
- placeholder="Search languages..."
- className="w-full pl-9 pr-8 py-2 text-sm border border-gray-300 rounded-md focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none"
+ placeholder="Search..."
+ className="w-full pl-8 pr-7 py-1.5 text-sm bg-white/5 dark:bg-white/3 text-foreground border border-white/10 rounded-lg focus:border-primary/50 focus:ring-1 focus:ring-primary/20 focus:outline-none placeholder:text-muted-foreground/50"
/>
{searchQuery && (
<button
onClick={clearSearch}
- className="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600"
+ className="absolute right-2.5 top-1/2 transform -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors"
>
- <X className="w-4 h-4" />
+ <X className="w-3.5 h-3.5" />
</button>
)}
</div>
</div>
- <div className="max-h-48 overflow-y-auto">
+ <div className="max-h-44 overflow-y-auto">
{filteredLanguages.length === 0 ? (
- <div className="px-3 py-2 text-sm text-gray-500">No languages found</div>
+ <div className="px-3 py-2 text-sm text-muted-foreground">No languages found</div>
) : (
- <div role="listbox">
+ <div role="listbox" className="p-1">
{filteredLanguages.map((language, index) => (
<button
key={language.value}
type="button"
onClick={() => handleSelect(language.value)}
- className={`w-full px-3 py-2 text-left text-sm hover:bg-gray-100 focus:bg-gray-100 focus:outline-none ${
- language.value === value ? "bg-blue-50 text-blue-700" : ""
- } ${index === highlightedIndex ? "bg-gray-100" : ""}`}
+ className={`w-full px-2.5 py-1.5 text-left text-sm rounded-md transition-colors ${
+ language.value === value
+ ? "bg-primary/15 text-primary font-medium"
+ : "text-foreground hover:bg-white/5"
+ } ${index === highlightedIndex && language.value !== value ? "bg-white/5" : ""}`}
role="option"
aria-selected={language.value === value}
>
- {language.label}
- {language.value === value && <span className="ml-2 text-blue-500">βœ“</span>}
+ <span className="flex items-center justify-between">
+ {language.label}
+ {language.value === value && <Check className="w-3.5 h-3.5" />}
+ </span>
</button>
))}
</div>
diff --git a/src/components/ui/LoadingDots.tsx b/src/components/ui/LoadingDots.tsx
index 9b24bf95f..554d0273f 100644
--- a/src/components/ui/LoadingDots.tsx
+++ b/src/components/ui/LoadingDots.tsx
@@ -13,12 +13,12 @@ export const LoadingDots = () => {
{[0, 1, 2].map((i) => (
<div
key={i}
+ className="bg-primary-foreground"
style={{
width: 4,
height: 6 + 6 * (tick % 3 === i ? 1 : 0),
- background: "#fff",
- borderRadius: 3,
- opacity: 0.9,
+ borderRadius: "var(--radius-sm)",
+ opacity: "var(--opacity-high)",
transition: "height 0.2s",
}}
/>
diff --git a/src/components/ui/MicPermissionWarning.tsx b/src/components/ui/MicPermissionWarning.tsx
index 6b20ff843..63567f0d3 100644
--- a/src/components/ui/MicPermissionWarning.tsx
+++ b/src/components/ui/MicPermissionWarning.tsx
@@ -1,5 +1,7 @@
import { useMemo } from "react";
import { Button } from "./button";
+import { AlertCircle } from "lucide-react";
+import { cn } from "../lib/utils";
interface MicPermissionWarningProps {
error: string | null;
@@ -28,25 +30,22 @@ const PLATFORM_CONFIG: Record<
{ message: string; soundLabel: string; privacyLabel: string; showPrivacyButton: boolean }
> = {
darwin: {
- message:
- "If the microphone prompt doesn't appear, open Sound settings to select your input device, then try again.",
- soundLabel: "Open Sound Input",
- privacyLabel: "Open Microphone Privacy",
- showPrivacyButton: true, // macOS has separate privacy settings
+ message: "Check Sound settings to select your input device",
+ soundLabel: "Sound",
+ privacyLabel: "Privacy",
+ showPrivacyButton: true,
},
win32: {
- message:
- "If the microphone prompt doesn't appear, open Windows Settings to select your input device, then try again.",
- soundLabel: "Open Sound Settings",
- privacyLabel: "Open Privacy Settings",
- showPrivacyButton: true, // Windows has privacy settings for microphone
+ message: "Check Windows Settings to select your input device",
+ soundLabel: "Sound",
+ privacyLabel: "Privacy",
+ showPrivacyButton: true,
},
linux: {
- message:
- "If the microphone prompt doesn't appear, open your system sound settings to select your input device, then try again.",
- soundLabel: "Open Sound Settings",
+ message: "Check system sound settings to select your input device",
+ soundLabel: "Sound",
privacyLabel: "",
- showPrivacyButton: false, // Linux typically doesn't have app-level mic privacy settings
+ showPrivacyButton: false,
},
};
@@ -58,17 +57,39 @@ export default function MicPermissionWarning({
const config = useMemo(() => PLATFORM_CONFIG[getPlatform()], []);
return (
- <div className="rounded-lg border border-amber-200 bg-amber-50 p-4 space-y-3">
- <p className="text-sm text-amber-900">{error || config.message}</p>
- <div className="flex flex-wrap gap-2">
- <Button variant="outline" size="sm" onClick={onOpenSoundSettings}>
- {config.soundLabel}
- </Button>
- {config.showPrivacyButton && (
- <Button variant="outline" size="sm" onClick={onOpenPrivacySettings}>
- {config.privacyLabel}
+ <div
+ className={cn(
+ "rounded-md p-2.5 border",
+ "bg-warning/8 border-warning/20 dark:bg-warning/10 dark:border-warning/20"
+ )}
+ >
+ <div className="flex items-center gap-2.5">
+ <div className="w-6 h-6 rounded-md bg-warning/15 flex items-center justify-center shrink-0">
+ <AlertCircle className="w-3.5 h-3.5 text-amber-600 dark:text-warning" />
+ </div>
+ <p className="flex-1 text-[11px] text-amber-700 dark:text-warning/90 leading-snug">
+ {error || config.message}
+ </p>
+ <div className="flex items-center gap-1 shrink-0">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={onOpenSoundSettings}
+ className="h-6 px-2 text-[10px] text-amber-700 hover:text-amber-800 hover:bg-amber-100 dark:text-warning dark:hover:text-warning dark:hover:bg-warning/10"
+ >
+ {config.soundLabel}
</Button>
- )}
+ {config.showPrivacyButton && (
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={onOpenPrivacySettings}
+ className="h-6 px-2 text-[10px] text-amber-700 hover:text-amber-800 hover:bg-amber-100 dark:text-warning dark:hover:text-warning dark:hover:bg-warning/10"
+ >
+ {config.privacyLabel}
+ </Button>
+ )}
+ </div>
</div>
</div>
);
diff --git a/src/components/ui/MicrophoneSettings.tsx b/src/components/ui/MicrophoneSettings.tsx
index c44871b45..c5017b464 100644
--- a/src/components/ui/MicrophoneSettings.tsx
+++ b/src/components/ui/MicrophoneSettings.tsx
@@ -1,5 +1,6 @@
import React, { useState, useEffect, useCallback, useRef } from "react";
import { Toggle } from "./toggle";
+import { SettingsRow } from "./SettingsSection";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select";
import { Button } from "./button";
import { RefreshCw, Mic } from "lucide-react";
@@ -87,21 +88,18 @@ export const MicrophoneSettings: React.FC<MicrophoneSettingsProps> = ({
return (
<div className="space-y-4">
- <div className="flex items-center justify-between p-4 bg-neutral-50 rounded-lg">
- <div className="flex-1">
- <p className="text-sm font-medium text-neutral-800">Prefer Built-in Microphone</p>
- <p className="text-xs text-neutral-600 mt-1">
- External microphones may cause latency or reduced transcription quality
- </p>
- </div>
+ <SettingsRow
+ label="Prefer Built-in Microphone"
+ description="External microphones may cause latency or reduced transcription quality"
+ >
<Toggle checked={preferBuiltInMic} onChange={onPreferBuiltInChange} />
- </div>
+ </SettingsRow>
{preferBuiltInMic && builtInDevice && (
- <div className="p-3 bg-green-50 border border-green-200 rounded-lg">
+ <div className="p-3 bg-success/10 dark:bg-success/20 border border-success/30 rounded-lg">
<div className="flex items-center gap-2">
- <Mic className="w-4 h-4 text-green-600" />
- <span className="text-sm text-green-800">
+ <Mic className="w-4 h-4 text-success dark:text-success" />
+ <span className="text-sm text-success dark:text-success">
Using: <span className="font-medium">{builtInDevice.label}</span>
</span>
</div>
@@ -109,8 +107,8 @@ export const MicrophoneSettings: React.FC<MicrophoneSettingsProps> = ({
)}
{preferBuiltInMic && !builtInDevice && devices.length > 0 && (
- <div className="p-3 bg-amber-50 border border-amber-200 rounded-lg">
- <p className="text-sm text-amber-800">
+ <div className="p-3 bg-warning/10 dark:bg-warning/20 border border-warning/30 rounded-lg">
+ <p className="text-sm text-warning dark:text-warning">
No built-in microphone detected. Using system default.
</p>
</div>
@@ -119,7 +117,7 @@ export const MicrophoneSettings: React.FC<MicrophoneSettingsProps> = ({
{!preferBuiltInMic && (
<div className="space-y-3">
<div className="flex items-center gap-2">
- <label className="text-sm font-medium text-neutral-700">Input Device</label>
+ <label className="text-sm font-medium text-foreground">Input Device</label>
<Button
variant="ghost"
size="sm"
@@ -132,7 +130,7 @@ export const MicrophoneSettings: React.FC<MicrophoneSettingsProps> = ({
</div>
{error ? (
- <p className="text-sm text-red-600">{error}</p>
+ <p className="text-sm text-destructive">{error}</p>
) : (
<Select
value={selectedMicDeviceId || "default"}
@@ -151,7 +149,7 @@ export const MicrophoneSettings: React.FC<MicrophoneSettingsProps> = ({
<SelectItem key={device.deviceId} value={device.deviceId}>
{device.label}
{device.isBuiltIn && (
- <span className="ml-2 text-xs text-neutral-500">(Built-in)</span>
+ <span className="ml-2 text-xs text-muted-foreground">(Built-in)</span>
)}
</SelectItem>
))}
@@ -159,7 +157,7 @@ export const MicrophoneSettings: React.FC<MicrophoneSettingsProps> = ({
</Select>
)}
- <p className="text-xs text-neutral-500">
+ <p className="text-xs text-muted-foreground">
Select a specific microphone or use the system default setting.
</p>
</div>
diff --git a/src/components/ui/ModelCardList.tsx b/src/components/ui/ModelCardList.tsx
index df54adfa8..7ae844a12 100644
--- a/src/components/ui/ModelCardList.tsx
+++ b/src/components/ui/ModelCardList.tsx
@@ -1,4 +1,5 @@
-import { Globe } from "lucide-react";
+import { Globe, Download, Trash2, X } from "lucide-react";
+import { Button } from "./button";
import type { ColorScheme } from "../../utils/modelPickerStyles";
export interface ModelCardOption {
@@ -6,6 +7,11 @@ export interface ModelCardOption {
label: string;
description?: string;
icon?: string;
+ invertInDark?: boolean;
+ // Local model properties (optional)
+ isDownloaded?: boolean;
+ isDownloading?: boolean;
+ recommended?: boolean;
}
interface ModelCardListProps {
@@ -14,6 +20,11 @@ interface ModelCardListProps {
onModelSelect: (modelId: string) => void;
colorScheme?: ColorScheme;
className?: string;
+ // Local model actions (optional - when provided, enables local model UI)
+ onDownload?: (modelId: string) => void;
+ onDelete?: (modelId: string) => void;
+ onCancelDownload?: () => void;
+ isCancelling?: boolean;
}
const COLOR_CONFIG: Record<
@@ -21,23 +32,25 @@ const COLOR_CONFIG: Record<
{
selected: string;
default: string;
- badge: string;
}
> = {
indigo: {
- selected: "border-indigo-500 bg-indigo-50",
- default: "border-gray-200 bg-white hover:border-gray-300",
- badge: "text-xs text-indigo-600 bg-indigo-100 px-2 py-1 rounded-full font-medium",
+ selected:
+ "border-primary/30 bg-primary/8 dark:bg-primary/6 dark:border-primary/20 shadow-[0_0_0_1px_oklch(0.62_0.22_260/0.12),0_0_10px_-3px_oklch(0.62_0.22_260/0.18)]",
+ default:
+ "border-border bg-surface-1 hover:border-border-hover hover:bg-muted dark:border-white/5 dark:bg-white/3 dark:hover:border-white/20 dark:hover:bg-white/8",
},
purple: {
- selected: "border-purple-500 bg-purple-50",
- default: "border-gray-200 bg-white hover:border-gray-300",
- badge: "text-xs text-purple-600 bg-purple-100 px-2 py-1 rounded-full font-medium",
+ selected:
+ "border-primary/30 bg-primary/8 dark:bg-primary/6 dark:border-primary/20 shadow-[0_0_0_1px_oklch(0.62_0.22_260/0.12),0_0_10px_-3px_oklch(0.62_0.22_260/0.18)]",
+ default:
+ "border-border bg-surface-1 hover:border-border-hover hover:bg-muted dark:border-white/5 dark:bg-white/3 dark:hover:border-white/20 dark:hover:bg-white/8",
},
blue: {
- selected: "border-blue-500 bg-blue-50",
- default: "border-gray-200 bg-white hover:border-gray-300",
- badge: "text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full font-medium",
+ selected:
+ "border-primary/30 bg-primary/10 dark:bg-primary/6 shadow-[0_0_0_1px_oklch(0.62_0.22_260/0.15),0_0_12px_-3px_oklch(0.62_0.22_260/0.2)]",
+ default:
+ "border-border bg-surface-1 hover:border-border-hover hover:bg-muted dark:border-white/5 dark:bg-white/3 dark:hover:border-white/20 dark:hover:bg-white/8",
},
};
@@ -47,39 +60,159 @@ export default function ModelCardList({
onModelSelect,
colorScheme = "indigo",
className = "",
+ onDownload,
+ onDelete,
+ onCancelDownload,
+ isCancelling = false,
}: ModelCardListProps) {
const styles = COLOR_CONFIG[colorScheme];
+ const isLocalMode = Boolean(onDownload);
+
+ if (models.length === 0) {
+ return (
+ <p className="text-sm text-muted-foreground py-2">
+ {isLocalMode ? "No models available for this provider" : "No models available"}
+ </p>
+ );
+ }
return (
- <div className={`space-y-2 ${className}`}>
+ <div className={`space-y-1 ${className}`}>
{models.map((model) => {
const isSelected = selectedModel === model.value;
+ const isDownloaded = model.isDownloaded;
+ const isDownloading = model.isDownloading;
+
+ // For local models, click to select if downloaded
+ const handleCardClick = () => {
+ if (isLocalMode) {
+ if (isDownloaded && !isSelected) {
+ onModelSelect(model.value);
+ }
+ } else {
+ onModelSelect(model.value);
+ }
+ };
+
+ // Determine status dot color for local mode
+ const getStatusDotClass = () => {
+ if (!isLocalMode) {
+ return isSelected
+ ? "bg-primary shadow-[0_0_6px_oklch(0.62_0.22_260/0.6)]"
+ : "bg-muted-foreground/30";
+ }
+ if (isDownloaded) {
+ return isSelected
+ ? "bg-primary shadow-[0_0_6px_oklch(0.62_0.22_260/0.6)]"
+ : "bg-success shadow-[0_0_4px_rgba(34,197,94,0.5)]";
+ }
+ if (isDownloading) {
+ return "bg-amber-500 shadow-[0_0_4px_rgba(245,158,11,0.5)]";
+ }
+ return "bg-muted-foreground/20";
+ };
return (
- <button
+ <div
key={model.value}
- onClick={() => onModelSelect(model.value)}
- className={`w-full p-3 rounded-lg border-2 text-left transition-all ${
+ onClick={handleCardClick}
+ className={`relative w-full p-2.5 pl-3 rounded-lg border text-left transition-all duration-200 group overflow-hidden ${
isSelected ? styles.selected : styles.default
- }`}
+ } ${!isLocalMode || (isDownloaded && !isSelected) ? "cursor-pointer" : ""}`}
>
- <div className="flex items-center justify-between">
- <div>
- <div className="flex items-center gap-2">
- {model.icon ? (
- <img src={model.icon} alt="" className="w-4 h-4" aria-hidden="true" />
- ) : (
- <Globe className="w-4 h-4 text-gray-400" aria-hidden="true" />
- )}
- <span className="font-medium text-gray-900">{model.label}</span>
- </div>
- {model.description && (
- <div className="text-xs text-gray-600 mt-1">{model.description}</div>
+ {/* Left accent bar for selected */}
+ {isSelected && (
+ <div className="absolute left-0 top-0 bottom-0 w-0.5 bg-primary rounded-l-lg" />
+ )}
+
+ <div className="flex items-center gap-2">
+ {/* Status dot with LED glow */}
+ <div className={`w-1.5 h-1.5 rounded-full shrink-0 ${getStatusDotClass()}`} />
+
+ {/* Icon */}
+ {model.icon ? (
+ <img
+ src={model.icon}
+ alt=""
+ className={`w-3.5 h-3.5 shrink-0 ${model.invertInDark ? "icon-monochrome" : ""}`}
+ aria-hidden="true"
+ />
+ ) : (
+ <Globe className="w-3.5 h-3.5 shrink-0 text-muted-foreground" aria-hidden="true" />
+ )}
+
+ {/* Model info - inline */}
+ <span className="text-sm font-medium text-foreground truncate">{model.label}</span>
+ {model.description && (
+ <span className="text-[10px] text-muted-foreground/60 tabular-nums shrink-0">
+ {model.description}
+ </span>
+ )}
+
+ {/* Recommended badge */}
+ {model.recommended && (
+ <span className="text-[10px] font-medium text-primary px-1.5 py-0.5 bg-primary/10 rounded-sm shrink-0">
+ Recommended
+ </span>
+ )}
+
+ {/* Actions - right aligned */}
+ <div className="ml-auto flex items-center gap-1.5 shrink-0">
+ {/* Selected/Active badge */}
+ {isSelected && (
+ <span className="text-[10px] font-medium text-primary px-2 py-0.5 bg-primary/10 rounded-sm">
+ Active
+ </span>
+ )}
+
+ {/* Local model action buttons */}
+ {isLocalMode && (
+ <>
+ {isDownloaded ? (
+ <Button
+ onClick={(e) => {
+ e.stopPropagation();
+ onDelete?.(model.value);
+ }}
+ size="sm"
+ variant="ghost"
+ className="h-6 w-6 p-0 text-muted-foreground/40 hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity"
+ >
+ <Trash2 size={12} />
+ </Button>
+ ) : isDownloading ? (
+ <Button
+ onClick={(e) => {
+ e.stopPropagation();
+ onCancelDownload?.();
+ }}
+ disabled={isCancelling}
+ size="sm"
+ variant="outline"
+ className="h-6 px-2.5 text-[11px] text-destructive border-destructive/25 hover:bg-destructive/8"
+ >
+ <X size={11} className="mr-0.5" />
+ {isCancelling ? "..." : "Cancel"}
+ </Button>
+ ) : (
+ <Button
+ onClick={(e) => {
+ e.stopPropagation();
+ onDownload?.(model.value);
+ }}
+ size="sm"
+ variant="default"
+ className="h-6 px-2.5 text-[11px]"
+ >
+ <Download size={11} className="mr-1" />
+ Download
+ </Button>
+ )}
+ </>
)}
</div>
- {isSelected && <span className={styles.badge}>βœ“ Selected</span>}
</div>
- </button>
+ </div>
);
})}
</div>
diff --git a/src/components/ui/PasteToolsInfo.tsx b/src/components/ui/PasteToolsInfo.tsx
index 3d295a879..1a39e4cec 100644
--- a/src/components/ui/PasteToolsInfo.tsx
+++ b/src/components/ui/PasteToolsInfo.tsx
@@ -1,5 +1,6 @@
import { Check, Terminal, Info } from "lucide-react";
import { Button } from "./button";
+import { InfoBox } from "./InfoBox";
import type { PasteToolsResult } from "../../types/electron";
interface PasteToolsInfoProps {
@@ -15,17 +16,17 @@ export default function PasteToolsInfo({
}: PasteToolsInfoProps) {
if (!pasteToolsInfo) {
return (
- <div className="border rounded-lg p-4">
+ <div className="border border-border rounded-lg p-4">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
- <Terminal className="w-6 h-6 text-indigo-600" />
+ <Terminal className="w-6 h-6 text-primary" />
<div>
- <h3 className="font-semibold text-gray-900">Automatic Pasting</h3>
- <p className="text-sm text-gray-600">Checking system capabilities...</p>
+ <h3 className="font-semibold text-foreground">Automatic Pasting</h3>
+ <p className="text-sm text-muted-foreground">Checking system capabilities...</p>
</div>
</div>
{isChecking && (
- <div className="animate-spin rounded-full h-5 w-5 border-b-2 border-indigo-600"></div>
+ <div className="animate-spin rounded-full h-5 w-5 border-b-2 border-primary"></div>
)}
</div>
</div>
@@ -35,22 +36,24 @@ export default function PasteToolsInfo({
// Windows - always ready
if (pasteToolsInfo.platform === "win32") {
return (
- <div className="border border-green-200 bg-green-50 rounded-lg p-4">
+ <InfoBox variant="success">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
- <Terminal className="w-6 h-6 text-green-600" />
+ <Terminal className="w-6 h-6 text-success dark:text-success" />
<div>
- <h3 className="font-semibold text-green-900">Automatic Pasting Ready</h3>
- <p className="text-sm text-green-700">
+ <h3 className="font-semibold text-success dark:text-success">
+ Automatic Pasting Ready
+ </h3>
+ <p className="text-sm text-success dark:text-success">
Windows supports automatic pasting out of the box. No setup required!
</p>
</div>
</div>
- <div className="text-green-600">
+ <div className="text-success dark:text-success">
<Check className="w-5 h-5" />
</div>
</div>
- </div>
+ </InfoBox>
);
}
@@ -61,23 +64,25 @@ export default function PasteToolsInfo({
pasteToolsInfo.isWayland && method === "xdotool" ? " (XWayland apps only)." : ".";
return (
- <div className="border border-green-200 bg-green-50 rounded-lg p-4">
+ <InfoBox variant="success">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
- <Terminal className="w-6 h-6 text-green-600" />
+ <Terminal className="w-6 h-6 text-success dark:text-success" />
<div>
- <h3 className="font-semibold text-green-900">Automatic Pasting Ready</h3>
- <p className="text-sm text-green-700">
- Using <code className="bg-green-100 px-1 rounded">{method}</code> for automatic text
- pasting{methodSuffix}
+ <h3 className="font-semibold text-success dark:text-success">
+ Automatic Pasting Ready
+ </h3>
+ <p className="text-sm text-success dark:text-success">
+ Using <code className="bg-success/20 px-1 rounded">{method}</code> for automatic
+ text pasting{methodSuffix}
</p>
</div>
</div>
- <div className="text-green-600">
+ <div className="text-success dark:text-success">
<Check className="w-5 h-5" />
</div>
</div>
- </div>
+ </InfoBox>
);
}
@@ -89,67 +94,67 @@ export default function PasteToolsInfo({
const showInstall = !!recommendedTool;
return (
- <div className="border border-amber-200 bg-amber-50 rounded-lg p-4 space-y-3">
+ <InfoBox variant="warning" className="space-y-3">
<div className="flex items-start gap-3">
- <Info className="w-6 h-6 text-amber-600 flex-shrink-0 mt-0.5" />
+ <Info className="w-6 h-6 text-warning dark:text-warning flex-shrink-0 mt-0.5" />
<div className="flex-1">
- <h3 className="font-semibold text-amber-900">
+ <h3 className="font-semibold text-warning dark:text-warning">
{showInstall ? "Optional: Enable Automatic Pasting" : "Clipboard Mode on Wayland"}
</h3>
{showInstall ? (
<>
- <p className="text-sm text-amber-800 mt-1">
+ <p className="text-sm text-warning dark:text-warning mt-1">
For automatic text pasting, install{" "}
- <code className="bg-amber-100 px-1 rounded font-mono">{recommendedTool}</code>:
+ <code className="bg-warning/20 px-1 rounded font-mono">{recommendedTool}</code>:
</p>
- <div className="mt-3 bg-gray-900 text-gray-100 p-3 rounded-md font-mono text-xs overflow-x-auto">
+ <div className="mt-3 bg-card border border-border p-3 rounded-md font-mono text-xs overflow-x-auto">
{recommendedTool === "wtype" ? (
<>
- <div className="text-gray-400"># Fedora / RHEL</div>
- <div>sudo dnf install wtype</div>
- <div className="text-gray-400 mt-2"># Debian / Ubuntu</div>
- <div>sudo apt install wtype</div>
- <div className="text-gray-400 mt-2"># Arch Linux</div>
- <div>sudo pacman -S wtype</div>
+ <div className="text-muted-foreground"># Fedora / RHEL</div>
+ <div className="text-foreground">sudo dnf install wtype</div>
+ <div className="text-muted-foreground mt-2"># Debian / Ubuntu</div>
+ <div className="text-foreground">sudo apt install wtype</div>
+ <div className="text-muted-foreground mt-2"># Arch Linux</div>
+ <div className="text-foreground">sudo pacman -S wtype</div>
</>
) : (
<>
- <div className="text-gray-400"># Debian / Ubuntu / Mint</div>
- <div>sudo apt install xdotool</div>
- <div className="text-gray-400 mt-2"># Fedora / RHEL</div>
- <div>sudo dnf install xdotool</div>
- <div className="text-gray-400 mt-2"># Arch Linux</div>
- <div>sudo pacman -S xdotool</div>
+ <div className="text-muted-foreground"># Debian / Ubuntu / Mint</div>
+ <div className="text-foreground">sudo apt install xdotool</div>
+ <div className="text-muted-foreground mt-2"># Fedora / RHEL</div>
+ <div className="text-foreground">sudo dnf install xdotool</div>
+ <div className="text-muted-foreground mt-2"># Arch Linux</div>
+ <div className="text-foreground">sudo pacman -S xdotool</div>
</>
)}
</div>
{isWayland && recommendedTool === "wtype" && xwaylandAvailable && (
- <p className="text-sm text-amber-700 mt-3">
+ <p className="text-sm text-warning dark:text-warning mt-3">
Note: For XWayland apps, xdotool also works.
</p>
)}
{isWayland && recommendedTool !== "wtype" && (
- <p className="text-sm text-amber-700 mt-3">
+ <p className="text-sm text-warning dark:text-warning mt-3">
Note: automatic pasting works for XWayland apps only.
</p>
)}
</>
) : (
- <p className="text-sm text-amber-800 mt-1">
+ <p className="text-sm text-warning dark:text-warning mt-1">
Automatic pasting isn't available on this Wayland session. OpenWhispr will copy text
to your clipboard so you can paste manually with{" "}
- <kbd className="bg-amber-100 px-1 rounded text-xs">Ctrl+V</kbd>.
+ <kbd className="bg-warning/20 px-1 rounded text-xs">Ctrl+V</kbd>.
</p>
)}
{showInstall && (
- <p className="text-sm text-amber-700 mt-3">
+ <p className="text-sm text-warning dark:text-warning mt-3">
Without this tool, OpenWhispr will copy text to your clipboard. You can then paste
- manually with <kbd className="bg-amber-100 px-1 rounded text-xs">Ctrl+V</kbd>.
+ manually with <kbd className="bg-warning/20 px-1 rounded text-xs">Ctrl+V</kbd>.
</p>
)}
</div>
@@ -160,7 +165,7 @@ export default function PasteToolsInfo({
{isChecking ? "Checking..." : "Re-check"}
</Button>
</div>
- </div>
+ </InfoBox>
);
}
diff --git a/src/components/ui/PermissionCard.tsx b/src/components/ui/PermissionCard.tsx
index 997b3436d..bf5b658ee 100644
--- a/src/components/ui/PermissionCard.tsx
+++ b/src/components/ui/PermissionCard.tsx
@@ -1,6 +1,6 @@
-import React from "react";
import { Button } from "./button";
import { Check, LucideIcon, Settings } from "lucide-react";
+import { cn } from "../lib/utils";
interface PermissionCardProps {
icon: LucideIcon;
@@ -10,7 +10,6 @@ interface PermissionCardProps {
onRequest: () => void;
buttonText?: string;
onOpenSettings?: () => void;
- openSettingsText?: string;
}
export default function PermissionCard({
@@ -21,31 +20,54 @@ export default function PermissionCard({
onRequest,
buttonText = "Grant Access",
onOpenSettings,
- openSettingsText = "Open Settings",
}: PermissionCardProps) {
return (
- <div className="border rounded-lg p-4">
- <div className="flex items-center justify-between mb-3">
- <div className="flex items-center gap-3">
- <Icon className="w-6 h-6 text-indigo-600" />
- <div>
- <h3 className="font-semibold text-gray-900">{title}</h3>
- <p className="text-sm text-gray-600">{description}</p>
- </div>
+ <div
+ className={cn(
+ "group relative rounded-lg p-2.5 transition-all duration-150",
+ "border",
+ granted
+ ? "bg-success/5 border-success/15 dark:bg-success/8 dark:border-success/20"
+ : "bg-surface-1 border-border-subtle hover:bg-surface-2 hover:border-border-hover"
+ )}
+ >
+ <div className="flex items-center gap-2.5">
+ {/* Icon container */}
+ <div
+ className={cn(
+ "w-7 h-7 rounded-md flex items-center justify-center shrink-0 transition-colors",
+ granted ? "bg-success/10" : "bg-primary/8 dark:bg-primary/10"
+ )}
+ >
+ {granted ? (
+ <Check className="w-3.5 h-3.5 text-success" strokeWidth={2.5} />
+ ) : (
+ <Icon className="w-3.5 h-3.5 text-primary" />
+ )}
</div>
- {granted ? (
- <div className="text-green-600">
- <Check className="w-5 h-5" />
+
+ {/* Content */}
+ <div className="flex-1 min-w-0">
+ <div className="flex items-center gap-1.5">
+ <h3 className="text-[12px] font-medium text-foreground leading-tight">{title}</h3>
+ {granted && (
+ <span className="text-[9px] font-medium text-success/70 uppercase tracking-wider">
+ Granted
+ </span>
+ )}
</div>
- ) : (
- <div className="flex items-center gap-2">
- <Button onClick={onRequest} size="sm">
+ <p className="text-[10px] text-muted-foreground/80 leading-snug mt-0.5">{description}</p>
+ </div>
+
+ {/* Actions - only when not granted */}
+ {!granted && (
+ <div className="flex items-center gap-1 shrink-0">
+ <Button onClick={onRequest} size="sm" className="h-6 px-2.5 text-[10px]">
{buttonText}
</Button>
{onOpenSettings && (
- <Button onClick={onOpenSettings} size="sm" variant="outline">
- <Settings className="w-4 h-4 mr-1" />
- {openSettingsText}
+ <Button onClick={onOpenSettings} size="sm" variant="outline" className="h-6 w-6 p-0">
+ <Settings className="w-3 h-3 text-foreground" />
</Button>
)}
</div>
diff --git a/src/components/ui/ProcessingModeSelector.tsx b/src/components/ui/ProcessingModeSelector.tsx
index b5d404470..c96409e2f 100644
--- a/src/components/ui/ProcessingModeSelector.tsx
+++ b/src/components/ui/ProcessingModeSelector.tsx
@@ -13,47 +13,36 @@ export default function ProcessingModeSelector({
className = "",
}: ProcessingModeSelectorProps) {
return (
- <div className={`grid grid-cols-1 md:grid-cols-2 gap-3 ${className}`}>
+ <div
+ className={`relative flex p-0.5 rounded-lg bg-white/5 dark:bg-white/3 border border-white/10 dark:border-white/5 ${className}`}
+ >
+ {/* Sliding indicator */}
+ <div
+ className={`absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] rounded-md bg-white/10 dark:bg-white/8 border border-white/10 transition-transform duration-200 ease-out ${
+ useLocalWhisper ? "translate-x-[calc(100%+4px)]" : "translate-x-0"
+ }`}
+ />
+
<button
onClick={() => setUseLocalWhisper(false)}
- className={`p-4 border-2 rounded-xl text-left transition-all cursor-pointer ${
- !useLocalWhisper
- ? "border-indigo-500 bg-indigo-50"
- : "border-neutral-200 bg-white hover:border-neutral-300"
+ className={`relative z-10 flex-1 flex items-center justify-center gap-2 py-2.5 rounded-md transition-colors duration-150 ${
+ !useLocalWhisper ? "text-foreground" : "text-muted-foreground hover:text-foreground"
}`}
>
- <div className="flex items-center justify-between mb-2">
- <div className="flex items-center gap-3">
- <Cloud className="w-6 h-6 text-blue-600" />
- <h4 className="font-medium text-neutral-900">Cloud Processing</h4>
- </div>
- <span className="text-xs text-green-600 bg-green-100 px-2 py-1 rounded-full">
- Fastest
- </span>
- </div>
- <p className="text-sm text-neutral-600">
- Audio sent to OpenAI servers. Faster processing, requires API key.
- </p>
+ <Cloud className="w-4 h-4" />
+ <span className="text-sm font-medium">Cloud</span>
+ {!useLocalWhisper && <span className="text-[10px] text-emerald-500 font-medium">Fast</span>}
</button>
<button
onClick={() => setUseLocalWhisper(true)}
- className={`p-4 border-2 rounded-xl text-left transition-all cursor-pointer ${
- useLocalWhisper
- ? "border-indigo-500 bg-indigo-50"
- : "border-neutral-200 bg-white hover:border-neutral-300"
+ className={`relative z-10 flex-1 flex items-center justify-center gap-2 py-2.5 rounded-md transition-colors duration-150 ${
+ useLocalWhisper ? "text-foreground" : "text-muted-foreground hover:text-foreground"
}`}
>
- <div className="flex items-center justify-between mb-2">
- <div className="flex items-center gap-3">
- <Lock className="w-6 h-6 text-blue-600" />
- <h4 className="font-medium text-neutral-900">Local Processing</h4>
- </div>
- <span className="text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full">Private</span>
- </div>
- <p className="text-sm text-neutral-600">
- Audio stays on your device. Complete privacy, works offline.
- </p>
+ <Lock className="w-4 h-4" />
+ <span className="text-sm font-medium">Local</span>
+ {useLocalWhisper && <span className="text-[10px] text-primary font-medium">Private</span>}
</button>
</div>
);
diff --git a/src/components/ui/PromptStudio.tsx b/src/components/ui/PromptStudio.tsx
index 86a2ed50e..7d8c09359 100644
--- a/src/components/ui/PromptStudio.tsx
+++ b/src/components/ui/PromptStudio.tsx
@@ -1,7 +1,6 @@
import React, { useState, useEffect } from "react";
import { Button } from "./button";
import { Textarea } from "./textarea";
-import { Card, CardContent, CardHeader, CardTitle } from "./card";
import {
Eye,
Edit3,
@@ -9,10 +8,9 @@ import {
Save,
RotateCcw,
Copy,
- Sparkles,
TestTube,
AlertTriangle,
- Info,
+ Check,
} from "lucide-react";
import { AlertDialog } from "./dialog";
import { useDialogs } from "../../hooks/useDialogs";
@@ -20,7 +18,7 @@ import { useAgentName } from "../../utils/agentName";
import ReasoningService from "../../services/ReasoningService";
import { getModelProvider } from "../../models/ModelRegistry";
import logger from "../../utils/logger";
-import { UNIFIED_SYSTEM_PROMPT, LEGACY_PROMPTS } from "../../config/prompts";
+import { UNIFIED_SYSTEM_PROMPT } from "../../config/prompts";
interface PromptStudioProps {
className?: string;
@@ -44,9 +42,6 @@ const PROVIDER_CONFIG: Record<string, ProviderConfig> = {
local: { label: "Local" },
};
-/**
- * Get the current prompt being used - either custom or default unified prompt
- */
function getCurrentPrompt(): string {
const customPrompt = localStorage.getItem("customUnifiedPrompt");
if (customPrompt) {
@@ -67,29 +62,25 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
);
const [testResult, setTestResult] = useState("");
const [isLoading, setIsLoading] = useState(false);
+ const [copiedPrompt, setCopiedPrompt] = useState(false);
const { alertDialog, showAlertDialog, hideAlertDialog } = useDialogs();
const { agentName } = useAgentName();
- // Load saved custom prompt from localStorage
useEffect(() => {
- // Migrate legacy two-prompt system (customPrompts β†’ customUnifiedPrompt)
const legacyPrompts = localStorage.getItem("customPrompts");
if (legacyPrompts && !localStorage.getItem("customUnifiedPrompt")) {
try {
const parsed = JSON.parse(legacyPrompts);
- // Use agent prompt as base (it's more comprehensive than regular prompt)
if (parsed.agent) {
localStorage.setItem("customUnifiedPrompt", JSON.stringify(parsed.agent));
localStorage.removeItem("customPrompts");
- console.log("Migrated legacy custom prompts to unified format");
}
} catch (e) {
console.error("Failed to migrate legacy custom prompts:", e);
}
}
- // Load current custom prompt
const customPrompt = localStorage.getItem("customUnifiedPrompt");
if (customPrompt) {
try {
@@ -103,9 +94,8 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
const savePrompt = () => {
localStorage.setItem("customUnifiedPrompt", JSON.stringify(editedPrompt));
showAlertDialog({
- title: "Prompt Saved!",
- description:
- "Your custom prompt has been saved and will be used for all future AI processing.",
+ title: "Prompt Saved",
+ description: "Your custom prompt will be used for all future AI processing.",
});
};
@@ -118,6 +108,12 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
});
};
+ const copyText = (text: string) => {
+ navigator.clipboard.writeText(text);
+ setCopiedPrompt(true);
+ setTimeout(() => setCopiedPrompt(false), 2000);
+ };
+
const testPrompt = async () => {
if (!testText.trim()) return;
@@ -128,7 +124,6 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
const useReasoningModel = localStorage.getItem("useReasoningModel") !== "false";
const reasoningModel = localStorage.getItem("reasoningModel") || "";
const reasoningProvider = reasoningModel ? getModelProvider(reasoningModel) : "openai";
- const customBaseUrl = localStorage.getItem("cloudReasoningBaseUrl") || "";
logger.debug(
"PromptStudio test starting",
@@ -136,7 +131,6 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
useReasoningModel,
reasoningModel,
reasoningProvider,
- customBaseUrl: customBaseUrl ? `${customBaseUrl.substring(0, 50)}...` : "(none)",
testTextLength: testText.length,
agentName,
},
@@ -144,51 +138,32 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
);
if (!useReasoningModel) {
- logger.debug("PromptStudio test aborted: AI enhancement disabled", {}, "prompt-studio");
- setTestResult(
- "AI text enhancement is disabled. Enable it in AI Text Cleanup settings to test prompts."
- );
+ setTestResult("AI text enhancement is disabled. Enable it in AI Models to test prompts.");
return;
}
if (!reasoningModel) {
- logger.debug("PromptStudio test aborted: no model selected", {}, "prompt-studio");
- setTestResult("No reasoning model selected. Choose one in AI Text Cleanup settings.");
+ setTestResult("No reasoning model selected. Choose one in AI Models settings.");
return;
}
const providerConfig = PROVIDER_CONFIG[reasoningProvider] || {
label: reasoningProvider.charAt(0).toUpperCase() + reasoningProvider.slice(1),
};
- const providerLabel = providerConfig.label;
if (providerConfig.baseStorageKey) {
const baseUrl = (localStorage.getItem(providerConfig.baseStorageKey) || "").trim();
if (!baseUrl) {
- logger.debug(
- "PromptStudio test aborted: missing base URL for custom endpoint",
- { provider: reasoningProvider },
- "prompt-studio"
- );
- setTestResult(`${providerLabel} base URL missing. Add it in AI Text Cleanup settings.`);
+ setTestResult(`${providerConfig.label} base URL missing. Add it in AI Models settings.`);
return;
}
}
- // Save the current edited prompt temporarily for the test
const currentCustomPrompt = localStorage.getItem("customUnifiedPrompt");
localStorage.setItem("customUnifiedPrompt", JSON.stringify(editedPrompt));
- const startTime = Date.now();
-
try {
if (reasoningProvider === "local") {
- logger.debug(
- "PromptStudio: sending to local model",
- { model: reasoningModel, textLength: testText.length },
- "prompt-studio"
- );
-
const result = await window.electronAPI.processLocalReasoning(
testText,
reasoningModel,
@@ -196,65 +171,21 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
{}
);
- const processingTime = Date.now() - startTime;
-
if (result.success) {
- const resultText = result.text || "";
- logger.debug(
- "PromptStudio: local model success",
- {
- processingTimeMs: processingTime,
- resultLength: resultText.length,
- resultPreview: resultText.substring(0, 100),
- },
- "prompt-studio"
- );
- setTestResult(resultText);
+ setTestResult(result.text || "");
} else {
- logger.debug(
- "PromptStudio: local model error",
- { processingTimeMs: processingTime, error: result.error },
- "prompt-studio"
- );
setTestResult(`Local model error: ${result.error}`);
}
} else {
- logger.debug(
- "PromptStudio: sending to cloud provider",
- {
- provider: reasoningProvider,
- model: reasoningModel,
- textLength: testText.length,
- isCustomEndpoint: reasoningProvider === "custom",
- customBaseUrl: customBaseUrl || "(default)",
- },
- "prompt-studio"
- );
-
const result = await ReasoningService.processText(
testText,
reasoningModel,
agentName,
{}
);
-
- const processingTime = Date.now() - startTime;
-
- logger.debug(
- "PromptStudio: cloud provider success",
- {
- provider: reasoningProvider,
- processingTimeMs: processingTime,
- resultLength: result.length,
- resultPreview: result.substring(0, 100),
- },
- "prompt-studio"
- );
-
setTestResult(result);
}
} finally {
- // Restore original prompt
if (currentCustomPrompt) {
localStorage.setItem("customUnifiedPrompt", currentCustomPrompt);
} else {
@@ -263,294 +194,269 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
}
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
- logger.error(
- "PromptStudio test failed",
- {
- error: errorMessage,
- stack: error instanceof Error ? error.stack : undefined,
- },
- "prompt-studio"
- );
+ logger.error("PromptStudio test failed", { error: errorMessage }, "prompt-studio");
setTestResult(`Test failed: ${errorMessage}`);
} finally {
setIsLoading(false);
}
};
- const copyPrompt = (prompt: string) => {
- navigator.clipboard.writeText(prompt);
- showAlertDialog({
- title: "Copied!",
- description: "Prompt copied to clipboard.",
- });
- };
-
- // Check if the test text contains the agent name
const isAgentAddressed = testText.toLowerCase().includes(agentName.toLowerCase());
+ const isCustomPrompt = getCurrentPrompt() !== UNIFIED_SYSTEM_PROMPT;
- const renderCurrentPrompt = () => (
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold mb-4 flex items-center gap-2">
- <Eye className="w-5 h-5 text-blue-600" />
- Current System Prompt
- </h3>
- <p className="text-sm text-gray-600 mb-6">
- This is the exact prompt sent to your AI model. It handles both text cleanup and
- instruction detection in a single, unified approach.
- </p>
- </div>
+ const tabs = [
+ { id: "current" as const, label: "View", icon: Eye },
+ { id: "edit" as const, label: "Customize", icon: Edit3 },
+ { id: "test" as const, label: "Test", icon: TestTube },
+ ];
- <Card>
- <CardHeader>
- <CardTitle className="flex items-center gap-2 text-base">
- <Sparkles className="w-4 h-4 text-purple-600" />
- Unified System Prompt
- </CardTitle>
- </CardHeader>
- <CardContent>
- <div className="bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4">
- <div className="flex items-start gap-3">
- <Info className="w-5 h-5 text-blue-600 flex-shrink-0 mt-0.5" />
- <div className="text-sm text-blue-800">
- <p className="font-medium mb-1">How it works:</p>
- <ul className="list-disc list-inside space-y-1 text-blue-700">
- <li>
- <strong>Cleanup mode (default)</strong>: Cleans transcribed speech - removes
- filler words, fixes grammar, punctuation
- </li>
- <li>
- <strong>Instruction mode</strong>: When you directly address "{agentName}" with
- a command, it executes the instruction AND cleans up the text
- </li>
- <li>The AI intelligently detects which mode to use based on context</li>
- </ul>
+ return (
+ <div className={className}>
+ <AlertDialog
+ open={alertDialog.open}
+ onOpenChange={(open) => !open && hideAlertDialog()}
+ title={alertDialog.title}
+ description={alertDialog.description}
+ onOk={() => {}}
+ />
+
+ {/* Tab Navigation + Content in a single panel */}
+ <div className="rounded-xl border border-border/60 dark:border-border-subtle bg-card dark:bg-surface-2 overflow-hidden">
+ <div className="flex border-b border-border/40 dark:border-border-subtle">
+ {tabs.map((tab) => {
+ const Icon = tab.icon;
+ const isActive = activeTab === tab.id;
+ return (
+ <button
+ key={tab.id}
+ onClick={() => setActiveTab(tab.id)}
+ className={`flex-1 flex items-center justify-center gap-2 px-4 py-3 text-[12px] font-medium transition-all duration-150 border-b-2 ${
+ isActive
+ ? "border-primary text-foreground bg-primary/5 dark:bg-primary/3"
+ : "border-transparent text-muted-foreground hover:text-foreground hover:bg-black/2 dark:hover:bg-white/2"
+ }`}
+ >
+ <Icon className="w-3.5 h-3.5" />
+ {tab.label}
+ </button>
+ );
+ })}
+ </div>
+
+ {/* ── View Tab ── */}
+ {activeTab === "current" && (
+ <div className="divide-y divide-border/40 dark:divide-border-subtle">
+ <div className="px-5 py-4">
+ <div className="space-y-2">
+ {[
+ { mode: "Cleanup", desc: "Removes filler words, fixes grammar and punctuation" },
+ {
+ mode: "Instruction",
+ desc: `Triggered by "Hey ${agentName}" β€” executes commands and cleans text`,
+ },
+ ].map((item) => (
+ <div key={item.mode} className="flex items-start gap-3">
+ <span className="shrink-0 mt-0.5 text-[10px] font-medium uppercase tracking-wider px-1.5 py-px rounded bg-muted text-muted-foreground">
+ {item.mode}
+ </span>
+ <p className="text-[12px] text-muted-foreground leading-relaxed">{item.desc}</p>
+ </div>
+ ))}
</div>
</div>
- </div>
- <div className="bg-gray-50 border rounded-lg p-4 font-mono text-sm max-h-96 overflow-y-auto">
- <pre className="whitespace-pre-wrap">
- {getCurrentPrompt().replace(/\{\{agentName\}\}/g, agentName)}
- </pre>
+ <div className="px-5 py-4">
+ <div className="flex items-center justify-between mb-3">
+ <div className="flex items-center gap-2">
+ <p className="text-[11px] font-medium text-muted-foreground/60 uppercase tracking-wider">
+ {isCustomPrompt ? "Custom prompt" : "Default prompt"}
+ </p>
+ {isCustomPrompt && (
+ <span className="text-[9px] font-semibold uppercase tracking-wider px-1.5 py-px rounded-full bg-primary/10 text-primary">
+ Modified
+ </span>
+ )}
+ </div>
+ <Button
+ onClick={() => copyText(getCurrentPrompt())}
+ variant="ghost"
+ size="sm"
+ className="h-7 px-2 text-[11px]"
+ >
+ {copiedPrompt ? (
+ <>
+ <Check className="w-3 h-3 mr-1 text-success" /> Copied
+ </>
+ ) : (
+ <>
+ <Copy className="w-3 h-3 mr-1" /> Copy
+ </>
+ )}
+ </Button>
+ </div>
+ <div className="bg-muted/30 dark:bg-surface-raised/30 border border-border/30 rounded-lg p-4 max-h-80 overflow-y-auto">
+ <pre className="text-[11px] font-mono text-muted-foreground whitespace-pre-wrap leading-relaxed">
+ {getCurrentPrompt().replace(/\{\{agentName\}\}/g, agentName)}
+ </pre>
+ </div>
+ </div>
</div>
- <Button
- onClick={() => copyPrompt(getCurrentPrompt())}
- variant="outline"
- size="sm"
- className="mt-3"
- >
- <Copy className="w-4 h-4 mr-2" />
- Copy Prompt
- </Button>
- </CardContent>
- </Card>
- </div>
- );
-
- const renderEditPrompt = () => (
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold mb-4 flex items-center gap-2">
- <Edit3 className="w-5 h-5 text-indigo-600" />
- Customize System Prompt
- </h3>
- <p className="text-sm text-gray-600 mb-2">
- Edit the system prompt to change how your AI processes speech. Use{" "}
- <code className="bg-gray-100 px-1 rounded">{"{{agentName}}"}</code> as a placeholder for
- your agent's name.
- </p>
- <p className="text-sm text-amber-600 mb-6">
- <strong>Caution:</strong> Modifying this prompt may affect transcription quality. The
- default prompt has been carefully crafted for optimal results.
- </p>
- </div>
+ )}
- <Card>
- <CardHeader>
- <CardTitle className="text-base">System Prompt</CardTitle>
- </CardHeader>
- <CardContent>
- <Textarea
- value={editedPrompt}
- onChange={(e) => setEditedPrompt(e.target.value)}
- rows={20}
- className="font-mono text-sm"
- placeholder="Enter your custom system prompt..."
- />
- <p className="text-xs text-gray-500 mt-2">
- Your agent name is: <strong>{agentName}</strong>
- </p>
- </CardContent>
- </Card>
-
- <div className="flex gap-3">
- <Button onClick={savePrompt} className="flex-1">
- <Save className="w-4 h-4 mr-2" />
- Save Custom Prompt
- </Button>
- <Button onClick={resetToDefault} variant="outline">
- <RotateCcw className="w-4 h-4 mr-2" />
- Reset to Default
- </Button>
- </div>
- </div>
- );
+ {/* ── Edit Tab ── */}
+ {activeTab === "edit" && (
+ <div className="divide-y divide-border/40 dark:divide-border-subtle">
+ <div className="px-5 py-4">
+ <p className="text-[12px] text-muted-foreground leading-relaxed">
+ <span className="font-medium text-warning">Caution</span> β€” Modifying this prompt
+ may affect transcription quality. Use{" "}
+ <code className="text-[11px] bg-muted/50 px-1 py-0.5 rounded font-mono">
+ {"{{agentName}}"}
+ </code>{" "}
+ as a placeholder for your agent's name.
+ </p>
+ </div>
- const renderTestPlayground = () => {
- const useReasoningModel = localStorage.getItem("useReasoningModel") !== "false";
- const reasoningModel = localStorage.getItem("reasoningModel") || "";
- const reasoningProvider = reasoningModel ? getModelProvider(reasoningModel) : "openai";
- const providerConfig = PROVIDER_CONFIG[reasoningProvider] || {
- label: reasoningProvider.charAt(0).toUpperCase() + reasoningProvider.slice(1),
- };
- const providerLabel = providerConfig.label;
- const providerEndpoint = providerConfig.baseStorageKey
- ? (localStorage.getItem(providerConfig.baseStorageKey) || "").trim()
- : "";
-
- return (
- <div className="space-y-6">
- <div>
- <h3 className="text-lg font-semibold mb-4 flex items-center gap-2">
- <TestTube className="w-5 h-5 text-green-600" />
- Test Your Prompt
- </h3>
- <p className="text-sm text-gray-600 mb-6">
- Test how the AI processes different types of input. Try both regular dictation and
- addressing your agent directly.
- </p>
- </div>
+ <div className="px-5 py-4">
+ <Textarea
+ value={editedPrompt}
+ onChange={(e) => setEditedPrompt(e.target.value)}
+ rows={16}
+ className="font-mono text-[11px] leading-relaxed"
+ placeholder="Enter your custom system prompt..."
+ />
+ <p className="text-[11px] text-muted-foreground/50 mt-2">
+ Agent name: <span className="font-medium text-foreground">{agentName}</span>
+ </p>
+ </div>
- {!useReasoningModel && (
- <div className="bg-amber-50 border border-amber-200 rounded-lg p-4 mb-4">
- <div className="flex items-start gap-3">
- <AlertTriangle className="w-5 h-5 text-amber-600 flex-shrink-0 mt-0.5" />
- <div>
- <p className="text-sm text-amber-800 font-medium">AI Text Enhancement Disabled</p>
- <p className="text-sm text-amber-700 mt-1">
- Enable AI text enhancement in the AI Text Cleanup settings to test prompts.
- </p>
+ <div className="px-5 py-4">
+ <div className="flex gap-2">
+ <Button onClick={savePrompt} size="sm" className="flex-1">
+ <Save className="w-3.5 h-3.5 mr-2" />
+ Save
+ </Button>
+ <Button onClick={resetToDefault} variant="outline" size="sm">
+ <RotateCcw className="w-3.5 h-3.5 mr-2" />
+ Reset
+ </Button>
</div>
</div>
</div>
)}
- <Card>
- <CardContent className="p-6 space-y-4">
- <div className="grid grid-cols-2 gap-4 text-sm">
- <div>
- <span className="text-gray-600">Current Model:</span>
- <span className="ml-2 font-medium">{reasoningModel || "None selected"}</span>
- </div>
- <div>
- <span className="text-gray-600">Provider:</span>
- <span className="ml-2 font-medium capitalize">{providerLabel}</span>
- {providerConfig.baseStorageKey && (
- <div className="text-xs text-gray-500 mt-1 break-all">
- Endpoint: {providerEndpoint || "Not configured"}
+ {/* ── Test Tab ── */}
+ {activeTab === "test" &&
+ (() => {
+ const useReasoningModel = localStorage.getItem("useReasoningModel") === "true";
+ const reasoningModel = localStorage.getItem("reasoningModel") || "";
+ const reasoningProvider = reasoningModel ? getModelProvider(reasoningModel) : "openai";
+ const providerConfig = PROVIDER_CONFIG[reasoningProvider] || {
+ label: reasoningProvider.charAt(0).toUpperCase() + reasoningProvider.slice(1),
+ };
+
+ return (
+ <div className="divide-y divide-border/40 dark:divide-border-subtle">
+ {!useReasoningModel && (
+ <div className="px-5 py-4">
+ <div className="rounded-lg border border-warning/20 bg-warning/5 dark:bg-warning/10 px-4 py-3">
+ <div className="flex items-start gap-2.5">
+ <AlertTriangle className="w-3.5 h-3.5 text-warning mt-0.5 shrink-0" />
+ <p className="text-[12px] text-muted-foreground leading-relaxed">
+ AI text enhancement is disabled. Enable it in{" "}
+ <span className="font-medium text-foreground">AI Models</span> to test
+ prompts.
+ </p>
+ </div>
+ </div>
</div>
)}
- </div>
- </div>
- <div>
- <label className="block text-sm font-medium mb-2">Test Input</label>
- <Textarea
- value={testText}
- onChange={(e) => setTestText(e.target.value)}
- rows={4}
- placeholder="Enter text to test..."
- />
- <div className="flex items-center justify-between mt-2">
- <div className="text-xs text-gray-500 space-y-1">
- <p>Try: "um so like I think we should uh schedule a meeting" (cleanup mode)</p>
- <p>
- Try: "Hey {agentName}, make this more formal: gonna send the report tomorrow"
- (instruction mode)
+ <div className="px-5 py-4">
+ <div className="flex items-center gap-4">
+ <div className="flex items-center gap-2">
+ <p className="text-[11px] text-muted-foreground/60 uppercase tracking-wider">
+ Model
+ </p>
+ <p className="text-[12px] font-medium text-foreground font-mono">
+ {reasoningModel || "None"}
+ </p>
+ </div>
+ <div className="h-3 w-px bg-border/40" />
+ <div className="flex items-center gap-2">
+ <p className="text-[11px] text-muted-foreground/60 uppercase tracking-wider">
+ Provider
+ </p>
+ <p className="text-[12px] font-medium text-foreground">
+ {providerConfig.label}
+ </p>
+ </div>
+ </div>
+ </div>
+
+ <div className="px-5 py-4">
+ <div className="flex items-center justify-between mb-2">
+ <p className="text-[12px] font-medium text-foreground">Input</p>
+ {testText && (
+ <span
+ className={`text-[10px] font-medium uppercase tracking-wider px-1.5 py-px rounded ${
+ isAgentAddressed
+ ? "bg-primary/10 text-primary dark:bg-primary/15"
+ : "bg-muted text-muted-foreground"
+ }`}
+ >
+ {isAgentAddressed ? "Instruction" : "Cleanup"}
+ </span>
+ )}
+ </div>
+ <Textarea
+ value={testText}
+ onChange={(e) => setTestText(e.target.value)}
+ rows={3}
+ className="text-[12px]"
+ placeholder="Enter text to test..."
+ />
+ <p className="text-[10px] text-muted-foreground/40 mt-1.5">
+ Try addressing "{agentName}" to test instruction mode
</p>
</div>
- {testText && (
- <span
- className={`text-xs px-2 py-1 rounded-full whitespace-nowrap ml-4 ${
- isAgentAddressed
- ? "bg-purple-100 text-purple-700"
- : "bg-green-100 text-green-700"
- }`}
- >
- {isAgentAddressed ? "May trigger instruction mode" : "Cleanup mode"}
- </span>
- )}
- </div>
- </div>
- <Button
- onClick={testPrompt}
- disabled={!testText.trim() || isLoading || !useReasoningModel}
- className="w-full"
- >
- <Play className="w-4 h-4 mr-2" />
- {isLoading ? "Processing..." : "Test with AI"}
- </Button>
-
- {testResult && (
- <div>
- <div className="flex items-center justify-between mb-2">
- <label className="text-sm font-medium">AI Output</label>
- <Button onClick={() => copyPrompt(testResult)} variant="ghost" size="sm">
- <Copy className="w-4 h-4" />
+ <div className="px-5 py-4">
+ <Button
+ onClick={testPrompt}
+ disabled={!testText.trim() || isLoading || !useReasoningModel}
+ size="sm"
+ className="w-full"
+ >
+ <Play className="w-3.5 h-3.5 mr-2" />
+ {isLoading ? "Processing..." : "Run Test"}
</Button>
</div>
- <div className="border rounded-lg p-4 text-sm max-h-60 overflow-y-auto bg-gray-50 border-gray-200">
- <pre className="whitespace-pre-wrap">{testResult}</pre>
- </div>
- </div>
- )}
- </CardContent>
- </Card>
- </div>
- );
- };
-
- return (
- <div className={className}>
- <AlertDialog
- open={alertDialog.open}
- onOpenChange={(open) => !open && hideAlertDialog()}
- title={alertDialog.title}
- description={alertDialog.description}
- onOk={() => {}}
- />
- {/* Tab Navigation */}
- <div className="flex border-b border-gray-200 mb-6">
- {[
- { id: "current", label: "Current Prompt", icon: Eye },
- { id: "edit", label: "Customize", icon: Edit3 },
- { id: "test", label: "Test", icon: TestTube },
- ].map((tab) => {
- const Icon = tab.icon;
- return (
- <button
- key={tab.id}
- onClick={() => setActiveTab(tab.id as any)}
- className={`flex items-center gap-2 px-4 py-2 border-b-2 transition-colors ${
- activeTab === tab.id
- ? "border-indigo-600 text-indigo-600"
- : "border-transparent text-gray-600 hover:text-gray-900"
- }`}
- >
- <Icon className="w-4 h-4" />
- {tab.label}
- </button>
- );
- })}
+ {testResult && (
+ <div className="px-5 py-4">
+ <div className="flex items-center justify-between mb-2">
+ <p className="text-[12px] font-medium text-foreground">Output</p>
+ <Button
+ onClick={() => copyText(testResult)}
+ variant="ghost"
+ size="sm"
+ className="h-6 px-1.5"
+ >
+ <Copy className="w-3 h-3 text-muted-foreground" />
+ </Button>
+ </div>
+ <div className="bg-muted/30 dark:bg-surface-raised/30 border border-border/30 rounded-lg p-4 max-h-48 overflow-y-auto">
+ <pre className="text-[12px] text-foreground whitespace-pre-wrap leading-relaxed">
+ {testResult}
+ </pre>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+ })()}
</div>
-
- {/* Tab Content */}
- {activeTab === "current" && renderCurrentPrompt()}
- {activeTab === "edit" && renderEditPrompt()}
- {activeTab === "test" && renderTestPlayground()}
</div>
);
}
diff --git a/src/components/ui/ProviderIcon.tsx b/src/components/ui/ProviderIcon.tsx
index 7912d1c47..766477a7e 100644
--- a/src/components/ui/ProviderIcon.tsx
+++ b/src/components/ui/ProviderIcon.tsx
@@ -6,6 +6,8 @@ interface ProviderIconProps {
className?: string;
}
+const MONOCHROME_PROVIDERS = ["openai", "whisper", "anthropic", "openai-oss"];
+
export function ProviderIcon({ provider, className = "w-5 h-5" }: ProviderIconProps) {
if (provider === "custom") {
return <Wrench className={className} />;
@@ -21,5 +23,13 @@ export function ProviderIcon({ provider, className = "w-5 h-5" }: ProviderIconPr
return <Brain className={className} />;
}
- return <img src={iconUrl} alt={`${provider} icon`} className={className} />;
+ const isMonochrome = MONOCHROME_PROVIDERS.includes(provider);
+
+ return (
+ <img
+ src={iconUrl}
+ alt={`${provider} icon`}
+ className={`${className} ${isMonochrome ? "icon-monochrome" : ""}`}
+ />
+ );
}
diff --git a/src/components/ui/ProviderTabs.tsx b/src/components/ui/ProviderTabs.tsx
index 18372517d..72581f2cf 100644
--- a/src/components/ui/ProviderTabs.tsx
+++ b/src/components/ui/ProviderTabs.tsx
@@ -1,10 +1,11 @@
-import { ReactNode } from "react";
+import { ReactNode, useRef, useState, useEffect, useCallback } from "react";
import { ProviderIcon } from "./ProviderIcon";
import type { ColorScheme as BaseColorScheme } from "../../utils/modelPickerStyles";
export interface ProviderTabItem {
id: string;
name: string;
+ recommended?: boolean;
}
type ColorScheme = Exclude<BaseColorScheme, "blue"> | "dynamic";
@@ -19,22 +20,6 @@ interface ProviderTabsProps {
scrollable?: boolean;
}
-const COLOR_CONFIG: Record<
- Exclude<ColorScheme, "dynamic">,
- { text: string; border: string; bg: string }
-> = {
- indigo: {
- text: "text-indigo-700",
- border: "rgb(99 102 241)",
- bg: "rgb(238 242 255)",
- },
- purple: {
- text: "text-purple-700",
- border: "rgb(147 51 234)",
- bg: "rgb(250 245 255)",
- },
-};
-
export function ProviderTabs({
providers,
selectedId,
@@ -43,33 +28,74 @@ export function ProviderTabs({
colorScheme = "indigo",
scrollable = false,
}: ProviderTabsProps) {
- const colors = colorScheme !== "dynamic" ? COLOR_CONFIG[colorScheme] : null;
+ const containerRef = useRef<HTMLDivElement>(null);
+ const [indicatorStyle, setIndicatorStyle] = useState<React.CSSProperties>({
+ opacity: 0,
+ });
+
+ const updateIndicator = useCallback(() => {
+ const container = containerRef.current;
+ if (!container) return;
+
+ const selectedIndex = providers.findIndex((p) => p.id === selectedId);
+ if (selectedIndex === -1) {
+ setIndicatorStyle({ opacity: 0 });
+ return;
+ }
+
+ const buttons = container.querySelectorAll<HTMLButtonElement>("[data-tab-button]");
+ const selectedButton = buttons[selectedIndex];
+ if (!selectedButton) return;
+
+ const containerRect = container.getBoundingClientRect();
+ const buttonRect = selectedButton.getBoundingClientRect();
+
+ setIndicatorStyle({
+ width: buttonRect.width,
+ height: buttonRect.height,
+ transform: `translateX(${buttonRect.left - containerRect.left}px)`,
+ opacity: 1,
+ });
+ }, [providers, selectedId]);
+
+ useEffect(() => {
+ updateIndicator();
+ }, [updateIndicator]);
+
+ useEffect(() => {
+ const observer = new ResizeObserver(() => updateIndicator());
+ if (containerRef.current) observer.observe(containerRef.current);
+ return () => observer.disconnect();
+ }, [updateIndicator]);
return (
<div
- className={`flex bg-gray-50 border-b border-gray-200 ${scrollable ? "overflow-x-auto" : ""}`}
+ ref={containerRef}
+ className={`relative flex p-0.5 rounded-md bg-surface-raised dark:bg-white/3 ${scrollable ? "overflow-x-auto" : ""}`}
>
+ {/* Sliding indicator - frosted glass treatment */}
+ <div
+ className="absolute top-0.5 left-0 rounded-md bg-white dark:bg-surface-3 border border-border dark:border-border-subtle shadow-[0_1px_2px_rgba(0,0,0,0.08)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] transition-all duration-200 ease-out pointer-events-none"
+ style={indicatorStyle}
+ />
+
{providers.map((provider) => {
const isSelected = selectedId === provider.id;
- // Get styles based on color scheme
- const selectedStyles = colors
- ? { borderBottomColor: colors.border, backgroundColor: colors.bg }
- : { borderBottomColor: "rgb(99 102 241)", backgroundColor: "rgb(238 242 255)" };
-
- const textClass = isSelected ? colors?.text || "text-indigo-700" : "text-gray-600";
-
return (
<button
key={provider.id}
+ data-tab-button
onClick={() => onSelect(provider.id)}
- className={`flex-1 flex items-center justify-center gap-2 px-4 py-3 font-medium transition-all ${
+ className={`relative z-10 flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 rounded-md font-medium text-xs transition-colors duration-150 ${
scrollable ? "whitespace-nowrap" : ""
- } ${textClass} ${isSelected ? "border-b-2" : "hover:bg-gray-100"}`}
- style={isSelected ? selectedStyles : undefined}
+ } ${isSelected ? "text-foreground" : "text-muted-foreground hover:text-foreground"}`}
>
{renderIcon ? renderIcon(provider.id) : <ProviderIcon provider={provider.id} />}
<span>{provider.name}</span>
+ {provider.recommended && (
+ <span className="text-[9px] text-primary/70 font-medium">Recommended</span>
+ )}
</button>
);
})}
diff --git a/src/components/ui/SettingsSection.tsx b/src/components/ui/SettingsSection.tsx
index 51ddc2e82..322bf22ad 100644
--- a/src/components/ui/SettingsSection.tsx
+++ b/src/components/ui/SettingsSection.tsx
@@ -14,10 +14,14 @@ export const SettingsSection: React.FC<SettingsSectionProps> = ({
className = "",
}) => {
return (
- <div className={`space-y-4 ${className}`}>
+ <div className={`space-y-3 ${className}`}>
<div>
- <h3 className="text-lg font-semibold text-gray-900 mb-2">{title}</h3>
- {description && <p className="text-sm text-gray-600 mb-4">{description}</p>}
+ <h3 className="text-[13px] font-semibold text-foreground tracking-tight">{title}</h3>
+ {description && (
+ <p className="text-[11px] text-muted-foreground/80 mt-0.5 leading-relaxed">
+ {description}
+ </p>
+ )}
</div>
{children}
</div>
@@ -37,16 +41,44 @@ export const SettingsGroup: React.FC<SettingsGroupProps> = ({
variant = "default",
className = "",
}) => {
- const baseClasses = "space-y-4 p-4 rounded-xl border";
+ const baseClasses = "space-y-3 p-3 rounded-lg border";
const variantClasses = {
- default: "bg-gray-50 border-gray-200",
- highlighted: "bg-blue-50 border-blue-200",
+ default: "bg-card/50 dark:bg-surface-2/50 border-border/50 dark:border-border-subtle",
+ highlighted: "bg-primary/5 dark:bg-primary/10 border-primary/20 dark:border-primary/30",
};
return (
<div className={`${baseClasses} ${variantClasses[variant]} ${className}`}>
- {title && <h4 className="font-medium text-gray-900">{title}</h4>}
+ {title && <h4 className="text-[12px] font-medium text-foreground">{title}</h4>}
{children}
</div>
);
};
+
+interface SettingsRowProps {
+ label: string;
+ description?: string;
+ children: React.ReactNode;
+ className?: string;
+}
+
+export const SettingsRow: React.FC<SettingsRowProps> = ({
+ label,
+ description,
+ children,
+ className = "",
+}) => {
+ return (
+ <div className={`flex items-center justify-between gap-4 ${className}`}>
+ <div className="min-w-0 flex-1">
+ <p className="text-[12px] font-medium text-foreground">{label}</p>
+ {description && (
+ <p className="text-[11px] text-muted-foreground/80 mt-0.5 leading-relaxed">
+ {description}
+ </p>
+ )}
+ </div>
+ <div className="shrink-0">{children}</div>
+ </div>
+ );
+};
diff --git a/src/components/ui/SidebarModal.tsx b/src/components/ui/SidebarModal.tsx
index ec9c6aa9f..64e17f5a3 100644
--- a/src/components/ui/SidebarModal.tsx
+++ b/src/components/ui/SidebarModal.tsx
@@ -6,6 +6,11 @@ export interface SidebarItem<T extends string> {
id: T;
label: string;
icon: React.ComponentType<{ className?: string }>;
+ group?: string;
+ description?: string;
+ badge?: string;
+ badgeVariant?: "default" | "new" | "update" | "dot";
+ shortcut?: string;
}
interface SidebarModalProps<T extends string> {
@@ -17,6 +22,7 @@ interface SidebarModalProps<T extends string> {
onSectionChange: (section: T) => void;
children: React.ReactNode;
sidebarWidth?: string;
+ version?: string;
}
export default function SidebarModal<T extends string>({
@@ -27,53 +33,150 @@ export default function SidebarModal<T extends string>({
activeSection,
onSectionChange,
children,
- sidebarWidth = "w-72",
+ sidebarWidth = "w-52",
+ version,
}: SidebarModalProps<T>) {
+ // Group items by their group property
+ const groupedItems = React.useMemo(() => {
+ const groups: { label: string | null; items: SidebarItem<T>[] }[] = [];
+ let currentGroup: string | null | undefined = undefined;
+
+ for (const item of sidebarItems) {
+ const group = item.group ?? null;
+ if (group !== currentGroup) {
+ groups.push({ label: group, items: [item] });
+ currentGroup = group;
+ } else {
+ groups[groups.length - 1].items.push(item);
+ }
+ }
+
+ return groups;
+ }, [sidebarItems]);
+
+ const renderBadge = (item: SidebarItem<T>) => {
+ if (!item.badge && item.badgeVariant !== "dot") return null;
+
+ if (item.badgeVariant === "dot") {
+ return <span className="ml-auto h-1.5 w-1.5 rounded-full bg-primary shrink-0" />;
+ }
+
+ return (
+ <span
+ className={`ml-auto text-[9px] font-semibold uppercase tracking-wider px-1.5 py-px rounded-sm shrink-0 ${
+ item.badgeVariant === "new"
+ ? "bg-primary/10 text-primary dark:bg-primary/15"
+ : item.badgeVariant === "update"
+ ? "bg-warning/10 text-warning dark:bg-warning/15"
+ : "bg-muted text-muted-foreground"
+ }`}
+ >
+ {item.badge}
+ </span>
+ );
+ };
+
return (
<DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>
<DialogPrimitive.Portal>
- <DialogPrimitive.Overlay className="fixed inset-0 z-50 bg-black/30 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" />
- <DialogPrimitive.Content className="fixed left-[50%] top-[50%] z-50 max-h-[90vh] w-[90vw] max-w-5xl translate-x-[-50%] translate-y-[-50%] rounded-2xl bg-white p-0 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] overflow-hidden">
- <div className="relative h-full max-h-[90vh] overflow-hidden">
- <DialogPrimitive.Close className="absolute right-6 top-6 z-10 rounded-full bg-gray-100 p-2 opacity-70 ring-offset-background transition-all hover:opacity-100 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2">
- <X className="h-4 w-4 text-gray-600" />
+ <DialogPrimitive.Overlay className="fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" />
+ <DialogPrimitive.Content className="fixed left-[50%] top-[50%] z-50 max-h-[85vh] w-[90vw] max-w-4xl translate-x-[-50%] translate-y-[-50%] rounded-xl p-0 overflow-hidden bg-background border border-border shadow-[0_25px_50px_-12px_rgba(0,0,0,0.25)] dark:bg-surface-1 dark:border-border-subtle dark:shadow-[0_25px_60px_-12px_rgba(0,0,0,0.5),0_0_0_1px_rgba(255,255,255,0.05)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98">
+ <div className="relative h-full max-h-[85vh] overflow-hidden">
+ <DialogPrimitive.Close className="absolute right-4 top-4 z-10 rounded-md p-1.5 opacity-40 ring-offset-background transition-all hover:opacity-100 bg-transparent hover:bg-muted dark:hover:bg-surface-raised focus:outline-none focus:ring-2 focus:ring-ring/30 focus:ring-offset-1">
+ <X className="h-3.5 w-3.5 text-muted-foreground" />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
- <div className="flex h-[90vh]">
+ <div className="flex h-[85vh]">
{/* Sidebar */}
- <div className={`${sidebarWidth} bg-gray-50 border-r border-gray-200 p-4`}>
- <h2 className="text-xl font-semibold text-gray-900 mb-4 px-2">{title}</h2>
- <nav className="space-y-1">
- {sidebarItems.map((item) => {
- const Icon = item.icon;
- return (
- <button
- key={item.id}
- onClick={() => onSectionChange(item.id)}
- className={`w-full flex items-center gap-2 px-3 py-2.5 text-left text-sm rounded-lg transition-all duration-200 ${
- activeSection === item.id
- ? "bg-white text-gray-900 shadow-sm border border-gray-200"
- : "text-gray-600 hover:text-gray-900 hover:bg-gray-100"
- }`}
- >
- <Icon
- className={`h-4 w-4 flex-shrink-0 ${
- activeSection === item.id ? "text-indigo-600" : ""
- }`}
- />
- <span className="font-medium flex-1">{item.label}</span>
- </button>
- );
- })}
+ <div
+ className={`${sidebarWidth} shrink-0 border-r border-border/40 dark:border-border-subtle flex flex-col bg-surface-1 dark:bg-surface-0`}
+ >
+ {/* Title */}
+ <div className="px-4 pt-5 pb-0.5">
+ <h2 className="text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/50">
+ {title}
+ </h2>
+ </div>
+
+ {/* Navigation */}
+ <nav className="relative flex-1 px-2 pt-2.5 pb-2 overflow-y-auto">
+ {groupedItems.map((group, groupIndex) => (
+ <div key={groupIndex} className={groupIndex > 0 ? "mt-3" : ""}>
+ {group.label && (
+ <div className="px-2 pb-0.5 pt-1.5">
+ <span className="text-[9px] font-medium tracking-[0.08em] uppercase text-muted-foreground/35 dark:text-muted-foreground/50">
+ {group.label}
+ </span>
+ </div>
+ )}
+ <div className="space-y-px">
+ {group.items.map((item) => {
+ const Icon = item.icon;
+ const isActive = activeSection === item.id;
+ return (
+ <button
+ key={item.id}
+ data-section-id={item.id}
+ onClick={() => onSectionChange(item.id)}
+ className={`group relative w-full flex items-center gap-2.5 px-2.5 py-2 text-left text-[12px] rounded-lg transition-all duration-100 outline-none ${
+ isActive
+ ? "text-foreground bg-muted dark:bg-surface-raised"
+ : "text-muted-foreground dark:text-foreground/60 hover:text-foreground hover:bg-muted/50 dark:hover:bg-surface-2"
+ }`}
+ >
+ {/* Active indicator bar */}
+ {isActive && (
+ <div className="absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-4 rounded-full bg-primary" />
+ )}
+ <div
+ className={`flex items-center justify-center h-6 w-6 rounded-md shrink-0 transition-all duration-100 ${
+ isActive ? "bg-primary/10 dark:bg-primary/15" : "bg-transparent"
+ }`}
+ >
+ <Icon
+ className={`h-4 w-4 shrink-0 transition-colors duration-100 ${
+ isActive
+ ? "text-primary"
+ : "text-muted-foreground/60 dark:text-foreground/40 group-hover:text-foreground/80"
+ }`}
+ />
+ </div>
+ <span
+ className={`flex-1 truncate leading-tight ${isActive ? "font-medium" : "font-normal"}`}
+ >
+ {item.label}
+ </span>
+ {renderBadge(item)}
+ {item.shortcut && !item.badge && (
+ <kbd className="ml-auto text-[9px] text-muted-foreground/25 font-mono shrink-0">
+ {item.shortcut}
+ </kbd>
+ )}
+ </button>
+ );
+ })}
+ </div>
+ </div>
+ ))}
</nav>
+
+ {/* Footer / version */}
+ {version && (
+ <div className="px-3 py-2.5 border-t border-border/20 dark:border-border-subtle">
+ <div className="flex items-center gap-1.5">
+ <div className="h-1 w-1 rounded-full bg-success/60" />
+ <span className="text-[9px] text-muted-foreground/40 tabular-nums tracking-wide">
+ v{version}
+ </span>
+ </div>
+ </div>
+ )}
</div>
{/* Main Content */}
- <div className="flex-1 overflow-y-auto bg-white">
- <div className="p-8">
- <div className="max-w-3xl">{children}</div>
- </div>
+ <div className="flex-1 overflow-y-auto bg-background dark:bg-surface-1">
+ <div className="p-6">{children}</div>
</div>
</div>
</div>
diff --git a/src/components/ui/StepProgress.tsx b/src/components/ui/StepProgress.tsx
index dd9d59757..8d9c285b0 100644
--- a/src/components/ui/StepProgress.tsx
+++ b/src/components/ui/StepProgress.tsx
@@ -14,40 +14,58 @@ interface StepProgressProps {
export default function StepProgress({ steps, currentStep, className = "" }: StepProgressProps) {
return (
- <div className={`flex items-center justify-between ${className}`}>
+ <div className={`flex items-center justify-center gap-1 ${className}`}>
{steps.map((step, index) => {
const Icon = step.icon;
const isActive = index === currentStep;
const isCompleted = index < currentStep;
return (
- <div key={index} className="flex">
+ <React.Fragment key={index}>
<div
- className={`flex items-center gap-2 ${
- isActive ? "text-blue-600" : isCompleted ? "text-green-600" : "text-stone-400"
+ className={`flex items-center gap-1.5 px-2 py-1 rounded-full transition-all duration-200 ${
+ isActive
+ ? "bg-primary/15 text-primary"
+ : isCompleted
+ ? "text-success"
+ : "text-muted-foreground/50"
}`}
>
<div
- className={`w-6 h-6 rounded-full flex items-center justify-center border-2 flex-shrink-0 transition-all duration-200 ${
+ className={`w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0 transition-all duration-200 ${
isActive
- ? "border-blue-600 bg-blue-50 shadow-sm"
+ ? "bg-primary text-white shadow-sm"
: isCompleted
- ? "border-green-600 bg-green-50 shadow-sm"
- : "border-stone-300 bg-white"
+ ? "bg-success/20 text-success"
+ : "bg-white/5 text-muted-foreground/50"
}`}
>
- {isCompleted ? <Check className="w-4 h-4" /> : <Icon className="w-4 h-4" />}
+ {isCompleted ? (
+ <Check className="w-3 h-3" strokeWidth={2.5} />
+ ) : (
+ <Icon className="w-3 h-3" />
+ )}
</div>
- <span className="text-xs font-medium hidden md:block truncate">{step.title}</span>
+ <span
+ className={`text-[11px] font-medium hidden md:block ${
+ isActive
+ ? "text-primary"
+ : isCompleted
+ ? "text-success"
+ : "text-muted-foreground/50"
+ }`}
+ >
+ {step.title}
+ </span>
</div>
{index < steps.length - 1 && (
<div
- className={`flex-1 h-0.5 mx-3 rounded-full transition-colors duration-200 ${
- isCompleted ? "bg-green-600" : "bg-stone-300"
+ className={`w-4 h-px transition-colors duration-200 ${
+ isCompleted ? "bg-success/50" : "bg-white/10"
}`}
/>
)}
- </div>
+ </React.Fragment>
);
})}
</div>
diff --git a/src/components/ui/SupportDropdown.tsx b/src/components/ui/SupportDropdown.tsx
index 71fd85892..0d055ecea 100644
--- a/src/components/ui/SupportDropdown.tsx
+++ b/src/components/ui/SupportDropdown.tsx
@@ -7,6 +7,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "./dropdown-menu";
+import { cn } from "../lib/utils";
interface SupportDropdownProps {
className?: string;
@@ -44,21 +45,28 @@ export default function SupportDropdown({ className }: SupportDropdownProps) {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <Button variant="ghost" size="icon" className={className}>
+ <Button
+ variant="ghost"
+ size="icon"
+ className={cn(
+ "text-foreground/70 hover:text-foreground hover:bg-foreground/10",
+ className
+ )}
+ >
<HelpCircle size={16} />
</Button>
</DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="bg-white border border-gray-200 shadow-lg">
+ <DropdownMenuContent align="end" className="bg-popover border border-border shadow-lg">
<DropdownMenuItem
onClick={handleContactSupport}
- className="cursor-pointer hover:bg-gray-50 focus:bg-gray-50"
+ className="cursor-pointer hover:bg-muted focus:bg-muted"
>
<Mail className="mr-2 h-4 w-4" />
Contact Support
</DropdownMenuItem>
<DropdownMenuItem
onClick={handleSubmitBug}
- className="cursor-pointer hover:bg-gray-50 focus:bg-gray-50"
+ className="cursor-pointer hover:bg-muted focus:bg-muted"
>
<Bug className="mr-2 h-4 w-4" />
Submit Bug
diff --git a/src/components/ui/Toast.tsx b/src/components/ui/Toast.tsx
index 3996b1f6c..af141dd37 100644
--- a/src/components/ui/Toast.tsx
+++ b/src/components/ui/Toast.tsx
@@ -1,5 +1,6 @@
import * as React from "react";
-import { X } from "lucide-react";
+import { X, CheckCircle2, AlertCircle, Info } from "lucide-react";
+import { cn } from "../lib/utils";
export interface ToastProps {
id?: string;
@@ -14,6 +15,7 @@ export interface ToastProps {
export interface ToastContextType {
toast: (props: Omit<ToastProps, "id">) => void;
dismiss: (id?: string) => void;
+ toastCount: number;
}
const ToastContext = React.createContext<ToastContextType | undefined>(undefined);
@@ -26,96 +28,302 @@ export const useToast = () => {
return context;
};
-export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
- const [toasts, setToasts] = React.useState<(ToastProps & { id: string })[]>([]);
-
- const toast = React.useCallback((props: Omit<ToastProps, "id">) => {
- const id = Math.random().toString(36).substr(2, 9);
- const newToast = { ...props, id };
+interface ToastState extends ToastProps {
+ id: string;
+ isExiting?: boolean;
+ createdAt: number;
+}
- setToasts((prev) => [...prev, newToast]);
+export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
+ const [toasts, setToasts] = React.useState<ToastState[]>([]);
+ const timersRef = React.useRef<Record<string, ReturnType<typeof setTimeout>>>({});
- // Auto-dismiss after duration
- const duration = props.duration ?? 3500;
- if (duration > 0) {
- setTimeout(() => {
- dismiss(id);
- }, duration);
+ const clearTimer = React.useCallback((id: string) => {
+ const timer = timersRef.current[id];
+ if (timer) {
+ clearTimeout(timer);
+ delete timersRef.current[id];
}
+ }, []);
- return id;
+ 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);
}, []);
- const dismiss = React.useCallback((id?: string) => {
- setToasts((prev) => {
+ const toast = React.useCallback(
+ (props: Omit<ToastProps, "id">) => {
+ const id = Math.random().toString(36).substring(2, 11);
+ const newToast: ToastState = { ...props, id, createdAt: Date.now() };
+
+ setToasts((prev) => [...prev, newToast]);
+
+ const duration = props.duration ?? 3500;
+ if (duration > 0) {
+ const timer = setTimeout(() => {
+ startExitAnimation(id);
+ }, duration);
+ timersRef.current[id] = timer;
+ }
+
+ return id;
+ },
+ [startExitAnimation]
+ );
+
+ const dismiss = React.useCallback(
+ (id?: string) => {
if (id) {
- return prev.filter((toast) => toast.id !== id);
+ clearTimer(id);
+ startExitAnimation(id);
+ } else {
+ const lastToast = toasts[toasts.length - 1];
+ if (lastToast) {
+ clearTimer(lastToast.id);
+ startExitAnimation(lastToast.id);
+ }
+ }
+ },
+ [toasts, clearTimer, startExitAnimation]
+ );
+
+ const pauseTimer = React.useCallback(
+ (id: string) => {
+ clearTimer(id);
+ },
+ [clearTimer]
+ );
+
+ const resumeTimer = React.useCallback(
+ (id: string, remainingTime: number) => {
+ if (remainingTime > 0) {
+ const timer = setTimeout(() => {
+ startExitAnimation(id);
+ }, remainingTime);
+ timersRef.current[id] = timer;
}
- return prev.slice(0, -1);
- });
+ },
+ [startExitAnimation]
+ );
+
+ // Cleanup on unmount
+ React.useEffect(() => {
+ return () => {
+ const timers = timersRef.current;
+ for (const id in timers) {
+ clearTimeout(timers[id]);
+ }
+ };
}, []);
return (
- <ToastContext.Provider value={{ toast, dismiss }}>
+ <ToastContext.Provider value={{ toast, dismiss, toastCount: toasts.length }}>
{children}
- <ToastViewport toasts={toasts} onDismiss={dismiss} />
+ <ToastViewport
+ toasts={toasts}
+ onDismiss={dismiss}
+ onPauseTimer={pauseTimer}
+ onResumeTimer={resumeTimer}
+ />
</ToastContext.Provider>
);
};
const ToastViewport: React.FC<{
- toasts: (ToastProps & { id: string })[];
+ toasts: ToastState[];
onDismiss: (id: string) => void;
-}> = ({ toasts, onDismiss }) => {
+ 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 &&
+ window.location.search.indexOf("panel=true") === -1
+ );
+ }, []);
+
if (toasts.length === 0) return null;
return (
- <div className="fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm">
+ <div
+ className={cn(
+ "fixed z-50 flex flex-col gap-1.5 pointer-events-none",
+ isDictationPanel
+ ? "bottom-20 right-6" // Above mic button in dictation panel
+ : "bottom-5 right-5" // Standard position in control panel
+ )}
+ >
{toasts.map((toast) => (
- <Toast key={toast.id} {...toast} onClose={() => onDismiss(toast.id)} />
+ <Toast
+ key={toast.id}
+ {...toast}
+ onClose={() => onDismiss(toast.id)}
+ onPauseTimer={() => onPauseTimer(toast.id)}
+ onResumeTimer={(remaining) => onResumeTimer(toast.id, remaining)}
+ />
))}
</div>
);
};
-const Toast: React.FC<ToastProps & { onClose?: () => void }> = ({
+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)]"
+ ),
+ iconClass: "text-muted-foreground",
+ titleClass: "text-card-foreground",
+ descClass: "text-muted-foreground",
+ progressClass: "bg-muted-foreground/30",
+ },
+ 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)]"
+ ),
+ iconClass: "text-destructive",
+ titleClass: "text-destructive dark:text-red-400",
+ descClass: "text-destructive/80 dark:text-red-400/80",
+ progressClass: "bg-destructive/40",
+ },
+ 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)]"
+ ),
+ iconClass: "text-success",
+ titleClass: "text-success dark:text-emerald-400",
+ descClass: "text-success/80 dark:text-emerald-400/80",
+ progressClass: "bg-success/40",
+ },
+};
+
+const Toast: React.FC<
+ ToastState & {
+ onClose?: () => void;
+ onPauseTimer: () => void;
+ onResumeTimer: (remaining: number) => void;
+ }
+> = ({
title,
description,
action,
variant = "default",
+ duration = 3500,
+ isExiting,
+ createdAt,
onClose,
+ onPauseTimer,
+ onResumeTimer,
}) => {
- const baseClasses =
- "relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-lg border p-4 pr-8 shadow-lg transition-all duration-300 ease-in-out";
+ const config = variantConfig[variant];
+ const Icon = config.icon;
+ const pausedAtRef = React.useRef<number | null>(null);
- const variantClasses = {
- default: "bg-white border-gray-200 text-gray-900",
- destructive: "bg-red-50 border-red-200 text-red-900",
- success: "bg-green-50 border-green-200 text-green-900",
+ const handleMouseEnter = () => {
+ pausedAtRef.current = Date.now();
+ onPauseTimer();
};
- const iconClasses = {
- default: "text-gray-400",
- destructive: "text-red-400",
- success: "text-green-400",
+ const handleMouseLeave = () => {
+ if (pausedAtRef.current && duration > 0) {
+ const elapsed = pausedAtRef.current - createdAt;
+ const remaining = Math.max(duration - elapsed, 500);
+ onResumeTimer(remaining);
+ }
+ pausedAtRef.current = null;
};
return (
- <div className={`${baseClasses} ${variantClasses[variant]}`}>
- <div className="flex-1 space-y-1">
- {title && <div className="text-sm font-medium">{title}</div>}
- {description && <div className="text-sm opacity-90">{description}</div>}
+ <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)}>
+ {title}
+ </div>
+ )}
+ {description && (
+ <div className={cn("text-[12px] leading-snug mt-0.5", config.descClass)}>
+ {description}
+ </div>
+ )}
</div>
- {action && <div className="flex-shrink-0">{action}</div>}
+
+ {/* Action slot */}
+ {action && <div className="shrink-0 self-center">{action}</div>}
+
+ {/* Close button */}
{onClose && (
<button
onClick={onClose}
- className={`absolute right-2 top-2 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 ${iconClasses[variant]}`}
+ className={cn(
+ "absolute right-1.5 top-1.5 p-1 rounded-[4px]",
+ "opacity-50 hover:opacity-100",
+ "hover:bg-foreground/5 dark:hover:bg-white/10",
+ "transition-all duration-150",
+ "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring/40",
+ config.iconClass
+ )}
>
- <X className="h-4 w-4" />
+ <X className="size-3.5" />
<span className="sr-only">Close</span>
</button>
)}
+
+ {/* Progress indicator - subtle bottom bar */}
+ {duration > 0 && !isExiting && (
+ <div className="absolute bottom-0 left-0 right-0 h-[2px] overflow-hidden">
+ <div
+ className={cn("h-full", config.progressClass)}
+ style={{
+ animation: `toast-progress ${duration}ms linear forwards`,
+ }}
+ />
+ </div>
+ )}
</div>
);
};
diff --git a/src/components/ui/TranscriptionItem.tsx b/src/components/ui/TranscriptionItem.tsx
index c0ccb5cd8..5276687d1 100644
--- a/src/components/ui/TranscriptionItem.tsx
+++ b/src/components/ui/TranscriptionItem.tsx
@@ -1,7 +1,8 @@
-import React from "react";
+import { useState } from "react";
import { Button } from "./button";
-import { Copy, Trash2 } from "lucide-react";
+import { Copy, Trash2, ChevronDown, ChevronUp } from "lucide-react";
import type { TranscriptionItem as TranscriptionItemType } from "../../types/electron";
+import { cn } from "../lib/utils";
interface TranscriptionItemProps {
item: TranscriptionItemType;
@@ -11,6 +12,8 @@ interface TranscriptionItemProps {
onDelete: (id: number) => void;
}
+const TEXT_PREVIEW_LENGTH = 120;
+
export default function TranscriptionItem({
item,
index,
@@ -18,6 +21,9 @@ export default function TranscriptionItem({
onCopy,
onDelete,
}: TranscriptionItemProps) {
+ const [isExpanded, setIsExpanded] = useState(false);
+ const [isHovered, setIsHovered] = useState(false);
+
const timestampSource = item.timestamp.endsWith("Z") ? item.timestamp : `${item.timestamp}Z`;
const timestampDate = new Date(timestampSource);
const formattedTimestamp = Number.isNaN(timestampDate.getTime())
@@ -29,52 +35,86 @@ export default function TranscriptionItem({
minute: "2-digit",
});
+ const isLongText = item.text.length > TEXT_PREVIEW_LENGTH;
+ const displayText =
+ isExpanded || !isLongText ? item.text : `${item.text.slice(0, TEXT_PREVIEW_LENGTH)}…`;
+
return (
- <div className="relative bg-gradient-to-b from-blue-50/30 to-white rounded-xl shadow-sm hover:shadow-md transition-shadow">
- <div className="p-6 pl-16" style={{ paddingTop: "8px" }}>
- <div className="flex items-start justify-between">
- <div className="flex-1 mr-3">
- <div
- className="flex items-center gap-2 mb-1"
- style={{ marginTop: "2px", lineHeight: "24px" }}
- >
- <span className="text-indigo-600 text-xs font-medium">#{total - index}</span>
- <div className="w-px h-3 bg-neutral-300" />
- <span className="text-xs text-neutral-500">{formattedTimestamp}</span>
- </div>
- <p
- className="text-neutral-800 text-sm"
- style={{
- fontFamily:
- 'Noto Sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
- lineHeight: "24px",
- textAlign: "left",
- marginTop: "2px",
- paddingBottom: "2px",
- }}
- >
- {item.text}
- </p>
- </div>
- <div className="flex gap-1 flex-shrink-0" style={{ marginTop: "2px" }}>
- <Button
- size="icon"
- variant="ghost"
- onClick={() => onCopy(item.text)}
- className="h-7 w-7"
- >
- <Copy size={12} />
- </Button>
- <Button
- size="icon"
- variant="ghost"
- onClick={() => onDelete(item.id)}
- className="h-7 w-7 text-red-600 hover:text-red-700 hover:bg-red-50"
- >
- <Trash2 size={12} />
- </Button>
+ <div
+ className="group relative px-3 py-2.5 transition-colors duration-150 hover:bg-muted/30 dark:hover:bg-white/2"
+ onMouseEnter={() => setIsHovered(true)}
+ onMouseLeave={() => setIsHovered(false)}
+ >
+ <div className="flex items-start gap-3">
+ {/* Number badge - compact pill */}
+ <div className="flex-shrink-0 mt-0.5">
+ <span className="inline-flex items-center justify-center min-w-[28px] h-5 px-1.5 rounded-sm bg-primary/10 dark:bg-primary/15 text-primary text-[10px] font-semibold tabular-nums">
+ {total - index}
+ </span>
+ </div>
+
+ {/* Content */}
+ <div className="flex-1 min-w-0">
+ {/* Text */}
+ <p
+ className={cn(
+ "text-foreground text-[13px] leading-[1.5] break-words",
+ !isExpanded && isLongText && "line-clamp-2"
+ )}
+ >
+ {displayText}
+ </p>
+
+ {/* Metadata row */}
+ <div className="flex items-center gap-2 mt-1">
+ <span className="text-[11px] text-muted-foreground tabular-nums">
+ {formattedTimestamp}
+ </span>
+ {isLongText && (
+ <button
+ onClick={() => setIsExpanded(!isExpanded)}
+ className="inline-flex items-center gap-0.5 text-[11px] text-primary/80 hover:text-primary transition-colors"
+ >
+ {isExpanded ? (
+ <>
+ <span>Less</span>
+ <ChevronUp size={12} />
+ </>
+ ) : (
+ <>
+ <span>More</span>
+ <ChevronDown size={12} />
+ </>
+ )}
+ </button>
+ )}
</div>
</div>
+
+ {/* Actions - fade in on hover */}
+ <div
+ className={cn(
+ "flex items-center gap-0.5 flex-shrink-0 transition-opacity duration-150",
+ isHovered ? "opacity-100" : "opacity-0"
+ )}
+ >
+ <Button
+ size="icon"
+ variant="ghost"
+ onClick={() => onCopy(item.text)}
+ className="h-6 w-6 rounded-sm text-muted-foreground hover:text-foreground hover:bg-foreground/10"
+ >
+ <Copy size={12} />
+ </Button>
+ <Button
+ size="icon"
+ variant="ghost"
+ onClick={() => onDelete(item.id)}
+ className="h-6 w-6 rounded-sm text-muted-foreground hover:text-destructive hover:bg-destructive/10"
+ >
+ <Trash2 size={12} />
+ </Button>
+ </div>
</div>
</div>
);
diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx
index 0163f80f7..4efd78f9f 100644
--- a/src/components/ui/badge.tsx
+++ b/src/components/ui/badge.tsx
@@ -4,16 +4,20 @@ import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "../lib/utils";
const badgeVariants = cva(
- "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium tracking-wide transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
{
variants: {
variant: {
- default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
+ default:
+ "border-transparent bg-primary/15 text-primary dark:bg-primary/10 dark:ring-1 dark:ring-primary/20",
secondary:
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
destructive:
- "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
- outline: "text-foreground",
+ "border-transparent bg-destructive/15 text-destructive dark:ring-1 dark:ring-destructive/20",
+ outline: "text-muted-foreground border-border dark:border-border-hover",
+ success: "border-transparent bg-success/15 text-success dark:ring-1 dark:ring-success/20",
+ warning: "border-transparent bg-warning/15 text-warning dark:ring-1 dark:ring-warning/20",
+ info: "border-transparent bg-info/15 text-info dark:ring-1 dark:ring-info/20",
},
},
defaultVariants: {
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx
index 07d46dc5f..92182aae8 100644
--- a/src/components/ui/button.tsx
+++ b/src/components/ui/button.tsx
@@ -5,26 +5,106 @@ import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "../lib/utils";
const buttonVariants = cva(
- "inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all duration-150 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/30 focus-visible:ring-offset-1",
+ [
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap",
+ "rounded-[6px] text-sm font-medium cursor-pointer select-none",
+ "transition-all duration-150 ease-out",
+ "outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-1 focus-visible:ring-offset-background",
+ "disabled:pointer-events-none disabled:opacity-40",
+ "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 shrink-0",
+ ].join(" "),
{
variants: {
variant: {
- default:
- "bg-indigo-600 text-white shadow-sm hover:bg-indigo-700 active:bg-indigo-800 focus:outline-none focus:ring-2 focus:ring-indigo-500/30 focus:ring-offset-1",
- destructive:
- "bg-red-600 text-white shadow-sm hover:bg-red-700 active:bg-red-800 focus:outline-none focus:ring-2 focus:ring-red-500/30 focus:ring-offset-1",
- outline:
- "border border-neutral-300 bg-white text-neutral-700 shadow-sm hover:bg-neutral-50 hover:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-indigo-500/30 focus:ring-offset-1",
- secondary:
- "bg-neutral-100 text-neutral-900 shadow-sm hover:bg-neutral-200 focus:outline-none focus:ring-2 focus:ring-neutral-500/30 focus:ring-offset-1",
- ghost:
- "text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900 focus:outline-none focus:ring-2 focus:ring-neutral-500/30 focus:ring-offset-1",
- link: "text-indigo-600 underline-offset-4 hover:underline focus:outline-none focus:ring-2 focus:ring-indigo-500/30 focus:ring-offset-1",
+ // Primary CTA β€” refined blue metallic
+ default: [
+ "relative text-white font-semibold tracking-[0.01em]",
+ "bg-gradient-to-b from-[#4a8df0] to-[#2563d4]",
+ "border border-[#1e4fad]/70",
+ "shadow-[inset_0_1px_0_0_rgba(255,255,255,0.15),0_1px_2px_0_rgba(0,0,0,0.1),0_1px_3px_0_rgba(37,99,212,0.2)]",
+ "hover:from-[#5a9af5] hover:to-[#3574e0]",
+ "hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.2),0_2px_4px_0_rgba(0,0,0,0.12),0_2px_8px_0_rgba(37,99,212,0.25)]",
+ "active:from-[#3574e0] active:to-[#1e4fad] active:scale-[0.98]",
+ "active:shadow-[inset_0_2px_4px_0_rgba(0,0,0,0.15)]",
+ ].join(" "),
+
+ // Success β€” emerald metallic
+ success: [
+ "relative text-white font-semibold tracking-[0.01em]",
+ "bg-gradient-to-b from-[#34d399] to-[#10b981]",
+ "border border-[#059669]/70",
+ "shadow-[inset_0_1px_0_0_rgba(255,255,255,0.15),0_1px_2px_0_rgba(0,0,0,0.1),0_1px_3px_0_rgba(16,185,129,0.2)]",
+ "hover:from-[#4ade80] hover:to-[#22c55e]",
+ "hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.2),0_2px_4px_0_rgba(0,0,0,0.12),0_2px_8px_0_rgba(16,185,129,0.25)]",
+ "active:from-[#22c55e] active:to-[#059669] active:scale-[0.98]",
+ "active:shadow-[inset_0_2px_4px_0_rgba(0,0,0,0.15)]",
+ ].join(" "),
+
+ // Destructive β€” red metallic
+ destructive: [
+ "relative text-white font-semibold tracking-[0.01em]",
+ "bg-gradient-to-b from-[#f87171] to-[#ef4444]",
+ "border border-[#dc2626]/70",
+ "shadow-[inset_0_1px_0_0_rgba(255,255,255,0.12),0_1px_2px_0_rgba(0,0,0,0.1),0_1px_3px_0_rgba(239,68,68,0.2)]",
+ "hover:from-[#fca5a5] hover:to-[#f87171]",
+ "hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.15),0_2px_4px_0_rgba(0,0,0,0.12),0_2px_8px_0_rgba(239,68,68,0.25)]",
+ "active:from-[#ef4444] active:to-[#dc2626] active:scale-[0.98]",
+ "active:shadow-[inset_0_2px_4px_0_rgba(0,0,0,0.15)]",
+ ].join(" "),
+
+ // Outline β€” uses design tokens
+ outline: [
+ "relative font-medium",
+ "text-foreground bg-muted/80",
+ "border border-border",
+ "shadow-sm backdrop-blur-sm",
+ "hover:bg-muted",
+ "active:scale-[0.98]",
+ // Dark mode overrides
+ "dark:bg-surface-3",
+ "dark:border-border-subtle",
+ "dark:hover:bg-surface-raised",
+ ].join(" "),
+
+ // Secondary β€” uses design tokens
+ secondary: [
+ "relative font-medium",
+ "text-foreground bg-secondary",
+ "border border-border/50",
+ "hover:bg-muted",
+ "active:scale-[0.98]",
+ // Dark mode overrides
+ "dark:text-foreground/90 dark:bg-white/8",
+ "dark:border-white/5",
+ "dark:hover:bg-white/12",
+ ].join(" "),
+
+ // Ghost β€” uses design tokens
+ ghost: [
+ "font-medium",
+ "text-foreground",
+ "hover:bg-muted",
+ "active:scale-[0.98]",
+ // Dark mode overrides
+ "dark:text-foreground/90",
+ "dark:hover:bg-white/8",
+ ].join(" "),
+
+ // Link β€” uses design tokens
+ link: [
+ "font-medium",
+ "text-primary",
+ "hover:text-primary/80 hover:underline",
+ "underline-offset-4",
+ // Dark mode overrides
+ "dark:text-primary",
+ "dark:hover:text-primary/80",
+ ].join(" "),
},
size: {
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
+ default: "h-9 px-4 py-2",
+ sm: "h-8 px-3 text-xs gap-1.5",
+ lg: "h-10 px-5 text-sm",
icon: "size-9",
},
},
diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx
index 029440e83..45c6c7b13 100644
--- a/src/components/ui/card.tsx
+++ b/src/components/ui/card.tsx
@@ -6,7 +6,12 @@ const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElemen
({ className, ...props }, ref) => (
<div
ref={ref}
- className={cn("rounded-lg border bg-card text-card-foreground shadow-sm", className)}
+ className={cn(
+ "rounded-xl border bg-card text-card-foreground shadow-sm",
+ "dark:bg-card dark:border-border",
+ "dark:hover:border-border-hover",
+ className
+ )}
{...props}
/>
)
diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx
index af0666079..c41fb5ea9 100644
--- a/src/components/ui/dialog.tsx
+++ b/src/components/ui/dialog.tsx
@@ -2,6 +2,7 @@ import * as React from "react";
import * as DialogPrimitive from "@radix-ui/react-dialog";
import { X } from "lucide-react";
import { cn } from "../lib/utils";
+import { Button } from "./button";
const Dialog = DialogPrimitive.Root;
@@ -18,7 +19,7 @@ const DialogOverlay = React.forwardRef<
<DialogPrimitive.Overlay
ref={ref}
className={cn(
- "fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
+ "fixed inset-0 z-50 bg-black/60 backdrop-blur-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className
)}
{...props}
@@ -35,14 +36,17 @@ const DialogContent = React.forwardRef<
<DialogPrimitive.Content
ref={ref}
className={cn(
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-[#DDD4C7] bg-white p-6 shadow-[0_8px_32px_rgba(43,31,20,0.12),0_2px_0_rgba(255,255,255,0.8)_inset] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-xl",
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-2xl duration-200 rounded-2xl",
+ "bg-card border-border/60",
+ "dark:bg-surface-2 dark:border-border dark:shadow-modal",
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
className
)}
{...props}
>
{children}
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-lg opacity-70 ring-offset-background transition-all hover:opacity-100 hover:bg-[#F5F5F5] focus:outline-none focus:ring-2 focus:ring-[#4f46e5] focus:ring-offset-2 disabled:pointer-events-none p-1">
- <X className="h-4 w-4 text-[#737373]" />
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-full opacity-50 ring-offset-background transition-all hover:opacity-100 hover:bg-muted/50 dark:hover:bg-surface-raised focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none p-1.5">
+ <X className="h-4 w-4 text-muted-foreground" />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
@@ -70,7 +74,7 @@ const DialogTitle = React.forwardRef<
<DialogPrimitive.Title
ref={ref}
className={cn(
- "text-lg font-semibold leading-none tracking-tight text-[#2B1F14] brand-heading",
+ "text-lg font-semibold leading-none tracking-tight text-foreground brand-heading",
className
)}
{...props}
@@ -84,7 +88,7 @@ const DialogDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
<DialogPrimitive.Description
ref={ref}
- className={cn("text-sm text-[#737373] brand-body", className)}
+ className={cn("text-sm text-muted-foreground brand-body", className)}
{...props}
/>
));
@@ -132,22 +136,15 @@ const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
{description && <DialogDescription>{description}</DialogDescription>}
</DialogHeader>
<DialogFooter>
- <button
- onClick={handleCancel}
- className="inline-flex items-center justify-center rounded-lg text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#4f46e5] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-[#DDD4C7] bg-white text-[#2B1F14] hover:bg-[#F5F5F5] hover:text-[#4B2E2B] h-10 px-4 py-2 brand-body"
- >
+ <Button variant="outline" onClick={handleCancel}>
{cancelText}
- </button>
- <button
+ </Button>
+ <Button
+ variant={variant === "destructive" ? "destructive" : "default"}
onClick={handleConfirm}
- className={`inline-flex items-center justify-center rounded-lg text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#4f46e5] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-10 px-4 py-2 brand-body ${
- variant === "destructive"
- ? "bg-[#dc2626] text-white hover:bg-[#b91c1c] shadow-[0_2px_8px_rgba(220,38,38,0.3)]"
- : "bg-[#4f46e5] text-white hover:bg-[#4338ca] shadow-[0_2px_8px_rgba(79,70,229,0.3)]"
- }`}
>
{confirmText}
- </button>
+ </Button>
</DialogFooter>
</DialogContent>
</Dialog>
@@ -185,12 +182,9 @@ const AlertDialog: React.FC<AlertDialogProps> = ({
{description && <DialogDescription>{description}</DialogDescription>}
</DialogHeader>
<DialogFooter>
- <button
- onClick={handleOk}
- className="inline-flex items-center justify-center rounded-lg text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#4f46e5] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-[#4f46e5] text-white hover:bg-[#4338ca] shadow-[0_2px_8px_rgba(79,70,229,0.3)] h-10 px-4 py-2 brand-body"
- >
+ <Button variant="default" onClick={handleOk}>
{okText}
- </button>
+ </Button>
</DialogFooter>
</DialogContent>
</Dialog>
diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx
index 210e85eaa..11862f901 100644
--- a/src/components/ui/input.tsx
+++ b/src/components/ui/input.tsx
@@ -8,8 +8,10 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
type={type}
data-slot="input"
className={cn(
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
+ "file:text-foreground placeholder:text-muted-foreground/50 selection:bg-primary selection:text-primary-foreground border-input flex h-9 w-full min-w-0 rounded-lg border bg-input px-3.5 py-2 text-sm shadow-none transition-all duration-200 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
+ "dark:bg-surface-1 dark:border-border-subtle",
+ "focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/10",
+ "dark:focus-visible:border-border-active dark:focus-visible:ring-ring/10",
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
className
)}
diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx
index 0b51aae29..783576ed0 100644
--- a/src/components/ui/select.tsx
+++ b/src/components/ui/select.tsx
@@ -17,7 +17,9 @@ const SelectTrigger = React.forwardRef<
<SelectPrimitive.Trigger
ref={ref}
className={cn(
- "flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
+ "flex h-10 w-full items-center justify-between rounded-xl border border-input bg-input px-3.5 py-2 text-sm shadow-none ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-[3px] focus:ring-primary/15 focus:border-primary disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
+ "dark:bg-surface-1 dark:border-border-subtle",
+ "dark:focus:ring-ring/10 dark:focus:border-border-active",
className
)}
{...props}
@@ -66,7 +68,9 @@ const SelectContent = React.forwardRef<
<SelectPrimitive.Content
ref={ref}
className={cn(
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white text-neutral-900 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-xl",
+ "dark:bg-surface-3 dark:border-border-hover dark:shadow-elevated",
+ "border-border/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className
@@ -109,7 +113,10 @@ const SelectItem = React.forwardRef<
<SelectPrimitive.Item
ref={ref}
className={cn(
- "relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none hover:bg-neutral-100 focus:bg-neutral-100 data-highlighted:bg-neutral-100 data-disabled:pointer-events-none data-disabled:opacity-50",
+ "relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pl-3 pr-8 text-sm outline-none transition-colors",
+ "hover:bg-muted focus:bg-muted data-highlighted:bg-muted",
+ "dark:hover:bg-primary/8 dark:focus:bg-primary/8 dark:data-highlighted:bg-primary/8",
+ "data-disabled:pointer-events-none data-disabled:opacity-50",
className
)}
{...props}
diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsx
index 944ad9fed..c623bb72c 100644
--- a/src/components/ui/tabs.tsx
+++ b/src/components/ui/tabs.tsx
@@ -12,7 +12,7 @@ const TabsList = React.forwardRef<
<TabsPrimitive.List
ref={ref}
className={cn(
- "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
+ "inline-flex h-9 items-center justify-center rounded-lg bg-muted dark:bg-surface-raised p-1 text-muted-foreground",
className
)}
{...props}
@@ -27,7 +27,7 @@ const TabsTrigger = React.forwardRef<
<TabsPrimitive.Trigger
ref={ref}
className={cn(
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background dark:data-[state=active]:bg-surface-3 data-[state=active]:text-foreground data-[state=active]:shadow",
className
)}
{...props}
diff --git a/src/components/ui/toggle.tsx b/src/components/ui/toggle.tsx
index 8c293a6d2..68ca54047 100644
--- a/src/components/ui/toggle.tsx
+++ b/src/components/ui/toggle.tsx
@@ -6,18 +6,29 @@ interface ToggleProps {
disabled?: boolean;
}
-export const Toggle = ({ checked, onChange, disabled = false }: ToggleProps) => (
- <button
- onClick={() => !disabled && onChange(!checked)}
- disabled={disabled}
- className={`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-indigo-500/30 focus:ring-offset-1 ${
- checked ? "bg-indigo-600" : "bg-neutral-300"
- } ${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`}
- >
- <span
- className={`inline-block h-3 w-3 transform rounded-full bg-white transition-transform shadow-sm ${
- checked ? "translate-x-5" : "translate-x-1"
+export const Toggle = ({ checked, onChange, disabled = false }: ToggleProps) => {
+ const getTrackClasses = () => {
+ if (disabled) {
+ return checked ? "bg-primary/40" : "bg-muted";
+ }
+ return checked
+ ? "bg-primary hover:bg-primary/90"
+ : "bg-muted-foreground/30 hover:bg-muted-foreground/40 dark:bg-surface-raised dark:hover:bg-surface-3";
+ };
+
+ return (
+ <button
+ onClick={() => !disabled && onChange(!checked)}
+ disabled={disabled}
+ className={`relative inline-flex h-4.5 w-8 items-center rounded-full transition-all duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-1 ${getTrackClasses()} ${
+ disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
}`}
- />
- </button>
-);
+ >
+ <span
+ className={`inline-block h-3.5 w-3.5 transform rounded-full transition-all duration-150 ${
+ checked ? "translate-x-3.5" : "translate-x-0.5"
+ } ${disabled ? "bg-muted-foreground/50" : "bg-background shadow-sm"}`}
+ />
+ </button>
+ );
+};
diff --git a/src/components/ui/tooltip.tsx b/src/components/ui/tooltip.tsx
index effd3e4ee..209e9f344 100644
--- a/src/components/ui/tooltip.tsx
+++ b/src/components/ui/tooltip.tsx
@@ -14,9 +14,9 @@ export const Tooltip = ({ children, content }: TooltipProps) => {
{children}
</div>
{isVisible && (
- <div className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 text-xs text-white bg-neutral-900 rounded-md whitespace-nowrap z-10">
+ <div className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 text-xs text-popover-foreground bg-popover border border-border rounded-md whitespace-nowrap z-10 shadow-lg">
{content}
- <div className="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-transparent border-t-neutral-900"></div>
+ <div className="absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-2 border-r-2 border-t-2 border-transparent border-t-popover"></div>
</div>
)}
</div>
diff --git a/src/helpers/audioManager.js b/src/helpers/audioManager.js
index 4ad7c38b2..c5a1ebd26 100644
--- a/src/helpers/audioManager.js
+++ b/src/helpers/audioManager.js
@@ -216,6 +216,15 @@ class AudioManager {
return false;
}
+ cancelProcessing() {
+ if (this.isProcessing) {
+ this.isProcessing = false;
+ this.onStateChange?.({ isRecording: false, isProcessing: false });
+ return true;
+ }
+ return false;
+ }
+
async processAudio(audioBlob, metadata = {}) {
const pipelineStart = performance.now();
@@ -240,6 +249,10 @@ class AudioManager {
result = await this.processWithOpenAIAPI(audioBlob, metadata);
}
+ if (!this.isProcessing) {
+ return;
+ }
+
this.onTranscriptionComplete?.(result);
const roundTripDurationMs = Math.round(performance.now() - pipelineStart);
@@ -283,8 +296,10 @@ class AudioManager {
});
}
} finally {
- this.isProcessing = false;
- this.onStateChange?.({ isRecording: false, isProcessing: false });
+ if (this.isProcessing) {
+ this.isProcessing = false;
+ this.onStateChange?.({ isRecording: false, isProcessing: false });
+ }
}
}
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 5c57785ae..f7ce0f515 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -102,6 +102,10 @@ class IPCHandlers {
return { success: true };
});
+ ipcMain.handle("resize-main-window", (event, sizeKey) => {
+ return this.windowManager.resizeMainWindow(sizeKey);
+ });
+
// Environment handlers
ipcMain.handle("get-openai-key", async (event) => {
return this.environmentManager.getOpenAIKey();
diff --git a/src/helpers/windowConfig.js b/src/helpers/windowConfig.js
index 392651cec..4a0f49769 100644
--- a/src/helpers/windowConfig.js
+++ b/src/helpers/windowConfig.js
@@ -1,9 +1,16 @@
const path = require("path");
+const WINDOW_SIZES = {
+ BASE: { width: 96, height: 96 },
+ WITH_MENU: { width: 240, height: 280 },
+ WITH_TOAST: { width: 400, height: 500 },
+ EXPANDED: { width: 400, height: 500 },
+};
+
// Main dictation window configuration
const MAIN_WINDOW_CONFIG = {
- width: 240,
- height: 240,
+ width: WINDOW_SIZES.BASE.width,
+ height: WINDOW_SIZES.BASE.height,
title: "Voice Recorder",
webPreferences: {
preload: path.join(__dirname, "..", "..", "preload.js"),
@@ -46,7 +53,6 @@ const CONTROL_PANEL_CONFIG = {
trafficLightPosition: { x: 20, y: 20 },
}),
transparent: false,
- backgroundColor: "#ffffff",
minimizable: true,
maximizable: true,
closable: true,
@@ -59,11 +65,11 @@ const CONTROL_PANEL_CONFIG = {
// Window positioning utilities
class WindowPositionUtil {
- static getMainWindowPosition(display) {
- const { width, height } = MAIN_WINDOW_CONFIG;
- const MARGIN = 20;
- const x = Math.max(0, display.bounds.x + display.workArea.width - width - MARGIN);
+ static getMainWindowPosition(display, customSize = null) {
+ const { width, height } = customSize || WINDOW_SIZES.BASE;
+ const MARGIN = 24;
const workArea = display.workArea || display.bounds;
+ const x = Math.max(0, workArea.x + workArea.width - width - MARGIN);
const y = Math.max(0, workArea.y + workArea.height - height - MARGIN);
return { x, y, width, height };
}
@@ -106,5 +112,6 @@ class WindowPositionUtil {
module.exports = {
MAIN_WINDOW_CONFIG,
CONTROL_PANEL_CONFIG,
+ WINDOW_SIZES,
WindowPositionUtil,
};
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index 094619817..0b03556e7 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -4,7 +4,12 @@ const DragManager = require("./dragManager");
const MenuManager = require("./menuManager");
const DevServerManager = require("./devServerManager");
const { DEV_SERVER_PORT } = DevServerManager;
-const { MAIN_WINDOW_CONFIG, CONTROL_PANEL_CONFIG, WindowPositionUtil } = require("./windowConfig");
+const {
+ MAIN_WINDOW_CONFIG,
+ CONTROL_PANEL_CONFIG,
+ WINDOW_SIZES,
+ WindowPositionUtil,
+} = require("./windowConfig");
class WindowManager {
constructor() {
@@ -94,6 +99,36 @@ class WindowManager {
this.isMainWindowInteractive = shouldCapture;
}
+ resizeMainWindow(sizeKey) {
+ if (!this.mainWindow || this.mainWindow.isDestroyed()) {
+ return { success: false, message: "Window not available" };
+ }
+
+ const newSize = WINDOW_SIZES[sizeKey] || WINDOW_SIZES.BASE;
+ const currentBounds = this.mainWindow.getBounds();
+
+ const bottomRightX = currentBounds.x + currentBounds.width;
+ const bottomRightY = currentBounds.y + currentBounds.height;
+
+ const display = screen.getDisplayNearestPoint({ x: bottomRightX, y: bottomRightY });
+ const workArea = display.workArea || display.bounds;
+
+ let newX = bottomRightX - newSize.width;
+ let newY = bottomRightY - newSize.height;
+
+ newX = Math.max(workArea.x, Math.min(newX, workArea.x + workArea.width - newSize.width));
+ newY = Math.max(workArea.y, Math.min(newY, workArea.y + workArea.height - newSize.height));
+
+ this.mainWindow.setBounds({
+ x: newX,
+ y: newY,
+ width: newSize.width,
+ height: newSize.height,
+ });
+
+ return { success: true, bounds: { x: newX, y: newY, ...newSize } };
+ }
+
/**
* Load content into a BrowserWindow, handling both dev server and production file loading.
* @param {BrowserWindow} window - The window to load content into
diff --git a/src/hooks/useAudioRecording.js b/src/hooks/useAudioRecording.js
index ce423092d..c280c1ecf 100644
--- a/src/hooks/useAudioRecording.js
+++ b/src/hooks/useAudioRecording.js
@@ -127,6 +127,13 @@ export const useAudioRecording = (toast, options = {}) => {
return false;
};
+ const cancelProcessing = () => {
+ if (audioManagerRef.current) {
+ return audioManagerRef.current.cancelProcessing();
+ }
+ return false;
+ };
+
const toggleListening = () => {
if (!isRecording && !isProcessing) {
startRecording();
@@ -142,6 +149,7 @@ export const useAudioRecording = (toast, options = {}) => {
startRecording,
stopRecording,
cancelRecording,
+ cancelProcessing,
toggleListening,
};
};
diff --git a/src/hooks/useSettings.ts b/src/hooks/useSettings.ts
index a344e132c..71ca15b38 100644
--- a/src/hooks/useSettings.ts
+++ b/src/hooks/useSettings.ts
@@ -1,7 +1,6 @@
import { useCallback, useEffect, useRef } from "react";
import { useLocalStorage } from "./useLocalStorage";
import { useDebouncedCallback } from "./useDebouncedCallback";
-import { getModelProvider } from "../models/ModelRegistry";
import { API_ENDPOINTS } from "../config/constants";
import ReasoningService from "../services/ReasoningService";
import type { LocalTranscriptionProvider } from "../types/electron";
@@ -47,6 +46,10 @@ export interface ApiKeySettings {
customReasoningApiKey: string;
}
+export interface ThemeSettings {
+ theme: "light" | "dark" | "auto";
+}
+
export function useSettings() {
const [useLocalWhisper, setUseLocalWhisper] = useLocalStorage("useLocalWhisper", false, {
serialize: String,
@@ -198,6 +201,11 @@ export function useSettings() {
deserialize: String,
});
+ const [reasoningProvider, setReasoningProvider] = useLocalStorage("reasoningProvider", "openai", {
+ serialize: String,
+ deserialize: String,
+ });
+
// API keys - localStorage for UI, synced to Electron IPC for persistence
const [openaiApiKey, setOpenaiApiKeyLocal] = useLocalStorage("openaiApiKey", "", {
serialize: String,
@@ -219,6 +227,15 @@ export function useSettings() {
deserialize: String,
});
+ // Theme setting
+ const [theme, setTheme] = useLocalStorage<"light" | "dark" | "auto">("theme", "auto", {
+ serialize: String,
+ deserialize: (value) => {
+ if (["light", "dark", "auto"].includes(value)) return value as "light" | "dark" | "auto";
+ return "auto";
+ },
+ });
+
// Custom endpoint API keys - synced to .env like other keys
const [customTranscriptionApiKey, setCustomTranscriptionApiKeyLocal] = useLocalStorage(
"customTranscriptionApiKey",
@@ -398,9 +415,6 @@ export function useSettings() {
deserialize: String,
});
- // Computed values
- const reasoningProvider = getModelProvider(reasoningModel);
-
// Sync startup pre-warming preferences to main process
useEffect(() => {
if (typeof window === "undefined" || !window.electronAPI?.syncStartupPreferences) return;
@@ -469,11 +483,12 @@ export function useSettings() {
if (settings.useReasoningModel !== undefined)
setUseReasoningModel(settings.useReasoningModel);
if (settings.reasoningModel !== undefined) setReasoningModel(settings.reasoningModel);
+ if (settings.reasoningProvider !== undefined)
+ setReasoningProvider(settings.reasoningProvider);
if (settings.cloudReasoningBaseUrl !== undefined)
setCloudReasoningBaseUrl(settings.cloudReasoningBaseUrl);
- // reasoningProvider is computed from reasoningModel, not stored separately
},
- [setUseReasoningModel, setReasoningModel, setCloudReasoningBaseUrl]
+ [setUseReasoningModel, setReasoningModel, setReasoningProvider, setCloudReasoningBaseUrl]
);
const updateApiKeys = useCallback(
@@ -508,6 +523,7 @@ export function useSettings() {
geminiApiKey,
groqApiKey,
dictationKey,
+ theme,
setUseLocalWhisper,
setWhisperModel,
setLocalTranscriptionProvider,
@@ -523,11 +539,7 @@ export function useSettings() {
setCustomDictionary,
setUseReasoningModel,
setReasoningModel,
- setReasoningProvider: (provider: string) => {
- if (provider !== "custom") {
- setReasoningModel("");
- }
- },
+ setReasoningProvider,
setOpenaiApiKey,
setAnthropicApiKey,
setGeminiApiKey,
@@ -537,6 +549,7 @@ export function useSettings() {
customReasoningApiKey,
setCustomReasoningApiKey,
setDictationKey,
+ setTheme,
activationMode,
setActivationMode,
preferBuiltInMic,
diff --git a/src/hooks/useTheme.ts b/src/hooks/useTheme.ts
new file mode 100644
index 000000000..80c9cb526
--- /dev/null
+++ b/src/hooks/useTheme.ts
@@ -0,0 +1,48 @@
+import { useEffect } from "react";
+import { useSettings } from "./useSettings";
+
+export function useTheme() {
+ const { theme, setTheme } = useSettings();
+
+ useEffect(() => {
+ const htmlElement = document.documentElement;
+
+ // Determine effective theme
+ const effectiveTheme: "light" | "dark" =
+ theme === "auto"
+ ? window.matchMedia("(prefers-color-scheme: dark)").matches
+ ? "dark"
+ : "light"
+ : theme;
+
+ console.log("[useTheme] Applying theme:", effectiveTheme, "from setting:", theme);
+
+ // Apply dark class
+ if (effectiveTheme === "dark") {
+ htmlElement.classList.add("dark");
+ document.body.classList.add("dark");
+ } else {
+ htmlElement.classList.remove("dark");
+ document.body.classList.remove("dark");
+ }
+
+ // Listen for system preference changes (only when auto)
+ if (theme === "auto") {
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
+ const handler = (e: MediaQueryListEvent) => {
+ if (e.matches) {
+ htmlElement.classList.add("dark");
+ document.body.classList.add("dark");
+ } else {
+ htmlElement.classList.remove("dark");
+ document.body.classList.remove("dark");
+ }
+ };
+
+ mediaQuery.addEventListener("change", handler);
+ return () => mediaQuery.removeEventListener("change", handler);
+ }
+ }, [theme]);
+
+ return { theme, setTheme };
+}
diff --git a/src/index.css b/src/index.css
index c55fa8575..28387a051 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,8 +1,9 @@
@import "tailwindcss";
-:root {
- /* OpenWhispr Modern Theme - Clean & Professional */
- --color-primary: #4f46e5;
+@theme {
+ /* OpenWhispr Theme β€” registers color tokens with Tailwind v4.
+ These are the light-mode defaults; .dark overrides them below. */
+ --color-primary: #2563eb;
--color-primary-foreground: #ffffff;
--color-secondary: #f5f5f5;
--color-secondary-foreground: #171717;
@@ -13,58 +14,128 @@
--color-destructive: #dc2626;
--color-destructive-foreground: #ffffff;
--color-border: #e5e5e5;
- --color-input: #ffffff;
- --color-ring: #4f46e5;
+ --color-input: #f9f6f1;
+ --color-ring: #2563eb;
--color-background: #ffffff;
--color-foreground: #171717;
--color-card: #ffffff;
--color-card-foreground: #171717;
--color-popover: #ffffff;
--color-popover-foreground: #171717;
- --color-link: #4f46e5;
- --radius: 0.5rem;
+ --color-link: #2563eb;
+ --color-success: #16a34a;
+ --color-success-foreground: #ffffff;
+ --color-warning: #d97706;
+ --color-warning-foreground: #ffffff;
+ --color-info: #2563eb;
+ --color-info-foreground: #ffffff;
+
+ /* Surface hierarchy β€” light mode equivalents */
+ --color-surface-0: #ffffff;
+ --color-surface-1: #fafafa;
+ --color-surface-2: #ffffff;
+ --color-surface-3: #f5f5f5;
+ --color-surface-raised: #f0f0f0;
+
+ /* Border states β€” light mode equivalents */
+ --color-border-subtle: #e5e5e5;
+ --color-border-hover: #d4d4d4;
+ --color-border-active: #2563eb;
+}
+
+:root {
+ /* Typography */
+ --font-family-sans:
+ "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
+ sans-serif;
+
+ /* Opacities */
+ --opacity-subtle: 0.1;
+ --opacity-medium: 0.5;
+ --opacity-high: 0.9;
+
+ /* Border Radius β€” generous Clerk-style rounding */
+ --radius: 0.625rem;
+ --radius-sm: 0.375rem;
+ --radius-md: 0.5rem;
+ --radius-lg: 0.625rem;
+ --radius-xl: 0.875rem;
+
+ /* Custom Light Mode Brand Colors (Parchment Theme) */
+ --color-parchment-bg: #f9f6f1;
+ --color-parchment-border: #ddd4c7;
+ --color-parchment-text: #2b1f14;
+ --color-parchment-accent: #c0a77d;
+ --color-brand-primary: #2b1f14;
+ --color-brand-accent: #4b2e2b;
+ --color-brand-highlight: #c0a77d;
+ --color-brand-link: #2e3659;
+ --color-pattern: #e7e5e4;
}
.dark {
- /* Dark mode - sophisticated and rich */
- --color-background: oklch(0.08 0 0);
+ /* Dark mode β€” clear surface hierarchy: bg < muted < card < popover */
+ --color-background: oklch(0.1 0.005 270);
--color-foreground: oklch(0.95 0 0);
- --color-card: oklch(0.12 0 0);
+ --color-card: oklch(0.15 0.008 270);
--color-card-foreground: oklch(0.95 0 0);
- --color-popover: oklch(0.12 0 0);
+ --color-popover: oklch(0.17 0.008 270);
--color-popover-foreground: oklch(0.95 0 0);
- --color-primary: oklch(0.6 0.22 245);
- --color-primary-foreground: oklch(0.985 0 0);
- --color-secondary: oklch(0.18 0 0);
- --color-secondary-foreground: oklch(0.9 0 0);
- --color-muted: oklch(0.15 0 0);
- --color-muted-foreground: oklch(0.6 0 0);
- --color-accent: oklch(0.6 0.22 245);
- --color-accent-foreground: oklch(0.985 0 0);
- --color-destructive: oklch(0.7 0.22 25);
- --color-border: oklch(0.22 0 0);
- --color-input: oklch(0.18 0 0);
- --color-ring: oklch(0.6 0.22 245);
+ --color-primary: oklch(0.62 0.22 260);
+ --color-primary-foreground: oklch(0.99 0 0);
+ --color-secondary: oklch(0.18 0.005 270);
+ --color-secondary-foreground: oklch(0.92 0 0);
+ --color-muted: oklch(0.13 0.005 270);
+ --color-muted-foreground: oklch(0.55 0 0);
+ --color-accent: oklch(0.62 0.22 260);
+ --color-accent-foreground: oklch(0.99 0 0);
+ --color-destructive: oklch(0.6 0.25 25);
+ --color-destructive-foreground: oklch(0.99 0 0);
+ --color-border: oklch(0.23 0.005 270);
+ --color-input: oklch(0.12 0.005 270);
+ --color-ring: oklch(0.62 0.22 260);
+ --color-success: oklch(0.7 0.18 145);
+ --color-success-foreground: oklch(0.99 0 0);
+ --color-warning: oklch(0.75 0.15 70);
+ --color-warning-foreground: oklch(0.15 0 0);
+ --color-info: oklch(0.68 0.2 240);
+ --color-info-foreground: oklch(0.99 0 0);
+
+ /* Surface hierarchy β€” layered depth system */
+ --color-surface-0: oklch(0.1 0.005 270);
+ --color-surface-1: oklch(0.13 0.006 270);
+ --color-surface-2: oklch(0.155 0.008 270);
+ --color-surface-3: oklch(0.18 0.01 270);
+ --color-surface-raised: oklch(0.2 0.012 270);
+
+ /* Border states */
+ --color-border-subtle: oklch(0.2 0.004 270);
+ --color-border-hover: oklch(0.28 0.01 270);
+ --color-border-active: oklch(0.45 0.15 260);
+
+ /* Card depth shadows β€” no glow, clean depth only */
+ --shadow-card: 0 1px 2px oklch(0 0 0 / 0.25);
+ --shadow-card-hover: 0 2px 8px oklch(0 0 0 / 0.35);
+ --shadow-elevated: 0 8px 24px oklch(0 0 0 / 0.4);
+ --shadow-modal: 0 24px 48px -12px oklch(0 0 0 / 0.5);
}
@layer base {
* {
- @apply border-gray-200 outline-indigo-500/50;
+ border-color: var(--color-border);
+ transition:
+ background-color 150ms ease,
+ border-color 150ms ease,
+ color 150ms ease,
+ box-shadow 150ms ease;
}
body {
- @apply bg-white text-gray-900;
+ background-color: var(--color-background);
+ color: var(--color-foreground);
margin: 0;
padding: 0;
- font-family:
- "Noto Sans",
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- "Helvetica Neue",
- Arial,
- sans-serif;
+ font-family: var(--font-family-sans);
font-feature-settings:
"liga" 1,
"kern" 1;
@@ -73,50 +144,38 @@
/* Electron specific styles */
html,
- body,
+ body {
+ min-height: 100vh;
+ }
+
#root {
+ min-height: 100vh;
+ }
+
+ /* Make dictation window (App) transparent, but keep control panel solid */
+ body:has(.dictation-window) {
+ background: transparent;
+ }
+
+ body:has(.dictation-window) #root {
background: transparent;
}
}
/* OpenWhispr Brand Typography */
.brand-heading {
- font-family:
- "Noto Sans",
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- "Helvetica Neue",
- Arial,
- sans-serif;
+ font-family: var(--font-family-sans);
font-weight: 600;
letter-spacing: -0.02em;
}
.brand-body {
- font-family:
- "Noto Sans",
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- "Helvetica Neue",
- Arial,
- sans-serif;
+ font-family: var(--font-family-sans);
line-height: 1.6;
}
.brand-script {
- font-family:
- "Noto Sans",
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- "Helvetica Neue",
- Arial,
- sans-serif;
+ font-family: var(--font-family-sans);
font-style: italic;
}
@@ -126,18 +185,10 @@ h3,
h4,
h5,
h6 {
- font-family:
- "Noto Sans",
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- "Helvetica Neue",
- Arial,
- sans-serif;
+ font-family: var(--font-family-sans);
font-weight: 600;
- letter-spacing: -0.02em;
- line-height: 1.2;
+ letter-spacing: -0.025em;
+ line-height: 1.15;
}
h1 {
@@ -147,15 +198,7 @@ h1 {
/* Modern Button Styling - handled by button component */
button {
- font-family:
- "Noto Sans",
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- "Helvetica Neue",
- Arial,
- sans-serif;
+ font-family: var(--font-family-sans);
cursor: pointer;
}
@@ -174,107 +217,155 @@ input,
textarea {
border-radius: 8px;
transition: all 0.2s ease;
- font-family:
- "Noto Sans",
- -apple-system,
- BlinkMacSystemFont,
- "Segoe UI",
- Roboto,
- "Helvetica Neue",
- Arial,
- sans-serif;
- box-shadow: inset 0 1px 3px rgba(43, 31, 20, 0.1);
+ font-family: var(--font-family-sans);
+ box-shadow: inset 0 1px 3px rgba(43, 31, 20, var(--opacity-subtle));
}
/* Light mode inputs - embossed parchment */
:root input,
:root textarea {
- background-color: #f9f6f1;
- border: 1px solid #ddd4c7;
- color: #2b1f14;
+ background-color: var(--color-parchment-bg);
+ border: 1px solid var(--color-parchment-border);
+ color: var(--color-parchment-text);
}
:root input:focus,
:root textarea:focus {
- border-color: #c0a77d;
+ border-color: var(--color-parchment-accent);
box-shadow:
- 0 0 0 2px rgba(192, 167, 125, 0.2),
- inset 0 1px 3px rgba(43, 31, 20, 0.1);
- background-color: #ffffff;
+ 0 0 0 2px oklch(from var(--color-parchment-accent) l c h / 0.2),
+ inset 0 1px 3px oklch(from var(--color-parchment-text) l c h / var(--opacity-subtle));
+ background-color: var(--color-background);
}
-/* Dark mode inputs */
+/* Dark mode inputs β€” flat, no embossed shadow */
.dark input,
.dark textarea {
- background-color: oklch(0.15 0 0);
- border: 1px solid oklch(0.25 0 0);
+ background-color: var(--color-input);
+ border: 1px solid var(--color-border);
color: oklch(0.9 0 0);
+ box-shadow: none;
}
.dark input:focus,
.dark textarea:focus {
- border-color: oklch(0.55 0.25 250);
- box-shadow: 0 0 0 2px oklch(0.55 0.25 250 / 0.2);
+ border-color: var(--color-border-active);
+ box-shadow: 0 0 0 2px oklch(0.62 0.22 260 / 0.15);
}
/* Card styling - elevated parchment */
.card {
- background-color: #ffffff;
- border: 1px solid #ddd4c7;
+ background-color: var(--color-card);
+ border: 1px solid var(--color-parchment-border);
border-radius: 12px;
box-shadow:
- 0 4px 8px rgba(43, 31, 20, 0.08),
- 0 1px 0 rgba(255, 255, 255, 0.5) inset;
+ 0 4px 8px oklch(from var(--color-parchment-text) l c h / 0.08),
+ 0 1px 0 oklch(from var(--color-card) l c h / var(--opacity-medium)) inset;
transition: all 0.2s ease;
}
.card:hover {
box-shadow:
- 0 8px 16px rgba(43, 31, 20, 0.1),
- 0 1px 0 rgba(255, 255, 255, 0.5) inset;
+ 0 8px 16px oklch(from var(--color-parchment-text) l c h / var(--opacity-subtle)),
+ 0 1px 0 oklch(from var(--color-card) l c h / var(--opacity-medium)) inset;
transform: translateY(-1px);
}
+/* Dark mode cards β€” grounded, no lift, subtle border glow */
+.dark .card {
+ border-color: var(--color-border-subtle);
+ box-shadow: var(--shadow-card);
+}
+
+.dark .card:hover {
+ box-shadow: var(--shadow-card-hover);
+ transform: none;
+ border-color: var(--color-border-hover);
+}
+
/* Link styling */
a {
- color: #2e3659;
+ color: var(--color-brand-link);
text-decoration: none;
transition: color 0.2s ease;
cursor: pointer;
}
a:hover {
- color: #4b2e2b;
+ color: var(--color-brand-accent);
text-decoration: underline;
cursor: pointer;
}
/* Status indicators */
.status-active {
- color: #4b2e2b;
+ color: var(--color-brand-accent);
font-weight: 600;
}
.text-brand-primary {
- color: #2b1f14;
+ color: var(--color-brand-primary);
}
.text-brand-accent {
- color: #4b2e2b;
+ color: var(--color-brand-accent);
}
.text-brand-highlight {
- color: #c0a77d;
+ color: var(--color-brand-highlight);
}
.text-brand-link {
- color: #2e3659;
+ color: var(--color-brand-link);
}
-/* Additional CSS variables for theme support */
-:root {
- --radius-sm: calc(var(--radius) - 4px);
- --radius-md: calc(var(--radius) - 2px);
- --radius-lg: var(--radius);
- --radius-xl: calc(var(--radius) + 4px);
+/* ---- Premium UI Utilities ---- */
+
+/* Section panel β€” grouped settings container */
+.section-panel {
+ background: var(--color-surface-2);
+ border: 1px solid var(--color-border-subtle);
+ border-radius: var(--radius-xl);
+}
+
+/* Gradient accent bar β€” top border highlight for panels */
+.accent-bar {
+ position: relative;
+}
+
+.dark .accent-bar::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 1px;
+ background: linear-gradient(
+ 90deg,
+ oklch(0.62 0.22 260 / 0.5),
+ oklch(0.7 0.18 280 / 0.3),
+ transparent 80%
+ );
+ pointer-events: none;
+ z-index: 1;
+}
+
+/* Monochrome icon theming - explicit light/dark handling */
+.icon-monochrome {
+ filter: none;
+ transition: filter 150ms ease;
+}
+
+.dark .icon-monochrome {
+ filter: invert(1);
+}
+
+/* Toast progress bar animation */
+@keyframes toast-progress {
+ from {
+ width: 100%;
+ }
+ to {
+ width: 0%;
+ }
}
diff --git a/src/main.jsx b/src/main.jsx
index e33e3e0fc..664e479ed 100644
--- a/src/main.jsx
+++ b/src/main.jsx
@@ -4,9 +4,13 @@ import App from "./App.jsx";
import ControlPanel from "./components/ControlPanel.tsx";
import OnboardingFlow from "./components/OnboardingFlow.tsx";
import { ToastProvider } from "./components/ui/Toast.tsx";
+import { useTheme } from "./hooks/useTheme";
import "./index.css";
function AppRouter() {
+ // Initialize theme system
+ useTheme();
+
const [showOnboarding, setShowOnboarding] = useState(false);
const [isLoading, setIsLoading] = useState(true);
@@ -44,10 +48,10 @@ function AppRouter() {
if (isLoading) {
return (
- <div className="min-h-screen bg-gray-50 flex items-center justify-center">
+ <div className="min-h-screen bg-background flex items-center justify-center">
<div className="text-center">
- <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600 mx-auto mb-4"></div>
- <p className="text-gray-600">Loading OpenWhispr...</p>
+ <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"></div>
+ <p className="text-muted-foreground">Loading OpenWhispr...</p>
</div>
</div>
);
diff --git a/src/services/ReasoningService.ts b/src/services/ReasoningService.ts
index b5606b815..31da21ae3 100644
--- a/src/services/ReasoningService.ts
+++ b/src/services/ReasoningService.ts
@@ -47,7 +47,6 @@ class ReasoningService extends BaseReasoningService {
const stored = window.localStorage.getItem("cloudReasoningBaseUrl") || "";
const trimmed = stored.trim();
- // If no custom URL is stored, use the default
if (!trimmed) {
logger.logReasoning("CUSTOM_REASONING_ENDPOINT_CHECK", {
hasCustomUrl: false,
@@ -68,8 +67,6 @@ class ReasoningService extends BaseReasoningService {
defaultEndpoint: API_ENDPOINTS.OPENAI_BASE,
});
- // Don't use the custom URL if it's a known non-OpenAI provider URL
- // These should be handled by their dedicated provider methods
const knownNonOpenAIUrls = [
"api.groq.com",
"api.anthropic.com",
@@ -178,9 +175,7 @@ class ReasoningService extends BaseReasoningService {
ReasoningService.OPENAI_ENDPOINT_PREF_STORAGE_KEY,
JSON.stringify(data)
);
- } catch {
- // Ignore storage errors
- }
+ } catch {}
}
private async getApiKey(
@@ -205,7 +200,6 @@ class ReasoningService extends BaseReasoningService {
keyPreview: trimmedKey ? `${trimmedKey.substring(0, 8)}...` : "none",
});
- // Custom endpoints may not require an API key
return trimmedKey;
}
@@ -258,10 +252,6 @@ class ReasoningService extends BaseReasoningService {
return apiKey;
}
- /**
- * Shared helper for OpenAI-compatible Chat Completions API calls.
- * Used by Groq and as fallback for OpenAI.
- */
private async callChatCompletionsApi(
endpoint: string,
apiKey: string,
@@ -296,12 +286,10 @@ class ReasoningService extends BaseReasoningService {
),
};
- // Check model registry for provider-specific options
- // Note: chat_template_kwargs is not supported by Groq's API
+ // Disable thinking for Groq Qwen models
const modelDef = getCloudModel(model);
- if (modelDef?.disableThinking && providerName.toLowerCase() !== "groq") {
- requestBody.chat_template_kwargs = { enable_thinking: false };
- logger.logReasoning("THINKING_DISABLED", { model, provider: providerName });
+ if (modelDef?.disableThinking && providerName.toLowerCase() === "groq") {
+ requestBody.reasoning_effort = "none";
}
logger.logReasoning(`${providerName.toUpperCase()}_REQUEST`, {
@@ -360,7 +348,6 @@ class ReasoningService extends BaseReasoningService {
return jsonResponse;
}, createApiRetryStrategy());
- // Extract text from Chat Completions format
if (!response.choices || !response.choices[0]) {
logger.logReasoning(`${providerName.toUpperCase()}_RESPONSE_ERROR`, {
model,
@@ -462,7 +449,6 @@ class ReasoningService extends BaseReasoningService {
error: (error as Error).message,
stack: (error as Error).stack,
});
- // Re-throw error with provider context
throw error;
}
}
@@ -500,13 +486,11 @@ class ReasoningService extends BaseReasoningService {
const systemPrompt = this.getSystemPrompt(agentName);
const userPrompt = text;
- // Build messages array (used by both APIs)
const messages = [
{ role: "system", content: systemPrompt },
{ role: "user", content: userPrompt },
];
- // Add temperature for older models (GPT-4 and earlier)
const isOlderModel = model && (model.startsWith("gpt-4") || model.startsWith("gpt-3"));
const openAiBase = this.getConfiguredOpenAIBase();
@@ -535,15 +519,12 @@ class ReasoningService extends BaseReasoningService {
for (const { url: endpoint, type } of endpointCandidates) {
try {
- // Build request body based on endpoint type
const requestBody: any = { model };
if (type === "responses") {
- // Responses API uses 'input' parameter
requestBody.input = messages;
requestBody.store = false;
} else {
- // Chat Completions API uses 'messages' parameter
requestBody.messages = messages;
if (isOlderModel) {
requestBody.temperature = config.temperature || 0.3;
@@ -598,11 +579,9 @@ class ReasoningService extends BaseReasoningService {
throw lastError || new Error("No OpenAI endpoint responded");
}, createApiRetryStrategy());
- // Detect the API response format (Responses API vs Chat Completions)
const isResponsesApi = Array.isArray(response?.output);
const isChatCompletions = Array.isArray(response?.choices);
- // Log the raw response for debugging
logger.logReasoning("OPENAI_RAW_RESPONSE", {
model,
format: isResponsesApi ? "responses" : isChatCompletions ? "chat_completions" : "unknown",
@@ -614,7 +593,6 @@ class ReasoningService extends BaseReasoningService {
usage: response.usage,
});
- // Extract text from the Responses API or Chat Completions formats
let responseText = "";
if (isResponsesApi) {
@@ -671,14 +649,13 @@ class ReasoningService extends BaseReasoningService {
isEmpty: responseText.length === 0,
});
- // If we got an empty response, return the original text as fallback
if (!responseText) {
logger.logReasoning("OPENAI_EMPTY_RESPONSE_FALLBACK", {
model,
originalTextLength: text.length,
reason: "Empty response from API",
});
- return text; // Return original text if API returns nothing
+ return text;
}
return responseText;
@@ -706,7 +683,6 @@ class ReasoningService extends BaseReasoningService {
environment: typeof window !== "undefined" ? "browser" : "node",
});
- // Use IPC to communicate with main process for Anthropic API
if (typeof window !== "undefined" && window.electronAPI) {
const startTime = Date.now();
@@ -759,8 +735,6 @@ class ReasoningService extends BaseReasoningService {
environment: typeof window !== "undefined" ? "browser" : "node",
});
- // Instead of importing directly, we'll use IPC to communicate with main process
- // For local models, we need to use IPC to communicate with the main process
if (typeof window !== "undefined" && window.electronAPI) {
const startTime = Date.now();
@@ -840,7 +814,7 @@ class ReasoningService extends BaseReasoningService {
maxOutputTokens:
config.maxTokens ||
Math.max(
- 2000, // Gemini 3 Pro need more tokens for thinking processes
+ 2000,
this.calculateMaxTokens(
text.length,
TOKEN_LIMITS.MIN_TOKENS_GEMINI,
@@ -916,7 +890,6 @@ class ReasoningService extends BaseReasoningService {
throw fetchError;
}
- // Check if response has the expected structure
if (!response.candidates || !response.candidates[0]) {
logger.logReasoning("GEMINI_RESPONSE_ERROR", {
model,
@@ -927,7 +900,6 @@ class ReasoningService extends BaseReasoningService {
throw new Error("Invalid response structure from Gemini API");
}
- // Check if the response has actual content
const candidate = response.candidates[0];
if (!candidate.content?.parts?.[0]?.text) {
logger.logReasoning("GEMINI_EMPTY_RESPONSE", {
@@ -938,7 +910,6 @@ class ReasoningService extends BaseReasoningService {
response: JSON.stringify(candidate).substring(0, 500),
});
- // If finish reason is MAX_TOKENS, the model hit its limit
if (candidate.finishReason === "MAX_TOKENS") {
throw new Error(
"Gemini reached token limit before generating response. Try a shorter input or increase max tokens."
@@ -1009,7 +980,6 @@ class ReasoningService extends BaseReasoningService {
async isAvailable(): Promise<boolean> {
try {
- // Check if we have at least one configured API key or local model available
const openaiKey = await window.electronAPI?.getOpenAIKey?.();
const anthropicKey = await window.electronAPI?.getAnthropicKey?.();
const geminiKey = await window.electronAPI?.getGeminiKey?.();
@@ -1035,14 +1005,8 @@ class ReasoningService extends BaseReasoningService {
}
}
- /**
- * Clear cached API key for a specific provider or all providers.
- * Call this when API keys change to ensure fresh keys are used.
- * Note: "custom" keys are not cached (read fresh from localStorage each time).
- */
clearApiKeyCache(provider?: "openai" | "anthropic" | "gemini" | "groq" | "custom"): void {
if (provider) {
- // Custom keys aren't cached, but we accept the type for consistency
if (provider !== "custom") {
this.apiKeyCache.delete(provider);
}
diff --git a/src/utils/agentName.ts b/src/utils/agentName.ts
index dc9eaeb9d..5d90835ad 100644
--- a/src/utils/agentName.ts
+++ b/src/utils/agentName.ts
@@ -1,15 +1,23 @@
import { useState } from "react";
const AGENT_NAME_KEY = "agentName";
+const DEFAULT_AGENT_NAME = "OpenWhispr";
export const getAgentName = (): string => {
- return localStorage.getItem(AGENT_NAME_KEY) || "Agent";
+ return localStorage.getItem(AGENT_NAME_KEY) || DEFAULT_AGENT_NAME;
};
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);
+ }
+};
+
export const clearAgentName = (): void => {
localStorage.removeItem(AGENT_NAME_KEY);
};
diff --git a/src/utils/modelPickerStyles.ts b/src/utils/modelPickerStyles.ts
index 23676ff37..4e45c0d12 100644
--- a/src/utils/modelPickerStyles.ts
+++ b/src/utils/modelPickerStyles.ts
@@ -2,10 +2,6 @@ export type ColorScheme = "purple" | "indigo" | "blue";
export interface ModelPickerStyles {
container: string;
- progress: string;
- progressText: string;
- progressBar: string;
- progressFill: string;
header: string;
modelCard: { selected: string; default: string };
badges: { selected: string; downloaded: string; recommended: string };
@@ -14,72 +10,81 @@ export interface ModelPickerStyles {
export const MODEL_PICKER_COLORS: Record<ColorScheme, ModelPickerStyles> = {
purple: {
- container: "border border-gray-200 rounded-xl overflow-hidden",
- progress: "bg-purple-50 border-b border-purple-200",
- progressText: "text-purple-900",
- progressBar: "bg-purple-200",
- progressFill: "bg-gradient-to-r from-purple-500 to-purple-600",
- header: "font-medium text-purple-900",
+ container:
+ "bg-card border border-border rounded-xl overflow-hidden dark:bg-surface-1 shadow-sm",
+ header: "font-medium text-foreground tracking-tight",
modelCard: {
- selected: "border-purple-500 bg-purple-50",
- default: "border-gray-200 bg-white hover:border-gray-300",
+ selected:
+ "border-primary/30 bg-primary/8 dark:bg-primary/6 dark:border-primary/20 shadow-[0_0_0_1px_oklch(0.62_0.22_260/0.12),0_0_10px_-3px_oklch(0.62_0.22_260/0.18)]",
+ default:
+ "border-border bg-surface-1 hover:border-border-hover hover:bg-muted dark:bg-card dark:border-border dark:hover:border-border-hover dark:hover:bg-surface-raised",
},
badges: {
- selected: "text-xs text-purple-600 bg-purple-100 px-2 py-1 rounded-full font-medium",
- downloaded: "text-xs text-green-600 bg-green-100 px-2 py-0.5 rounded",
- recommended: "text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded",
+ selected:
+ "text-[10px] text-primary-foreground bg-primary px-1.5 py-0.5 rounded-sm font-medium",
+ downloaded:
+ "text-[10px] text-success dark:text-success bg-success/10 dark:bg-success/12 px-1.5 py-0.5 rounded-sm",
+ recommended:
+ "text-[10px] text-primary bg-primary/10 dark:bg-primary/12 px-1.5 py-0.5 rounded-sm font-medium",
},
buttons: {
- download: "bg-purple-600 hover:bg-purple-700",
- select: "border-purple-300 text-purple-700 hover:bg-purple-50",
- delete: "text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",
- refresh: "border-purple-300 text-purple-700 hover:bg-purple-50",
+ download: "",
+ select: "border-primary/25 text-primary hover:bg-primary/8",
+ delete:
+ "text-destructive hover:text-destructive/90 hover:bg-destructive/8 border-destructive/25",
+ refresh: "border-primary/25 text-primary hover:bg-primary/8",
},
},
indigo: {
- container: "border border-gray-200 rounded-xl overflow-hidden",
- progress: "bg-indigo-50 border-b border-indigo-200",
- progressText: "text-indigo-900",
- progressBar: "bg-indigo-200",
- progressFill: "bg-gradient-to-r from-indigo-500 to-indigo-600",
- header: "font-medium text-indigo-900",
+ container:
+ "bg-card border border-border rounded-xl overflow-hidden dark:bg-surface-1 shadow-sm",
+ header: "font-medium text-foreground tracking-tight",
modelCard: {
- selected: "border-indigo-500 bg-indigo-50",
- default: "border-gray-200 bg-white hover:border-gray-300",
+ selected:
+ "border-primary/30 bg-primary/8 dark:bg-primary/6 dark:border-primary/20 shadow-[0_0_0_1px_oklch(0.62_0.22_260/0.12),0_0_10px_-3px_oklch(0.62_0.22_260/0.18)]",
+ default:
+ "border-border bg-surface-1 hover:border-border-hover hover:bg-muted dark:bg-card dark:border-border dark:hover:border-border-hover dark:hover:bg-surface-raised",
},
badges: {
- selected: "text-xs text-indigo-600 bg-indigo-100 px-2 py-1 rounded-full font-medium",
- downloaded: "text-xs text-green-600 bg-green-100 px-2 py-0.5 rounded",
- recommended: "text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded",
+ selected:
+ "text-[10px] text-primary-foreground bg-primary px-1.5 py-0.5 rounded-sm font-medium",
+ downloaded:
+ "text-[10px] text-success dark:text-success bg-success/10 dark:bg-success/12 px-1.5 py-0.5 rounded-sm",
+ recommended:
+ "text-[10px] text-primary bg-primary/10 dark:bg-primary/12 px-1.5 py-0.5 rounded-sm font-medium",
},
buttons: {
- download: "bg-indigo-600 hover:bg-indigo-700",
- select: "border-indigo-300 text-indigo-700 hover:bg-indigo-50",
- delete: "text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",
- refresh: "border-indigo-300 text-indigo-700 hover:bg-indigo-50",
+ download: "",
+ select: "border-primary/25 text-primary hover:bg-primary/8",
+ delete:
+ "text-destructive hover:text-destructive/90 hover:bg-destructive/8 border-destructive/25",
+ refresh: "border-primary/25 text-primary hover:bg-primary/8",
},
},
blue: {
- container: "bg-gray-50 rounded-lg overflow-hidden border border-gray-200",
- progress: "bg-blue-50 border-b border-blue-200",
- progressText: "text-blue-900",
- progressBar: "bg-blue-200",
- progressFill: "bg-gradient-to-r from-blue-500 to-blue-600",
- header: "font-medium text-gray-900",
+ container:
+ "bg-surface-1 dark:bg-white/3 rounded-xl overflow-hidden border border-border dark:border-white/5 backdrop-blur-md shadow-sm",
+ header: "text-sm font-medium text-foreground tracking-tight",
modelCard: {
- selected: "border-blue-500 bg-blue-50",
- default: "border-gray-200 bg-white hover:border-gray-300",
+ selected:
+ "border-primary/30 bg-primary/10 dark:bg-primary/6 shadow-[0_0_0_1px_oklch(0.62_0.22_260/0.15),0_0_12px_-3px_oklch(0.62_0.22_260/0.2)]",
+ default:
+ "border-border bg-surface-1 hover:border-border-hover hover:bg-surface-raised dark:border-white/5 dark:bg-white/3 dark:hover:border-white/20 dark:hover:bg-white/8",
},
badges: {
- selected: "text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full font-medium",
- downloaded: "text-xs text-green-600 bg-green-100 px-2 py-1 rounded",
- recommended: "text-xs bg-primary/10 text-primary px-2 py-1 rounded",
+ selected:
+ "text-[10px] text-primary-foreground bg-primary px-1.5 py-0.5 rounded-sm font-medium",
+ downloaded: "text-[10px] text-success bg-success/10 px-1.5 py-0.5 rounded-sm font-medium",
+ recommended: "text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded-sm font-medium",
},
buttons: {
- download: "bg-blue-600 hover:bg-blue-700",
- select: "border-gray-300 text-gray-700 hover:bg-gray-50",
- delete: "text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",
- refresh: "border-gray-300 text-gray-700 hover:bg-gray-50",
+ download: "",
+ select:
+ "border-border text-foreground hover:bg-surface-raised dark:border-white/10 dark:hover:bg-white/8",
+ delete:
+ "text-destructive hover:text-destructive/90 hover:bg-destructive/8 border-destructive/25",
+ refresh:
+ "border-border text-foreground hover:bg-surface-raised dark:border-white/10 dark:hover:bg-white/8",
},
},
};
diff --git a/src/utils/providerIcons.ts b/src/utils/providerIcons.ts
index ff415bcb4..3d3c71ed3 100644
--- a/src/utils/providerIcons.ts
+++ b/src/utils/providerIcons.ts
@@ -25,3 +25,11 @@ export const PROVIDER_ICONS: Record<string, string> = {
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);
+}