Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
feat: added sqllite , added brand elements
Gabriel Stein92acda57cbfc
diff --git a/README.md b/README.mdindex 4256d86ca..d1dc1410d 100644--- a/README.md+++ b/README.md@@ -18,11 +18,18 @@ A desktop dictation application using OpenAI Whisper for speech-to-text transcrinpm install```-2. **Set up your OpenAI API key**:+2. **Set up your OpenAI API key** (choose one method):++ **Method A - .env file (recommended)**:```bashcp env.example .env# Edit .env and add your OpenAI API key```++ **Method B - Control Panel**:+ ```bash+ # Skip .env setup and configure the API key through the app's Control Panel+ ```3. **Run in development**:```bash@@ -154,7 +161,11 @@ MIT License - see [LICENSE](LICENSE) for details.1. **Microphone permissions**: Grant permissions in System Preferences/Settings2. **API key errors**: Ensure your OpenAI API key is valid and has credits+ - Try setting the key through the Control Panel if .env file isn't working+ - Check console logs for "OpenAI API Key present: Yes/No"3. **Global hotkey conflicts**: Change the hotkey in the Control Panel+4. **Input paste issues**: The Control Panel now has improved paste support+5. **Production API key issues**: Use either .env file or Control Panel to set your key### Getting Helpdiff --git a/main.js b/main.jsindex 1f77f7106..c44d01f0a 100644--- a/main.js+++ b/main.js@@ -1,7 +1,58 @@const { app, BrowserWindow, globalShortcut, ipcMain, clipboard, shell, screen, Menu, Tray } = require("electron")const path = require("path")const { spawn } = require("child_process")-require('dotenv').config() // Load .env+const Database = require('better-sqlite3')++// Load .env file with better error handling and production support+function loadEnvironmentVariables() {+ // In production, try multiple locations for .env file+ const possibleEnvPaths = [+ // Development path+ path.join(__dirname, '.env'),+ // Production packaged app paths+ path.join(process.resourcesPath, '.env'),+ path.join(process.resourcesPath, 'app.asar.unpacked', '.env'),+ path.join(app.getPath('userData'), '.env'), // User data directory+ // Legacy paths+ path.join(process.resourcesPath, 'app', '.env'),+ ];++ let envLoaded = false;++ for (const envPath of possibleEnvPaths) {+ try {+ const fs = require('fs');+ if (fs.existsSync(envPath)) {+ console.log(`π Trying to load .env from: ${envPath}`);+ const result = require('dotenv').config({ path: envPath });+ if (!result.error) {+ console.log(`β .env file loaded successfully from: ${envPath}`);+ envLoaded = true;+ break;+ } else {+ console.log(`β οΈ .env file found but failed to parse: ${envPath}`, result.error);+ }+ }+ } catch (error) {+ console.log(`β Could not load .env from ${envPath}:`, error.message);+ }+ }++ if (!envLoaded) {+ console.log('β οΈ No .env file found in any expected location');+ console.log('π‘ You can still set the API key via the Control Panel');+ console.log('π Expected locations:', possibleEnvPaths);+ }++ console.log('π Environment:', process.env.NODE_ENV || 'production');+ console.log('π OpenAI API Key present:', process.env.OPENAI_API_KEY ? 'Yes' : 'No');+ if (process.env.OPENAI_API_KEY) {+ console.log('π OpenAI API Key preview:', process.env.OPENAI_API_KEY.substring(0, 10) + '...');+ }+}++// Load environment variables+loadEnvironmentVariables();let mainWindowlet tray = null@@ -49,8 +100,8 @@ function getAppUrl(isControlPanel = false) {async function createWindow() {// Always show window by defaultconst display = screen.getPrimaryDisplay();- const width = 120;- const height = 80;+ const width = 400;+ const height = 400;const x = display.bounds.x + Math.round((display.workArea.width - width) / 2);const y = Math.max(0, display.workArea.height); // Position above the dock/menu bar with padding@@ -114,14 +165,8 @@ async function createWindow() {}});- // Pass environment variables to renderer process+ // Ensure window is visible after loadmainWindow.webContents.on('did-finish-load', () => {- mainWindow.webContents.executeJavaScript(`- window.OPENAI_API_KEY = '${process.env.OPENAI_API_KEY || ''}';- console.log('API Key loaded:', window.OPENAI_API_KEY ? 'Present' : 'Missing');- `);-- // Ensure window is visible after loadsetTimeout(() => {if (!mainWindow.isVisible()) {console.log('Window not visible, forcing show...');@@ -180,7 +225,8 @@ async function createControlPanelWindow() {nodeIntegration: false,contextIsolation: true,enableRemoteModule: false,- sandbox: true,+ sandbox: false, // Disable sandbox for control panel to allow clipboard access+ webSecurity: false, // Disable web security for clipboard access},title: 'OpenScribe Control Panel',resizable: true,@@ -209,12 +255,51 @@ async function createControlPanelWindow() {});}+// Database setup+let db;++function initDatabase() {+ // Use different database files for development vs production+ const dbFileName = process.env.NODE_ENV === 'development'+ ? 'transcriptions-dev.db'+ : 'transcriptions.db';++ const dbPath = path.join(app.getPath('userData'), dbFileName);+ console.log(`ποΈ Database environment: ${process.env.NODE_ENV || 'production'}`);+ console.log('π Database path:', dbPath);++ db = new Database(dbPath);++ // Create transcriptions table if it doesn't exist+ db.exec(`+ CREATE TABLE IF NOT EXISTS transcriptions (+ id INTEGER PRIMARY KEY AUTOINCREMENT,+ text TEXT NOT NULL,+ timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP+ )+ `);++ // Get count of existing transcriptions+ const countStmt = db.prepare('SELECT COUNT(*) as count FROM transcriptions');+ const { count } = countStmt.get();++ console.log(`β Database initialized successfully (${count} existing transcriptions)`);+}+app.whenReady().then(async () => {console.log('Electron app ready, creating window...');console.log('__dirname:', __dirname);console.log('process.resourcesPath:', process.resourcesPath);console.log('NODE_ENV:', process.env.NODE_ENV);+ // Initialize database+ try {+ initDatabase();+ } catch (error) {+ console.error('Failed to initialize database:', error);+ }+// In development, add a small delay to let Vite start properlyif (process.env.NODE_ENV === 'development') {console.log('Development mode: waiting 2 seconds for Vite to stabilize...');@@ -322,24 +407,279 @@ app.on("will-quit", () => {globalShortcut.unregisterAll()})+// Function to check and request accessibility permissions on macOS+async function checkAccessibilityPermissions() {+ if (process.platform !== 'darwin') return true;++ return new Promise((resolve) => {+ const { spawn } = require("child_process");++ console.log('π Checking accessibility permissions...');++ // First, let's check if we can perform a simple accessibility action+ const testProcess = spawn("osascript", [+ "-e",+ 'tell application "System Events" to get name of first process'+ ]);++ let testOutput = '';+ let testError = '';++ testProcess.stdout.on('data', (data) => {+ testOutput += data.toString();+ });++ testProcess.stderr.on('data', (data) => {+ testError += data.toString();+ });++ testProcess.on('close', (code) => {+ console.log('Initial accessibility test - Code:', code);+ console.log('Test output:', testOutput);+ console.log('Test error:', testError);++ if (code === 0) {+ console.log('β Accessibility permissions: GRANTED');+ resolve(true);+ } else {+ // Permission denied - but let's check if this might be a "stuck permission" issue+ console.log('β Accessibility permissions: DENIED');++ // Check if the error suggests we need to reset permissions+ const isStuckPermission = testError.includes('not allowed assistive access') ||+ testError.includes('(-1719)') ||+ testError.includes('(-25006)');++ let dialogMessage;+ if (isStuckPermission) {+ dialogMessage = `π OpenScribe needs Accessibility permissions, but it looks like you may have OLD PERMISSIONS from a previous version.++β COMMON ISSUE: If you've rebuilt/reinstalled OpenScribe, the old permissions may be "stuck" and preventing new ones.++π§ To fix this:+1. Open System Settings β Privacy & Security β Accessibility+2. Look for ANY old "OpenScribe" entries and REMOVE them (click the - button)+3. Also remove any entries that say "Electron" or have unclear names+4. Click the + button and manually add the NEW OpenScribe app+5. Make sure the checkbox is enabled+6. Restart OpenScribe++β οΈ This is especially common during development when rebuilding the app.++π Without this permission, text will only copy to clipboard (no automatic pasting).++Would you like to open System Settings now?`;+ } else {+ dialogMessage = `π OpenScribe needs Accessibility permissions to paste text into other applications.++π Current status: Clipboard copy works, but pasting (Cmd+V simulation) fails.++π§ To fix this:+1. Open System Settings (or System Preferences on older macOS)+2. Go to Privacy & Security β Accessibility+3. Click the lock icon and enter your password+4. Add OpenScribe to the list and check the box+5. Restart OpenScribe++β οΈ Without this permission, dictated text will only be copied to clipboard but won't paste automatically.++π‘ In production builds, this permission is required for full functionality.++Would you like to open System Settings now?`;+ }++ const permissionDialog = spawn("osascript", [+ "-e",+ `display dialog "${dialogMessage}" buttons {"Cancel", "Open System Settings"} default button "Open System Settings"`+ ]);++ permissionDialog.on('close', (dialogCode) => {+ if (dialogCode === 0) {+ // User clicked "Open System Settings" - try modern path first, then legacy+ const settingsCommands = [+ ["open", ["x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"]],+ ["open", ["-b", "com.apple.systempreferences"]],+ ["open", ["/System/Library/PreferencePanes/Security.prefPane"]]+ ];++ let commandIndex = 0;+ const tryNextCommand = () => {+ if (commandIndex < settingsCommands.length) {+ const [cmd, args] = settingsCommands[commandIndex];+ const settingsProcess = spawn(cmd, args);++ settingsProcess.on('error', (error) => {+ console.log(`Settings command ${commandIndex + 1} failed:`, error);+ commandIndex++;+ tryNextCommand();+ });++ settingsProcess.on('close', (settingsCode) => {+ if (settingsCode !== 0) {+ console.log(`Settings command ${commandIndex + 1} failed with code:`, settingsCode);+ commandIndex++;+ tryNextCommand();+ } else {+ console.log(`β Opened System Settings with command ${commandIndex + 1}`);+ }+ });+ } else {+ console.log('β All settings commands failed, user will need to open manually');+ // Try one more fallback - just open System Settings/Preferences+ spawn("open", ["-a", "System Preferences"]).on('error', () => {+ spawn("open", ["-a", "System Settings"]).on('error', () => {+ console.log('Could not open settings app');+ });+ });+ }+ };++ tryNextCommand();+ }+ resolve(false);+ });++ permissionDialog.on('error', (error) => {+ console.error('Error showing permission dialog:', error);+ console.log('Fallback: User needs to manually grant accessibility permissions');+ console.log('π‘ TIP: If this is a rebuilt app, remove old OpenScribe entries from Accessibility settings first');+ resolve(false);+ });+ }+ });++ testProcess.on('error', (error) => {+ console.error('Error checking accessibility permissions:', error);+ console.log('Fallback: Assuming permissions are needed');+ resolve(false);+ });+ });+}+// IPC handlersipcMain.handle("paste-text", async (event, text) => {- // Copy text to clipboard and simulate paste- clipboard.writeText(text)+ try {+ // Copy text to clipboard first - this always works+ clipboard.writeText(text);+ console.log('π Text copied to clipboard:', text.substring(0, 50) + '...');- // Simulate Ctrl+V (or Cmd+V on Mac)- const { spawn } = require("child_process")- if (process.platform === "darwin") {- spawn("osascript", ["-e", 'tell application "System Events" to keystroke "v" using command down'])- } else if (process.platform === "win32") {- console.log("Simulating Ctrl+V on Windows")- spawn("powershell", [- "-Command",- 'Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SendKeys]::SendWait("^v")',- ])- } else {- // Linux- spawn("xdotool", ["key", "ctrl+v"])+ if (process.platform === "darwin") {+ // Check accessibility permissions first+ console.log('π Checking accessibility permissions for paste operation...');+ const hasPermissions = await checkAccessibilityPermissions();++ if (!hasPermissions) {+ console.log('β οΈ No accessibility permissions - text copied to clipboard only');+ const errorMsg = 'Accessibility permissions required for automatic pasting. Text has been copied to clipboard - please paste manually with Cmd+V.';+ throw new Error(errorMsg);+ }++ console.log('β Permissions granted, attempting to paste...');++ // Use AppleScript to paste with better error handling and timeout+ const { spawn } = require("child_process");+ return new Promise((resolve, reject) => {+ // Add a small delay to ensure clipboard is ready+ setTimeout(() => {+ const pasteProcess = spawn("osascript", [+ "-e",+ 'tell application "System Events" to keystroke "v" using command down'+ ]);++ let errorOutput = '';+ let hasTimedOut = false;++ pasteProcess.stderr.on('data', (data) => {+ errorOutput += data.toString();+ });++ pasteProcess.on('close', (code) => {+ if (hasTimedOut) return; // Ignore if already timed out++ if (code === 0) {+ console.log('β Text pasted successfully via Cmd+V simulation');+ resolve();+ } else {+ console.error('β Failed to paste text, code:', code);+ console.error('Error output:', errorOutput);+ const errorMsg = `Paste failed (code ${code}). Text is copied to clipboard - please paste manually with Cmd+V.`;+ reject(new Error(errorMsg));+ }+ });++ pasteProcess.on('error', (error) => {+ if (hasTimedOut) return; // Ignore if already timed out++ console.error('β Error running paste command:', error);+ const errorMsg = `Paste command failed: ${error.message}. Text is copied to clipboard - please paste manually with Cmd+V.`;+ reject(new Error(errorMsg));+ });++ // Add timeout with cleanup+ const timeoutId = setTimeout(() => {+ hasTimedOut = true;+ pasteProcess.kill('SIGKILL');+ console.error('β° Paste operation timed out');+ const errorMsg = 'Paste operation timed out. Text is copied to clipboard - please paste manually with Cmd+V.';+ reject(new Error(errorMsg));+ }, 3000); // Reduced timeout for better UX++ // Clear timeout if process completes normally+ pasteProcess.on('close', () => {+ clearTimeout(timeoutId);+ });++ }, 100); // Small delay to ensure clipboard is ready+ });++ } else if (process.platform === "win32") {+ console.log("Simulating Ctrl+V on Windows");+ return new Promise((resolve, reject) => {+ const pasteProcess = spawn("powershell", [+ "-Command",+ 'Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SendKeys]::SendWait("^v")',+ ]);++ pasteProcess.on('close', (code) => {+ if (code === 0) {+ console.log('β Text pasted successfully on Windows');+ resolve();+ } else {+ console.error('β Failed to paste on Windows, code:', code);+ reject(new Error(`Windows paste failed with code ${code}. Text is copied to clipboard.`));+ }+ });++ pasteProcess.on('error', (error) => {+ console.error('β Windows paste error:', error);+ reject(new Error(`Windows paste failed: ${error.message}. Text is copied to clipboard.`));+ });+ });+ } else {+ // Linux+ console.log("Simulating Ctrl+V on Linux");+ return new Promise((resolve, reject) => {+ const pasteProcess = spawn("xdotool", ["key", "ctrl+v"]);++ pasteProcess.on('close', (code) => {+ if (code === 0) {+ console.log('β Text pasted successfully on Linux');+ resolve();+ } else {+ console.error('β Failed to paste on Linux, code:', code);+ reject(new Error(`Linux paste failed with code ${code}. Text is copied to clipboard.`));+ }+ });++ pasteProcess.on('error', (error) => {+ console.error('β Linux paste error:', error);+ reject(new Error(`Linux paste failed: ${error.message}. Text is copied to clipboard.`));+ });+ });+ }+ } catch (error) {+ console.error('β Paste error:', error);+ throw error;}})@@ -351,3 +691,115 @@ ipcMain.handle("hide-window", () => {mainWindow.hide();}})++// Database IPC handlers+ipcMain.handle('db-save-transcription', async (event, text) => {+ try {+ const stmt = db.prepare('INSERT INTO transcriptions (text) VALUES (?)');+ const result = stmt.run(text);++ const truncatedText = text.length > 50 ? text.substring(0, 50) + '...' : text;+ console.log(`π Transcription saved to ${process.env.NODE_ENV || 'production'} DB:`, {+ id: result.lastInsertRowid,+ text: truncatedText,+ length: text.length+ });++ return { id: result.lastInsertRowid, success: true };+ } catch (error) {+ console.error('β Error saving transcription:', error);+ throw error;+ }+});++ipcMain.handle('db-get-transcriptions', async (event, limit = 50) => {+ try {+ const stmt = db.prepare('SELECT * FROM transcriptions ORDER BY timestamp DESC LIMIT ?');+ const transcriptions = stmt.all(limit);+ console.log(`π Retrieved ${transcriptions.length} transcriptions from ${process.env.NODE_ENV || 'production'} DB (limit: ${limit})`);+ return transcriptions;+ } catch (error) {+ console.error('β Error getting transcriptions:', error);+ throw error;+ }+});++ipcMain.handle('db-clear-transcriptions', async (event) => {+ try {+ const stmt = db.prepare('DELETE FROM transcriptions');+ const result = stmt.run();+ console.log(`ποΈ Cleared ${result.changes} transcriptions from ${process.env.NODE_ENV || 'production'} DB`);+ return { cleared: result.changes, success: true };+ } catch (error) {+ console.error('β Error clearing transcriptions:', error);+ throw error;+ }+});++ipcMain.handle('db-delete-transcription', async (event, id) => {+ try {+ const stmt = db.prepare('DELETE FROM transcriptions WHERE id = ?');+ const result = stmt.run(id);+ console.log(`ποΈ Deleted transcription ${id}, affected rows: ${result.changes}`);+ return { success: result.changes > 0 };+ } catch (error) {+ console.error('β Error deleting transcription:', error);+ throw error;+ }+});++// Environment variable handlers+ipcMain.handle('get-openai-key', async (event) => {+ const apiKey = process.env.OPENAI_API_KEY;+ console.log('π OpenAI API Key requested:', apiKey ? 'Present' : 'Missing');+ return apiKey || '';+});++ipcMain.handle('save-openai-key', async (event, key) => {+ try {+ // Update the environment variable in memory for immediate use+ process.env.OPENAI_API_KEY = key;+ console.log('π OpenAI API Key updated in memory');+ return { success: true };+ } catch (error) {+ console.error('β Error saving OpenAI API key:', error);+ throw error;+ }+});++// Clipboard handler for better paste support+ipcMain.handle('read-clipboard', async (event) => {+ try {+ const text = clipboard.readText();+ console.log('π Clipboard read:', text ? 'Text found' : 'Empty');+ return text;+ } catch (error) {+ console.error('β Error reading clipboard:', error);+ throw error;+ }+});++// Production .env file creation handler+ipcMain.handle('create-production-env-file', async (event, apiKey) => {+ try {+ const fs = require('fs');+ const envPath = path.join(app.getPath('userData'), '.env');++ const envContent = `# OpenScribe Environment Variables+# This file was created automatically for production use+OPENAI_API_KEY=${apiKey}+`;++ fs.writeFileSync(envPath, envContent, 'utf8');+ console.log('β Production .env file created at:', envPath);++ // Reload environment variables+ require('dotenv').config({ path: envPath });+ console.log('π Environment variables reloaded from production .env file');++ return { success: true, path: envPath };+ } catch (error) {+ console.error('β Error creating production .env file:', error);+ throw error;+ }+});diff --git a/preload.js b/preload.jsindex 810d99a96..d21b790aa 100644--- a/preload.js+++ b/preload.js@@ -4,4 +4,18 @@ contextBridge.exposeInMainWorld('electronAPI', {pasteText: (text) => ipcRenderer.invoke('paste-text', text),hideWindow: () => ipcRenderer.invoke('hide-window'),onToggleDictation: (callback) => ipcRenderer.on('toggle-dictation', callback),++ // Database functions+ saveTranscription: (text) => ipcRenderer.invoke('db-save-transcription', text),+ getTranscriptions: (limit) => ipcRenderer.invoke('db-get-transcriptions', limit),+ clearTranscriptions: () => ipcRenderer.invoke('db-clear-transcriptions'),+ deleteTranscription: (id) => ipcRenderer.invoke('db-delete-transcription', id),++ // Environment variables+ getOpenAIKey: () => ipcRenderer.invoke('get-openai-key'),+ saveOpenAIKey: (key) => ipcRenderer.invoke('save-openai-key', key),+ createProductionEnvFile: (key) => ipcRenderer.invoke('create-production-env-file', key),++ // Clipboard functions+ readClipboard: () => ipcRenderer.invoke('read-clipboard'),});\ No newline at end of filediff --git a/src/App.jsx b/src/App.jsxindex c3b6b7c91..fe0bd1030 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -68,10 +68,16 @@ export default function App() {formData.append('file', audioBlob, 'audio.wav');formData.append('model', 'whisper-1');- // Get API key from window object (passed from main process)- const apiKey = window.OPENAI_API_KEY;- if (!apiKey) {- setError('OpenAI API key not found. Please check your .env file.');+ // Get API key from main process via IPC (will check .env and in-memory storage)+ let apiKey = await window.electronAPI.getOpenAIKey();++ // Fallback to localStorage if no key from main process+ if (!apiKey || apiKey.trim() === '' || apiKey === 'your_openai_api_key_here') {+ apiKey = localStorage.getItem('openaiApiKey');+ }++ if (!apiKey || apiKey.trim() === '' || apiKey === 'your_openai_api_key_here') {+ setError('OpenAI API key not found. Please set your API key in the .env file or Control Panel.');setIsProcessing(false);return;}@@ -100,6 +106,15 @@ export default function App() {if (text) {setTranscript(text);console.log("Transcribed text:", text)++ // Save transcription to database+ try {+ await window.electronAPI.saveTranscription(text);+ console.log("β Transcription saved to database");+ } catch (err) {+ console.error("Failed to save transcription:", err);+ }+// Automatically paste the textawait safePaste(text);} else {diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsxindex 943105d00..a9b379758 100644--- a/src/components/ControlPanel.tsx+++ b/src/components/ControlPanel.tsx@@ -3,176 +3,529 @@ import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";import { Button } from "./ui/button";import { Input } from "./ui/input";+// Type declaration for electronAPI+declare global {+ interface Window {+ electronAPI: {+ pasteText: (text: string) => Promise<void>;+ hideWindow: () => Promise<void>;+ onToggleDictation: (callback: () => void) => void;+ saveTranscription: (text: string) => Promise<{ id: number; success: boolean }>;+ getTranscriptions: (limit?: number) => Promise<TranscriptionItem[]>;+ clearTranscriptions: () => Promise<{ cleared: number; success: boolean }>;+ deleteTranscription: (id: number) => Promise<{ success: boolean }>;+ getOpenAIKey: () => Promise<string>;+ saveOpenAIKey: (key: string) => Promise<{ success: boolean }>;+ readClipboard: () => Promise<string>;+ createProductionEnvFile: (key: string) => Promise<void>;+ };+ }+}+interface TranscriptionItem {- id: string;+ id: number;text: string;- timestamp: Date;+ timestamp: string;+ created_at: string;}export default function ControlPanel() {const [key, setKey] = useState("");- const [history, setHistory] = useState<TranscriptionItem[]>([- {- id: "1",- text: "Sample transcription from yesterday",- timestamp: new Date(Date.now() - 86400000)- },- {- id: "2",- text: "Another example transcription",- timestamp: new Date(Date.now() - 3600000)- }- ]);+ const [history, setHistory] = useState<TranscriptionItem[]>([]);const [apiKey, setApiKey] = useState("");+ const [isLoading, setIsLoading] = useState(true);useEffect(() => {// Load saved settingsconst savedKey = localStorage.getItem('dictationKey');- const savedApiKey = localStorage.getItem('openaiApiKey');if (savedKey) setKey(savedKey);- if (savedApiKey) setApiKey(savedApiKey);++ // Load API key from main process first, then fallback to localStorage+ const loadApiKey = async () => {+ try {+ const envApiKey = await window.electronAPI.getOpenAIKey();+ if (envApiKey && envApiKey !== 'your_openai_api_key_here') {+ setApiKey(envApiKey);+ } else {+ const savedApiKey = localStorage.getItem('openaiApiKey');+ if (savedApiKey) setApiKey(savedApiKey);+ }+ } catch (error) {+ console.error('Failed to load API key:', error);+ const savedApiKey = localStorage.getItem('openaiApiKey');+ if (savedApiKey) setApiKey(savedApiKey);+ }+ };++ loadApiKey();++ // Load transcription history from database+ loadTranscriptions();}, []);+ const loadTranscriptions = async () => {+ try {+ setIsLoading(true);+ const transcriptions = await window.electronAPI.getTranscriptions(50);+ setHistory(transcriptions);+ console.log('π Loaded', transcriptions.length, 'transcriptions');+ } catch (error) {+ console.error('β Failed to load transcriptions:', error);+ } finally {+ setIsLoading(false);+ }+ };+const saveKey = () => {localStorage.setItem('dictationKey', key);- alert(`Dictation key set to: ${key}`);+ alert(`Dictation key inscribed: ${key}`);};- const saveApiKey = () => {- localStorage.setItem('openaiApiKey', apiKey);- alert('OpenAI API key saved successfully');+ const saveApiKey = async () => {+ try {+ // Save to main process (updates environment variable)+ await window.electronAPI.saveOpenAIKey(apiKey);+ // Also save to localStorage as backup+ localStorage.setItem('openaiApiKey', apiKey);++ // In production, try to create a .env file in user data directory+ try {+ await window.electronAPI.createProductionEnvFile(apiKey);+ alert('OpenAI API key inscribed successfully! Your credentials have been securely recorded for transcription services.');+ } catch (envError) {+ console.log('Could not create production .env file:', envError);+ alert('OpenAI API key saved successfully and will be available for transcription');+ }+ } catch (error) {+ console.error('Failed to save API key:', error);+ // Fallback to localStorage only+ localStorage.setItem('openaiApiKey', apiKey);+ alert('OpenAI API key saved to localStorage (fallback mode)');+ }};const copyToClipboard = async (text: string) => {try {await navigator.clipboard.writeText(text);- alert('Copied to clipboard!');+ alert('Text copied to your scribal collection!');} catch (err) {console.error('Failed to copy:', err);}};- const clearHistory = () => {- if (confirm('Are you sure you want to clear all transcription history?')) {- setHistory([]);- localStorage.removeItem('transcriptionHistory');+ const clearHistory = async () => {+ if (confirm('Are you certain you wish to clear all inscribed records? This action cannot be undone.')) {+ try {+ const result = await window.electronAPI.clearTranscriptions();+ console.log(`ποΈ Cleared ${result.cleared} transcriptions`);+ setHistory([]);+ alert(`Successfully cleared ${result.cleared} transcriptions from your chronicles.`);+ } catch (error) {+ console.error('β Failed to clear transcriptions:', error);+ alert('Failed to clear history. Please try again.');+ }}};const requestPermissions = async () => {try {await navigator.mediaDevices.getUserMedia({ audio: true });- alert('Microphone permission granted!');+ alert('Microphone access granted! Your voice may now be inscribed.');} catch (err) {- alert('Please grant microphone permissions in your browser settings.');+ alert('Please grant microphone permissions to enable voice inscription.');}};- return (- <div className="p-8 max-w-2xl mx-auto space-y-6">- <h1 className="text-3xl font-bold text-center mb-8">OpenScribe Control Panel</h1>+ const requestAccessibilityPermissions = async () => {+ try {+ // Test if pasting works+ await window.electronAPI.pasteText('Test inscription - please verify this appears in another application');+ alert('Accessibility permissions appear to be working! Check if the test inscription appeared in another app.');+ } catch (err) {+ alert('Accessibility permissions required! The app will guide you through granting the necessary privileges for automatic text inscription.');+ }+ };++ const resetAccessibilityPermissions = () => {+ const message = `π RESET ACCESSIBILITY PERMISSIONS++If you've rebuilt or reinstalled OpenScribe and automatic inscription isn't functioning, you may have obsolete permissions from the previous version.++π STEP-BY-STEP RESTORATION:++1οΈβ£ Open System Settings (or System Preferences)+ β’ macOS Ventura+: Apple Menu β System Settings+ β’ Older macOS: Apple Menu β System Preferences++2οΈβ£ Navigate to Privacy & Security β Accessibility++3οΈβ£ Look for obsolete OpenScribe entries:+ β’ Any entries named "OpenScribe"+ β’ Any entries named "Electron"+ β’ Any entries with unclear or generic names+ β’ Entries pointing to old application locations++4οΈβ£ Remove ALL obsolete entries:+ β’ Select each old entry+ β’ Click the minus (-) button+ β’ Enter your password if prompted++5οΈβ£ Add the current OpenScribe:+ β’ Click the plus (+) button+ β’ Navigate to and select the CURRENT OpenScribe app+ β’ Ensure the checkbox is ENABLED++6οΈβ£ Restart OpenScribe completely++π‘ This is very common during development when rebuilding applications!++Click OK when you're ready to open System Settings.`;++ if (confirm(message)) {+ // Try to open the accessibility settings directly+ const commands = [+ 'open "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"',+ 'open -b com.apple.systempreferences',+ 'open "/System/Library/PreferencePanes/Security.prefPane"'+ ];- {/* API Configuration */}- <Card>- <CardHeader>- <CardTitle>OpenAI API Configuration</CardTitle>- </CardHeader>- <CardContent className="space-y-4">- <div>- <label className="block text-sm font-medium mb-2">OpenAI API Key</label>- <Input- type="password"- placeholder="sk-..."- value={apiKey}- onChange={(e) => setApiKey(e.target.value)}- className="mb-2"- />- <Button onClick={saveApiKey} disabled={!apiKey.trim()}>- Save API Key- </Button>- </div>- </CardContent>- </Card>-- {/* Dictation Settings */}- <Card>- <CardHeader>- <CardTitle>Dictation Settings</CardTitle>- </CardHeader>- <CardContent className="space-y-4">- <div>- <label className="block text-sm font-medium mb-2">Dictation Hotkey</label>- <Input- placeholder="Currently: ` (backtick)"- value={key}- onChange={(e) => setKey(e.target.value)}- className="mb-2"- />- <Button onClick={saveKey} disabled={!key.trim()}>- Save Hotkey- </Button>- </div>- <div>- <Button onClick={requestPermissions} variant="outline">- Request Microphone Permissions- </Button>- </div>- </CardContent>- </Card>-- {/* Transcription History */}- <Card>- <CardHeader className="flex flex-row items-center justify-between">- <CardTitle>Transcription History</CardTitle>- <Button onClick={clearHistory} variant="destructive" size="sm">- Clear All- </Button>- </CardHeader>- <CardContent>- {history.length === 0 ? (- <p className="text-muted-foreground text-center py-4">- No transcriptions yet. Start dictating to see your history here!+ // We can't directly execute these from the renderer, but we can guide the user+ alert('Opening System Settings... Look for the Accessibility section under Privacy & Security.');++ // Try the URL scheme approach+ window.open('x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility', '_blank');+ }+ };++ const deleteTranscription = async (id: number) => {+ if (confirm('Are you certain you wish to remove this inscription from your records?')) {+ try {+ const result = await window.electronAPI.deleteTranscription(id);+ if (result.success) {+ // Remove from local state+ setHistory(prev => prev.filter(item => item.id !== id));+ console.log(`ποΈ Deleted transcription ${id}`);+ } else {+ alert('Failed to delete transcription. It may have already been removed.');+ }+ } catch (error) {+ console.error('β Failed to delete transcription:', error);+ alert('Failed to delete transcription. Please try again.');+ }+ }+ };++ const refreshHistory = async () => {+ console.log('π Refreshing transcription history...');+ await loadTranscriptions();+ };++ // Enhanced keyboard paste handler for API key input+ const handleApiKeyKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {+ // Handle Cmd+V on Mac or Ctrl+V on Windows/Linux+ if ((e.metaKey || e.ctrlKey) && e.key === 'v') {+ e.preventDefault(); // Prevent default to handle manually+ console.log('Paste shortcut detected, attempting manual paste...');++ // Try to paste from clipboard+ setTimeout(async () => {+ try {+ // Try Electron clipboard first+ const text = await window.electronAPI.readClipboard();+ if (text && text.trim()) {+ setApiKey(text.trim());+ console.log('β Keyboard paste successful via Electron clipboard');+ } else {+ // Fallback to web clipboard API+ const webText = await navigator.clipboard.readText();+ if (webText && webText.trim()) {+ setApiKey(webText.trim());+ console.log('β Keyboard paste successful via Web API');+ }+ }+ } catch (err) {+ console.error('β Keyboard paste failed:', err);+ // Don't show alert for keyboard shortcuts, just log the error+ }+ }, 0);+ }+ };++ return (+ <div className="min-h-screen bg-gradient-to-br from-[#F5F0E6] via-[#F9F6F1] to-[#EDE7DC] p-8">+ <div className="max-w-4xl mx-auto space-y-8">++ {/* Header */}+ <div className="text-center mb-12">+ <h1 className="brand-heading text-5xl font-bold text-[#2B1F14] mb-3">+ OpenScribe+ </h1>+ <p className="brand-script text-xl text-[#6B5D52] italic">+ "Your words, inscribed with care"+ </p>+ <div className="w-24 h-px bg-gradient-to-r from-transparent via-[#C0A77D] to-transparent mx-auto mt-4"></div>+ </div>++ {/* API Configuration Card */}+ <Card className="card">+ <CardHeader className="border-b border-[#DDD4C7] bg-gradient-to-r from-[#FFFFFF] to-[#F9F6F1]">+ <CardTitle className="brand-heading text-2xl text-[#2B1F14] flex items-center gap-3">+ <span className="text-[#C0A77D]">π</span>+ OpenAI API Configuration+ </CardTitle>+ <p className="text-sm text-[#6B5D52] mt-2">+ Configure your transcription credentials to enable voice-to-text inscription.</p>- ) : (- <div className="space-y-3 max-h-96 overflow-y-auto">- {history.map((item) => (- <div key={item.id} className="flex items-start justify-between p-3 border rounded-lg">- <div className="flex-1 mr-3">- <p className="text-sm">{item.text}</p>- <p className="text-xs text-muted-foreground mt-1">- {item.timestamp.toLocaleString()}- </p>- </div>+ </CardHeader>+ <CardContent className="space-y-6 p-8">+ <div className="space-y-4">+ <div>+ <label className="block text-sm font-semibold text-[#2B1F14] mb-3 brand-body">+ OpenAI API Key+ </label>+ <div className="flex gap-3">+ <Input+ type="password"+ placeholder="sk-..."+ value={apiKey}+ onChange={(e) => setApiKey(e.target.value)}+ className="flex-1 text-base"+ onPaste={(e) => {+ e.stopPropagation();+ console.log('Paste event triggered');+ }}+ onKeyDown={handleApiKeyKeyDown}+ autoComplete="off"+ spellCheck={false}+ /><Button- size="sm"variant="outline"- onClick={() => copyToClipboard(item.text)}+ onClick={async () => {+ try {+ const text = await window.electronAPI.readClipboard();+ if (text && text.trim()) {+ setApiKey(text.trim());+ console.log('Manual paste successful via Electron');+ } else {+ const webText = await navigator.clipboard.readText();+ setApiKey(webText.trim());+ console.log('Manual paste successful via Web API');+ }+ } catch (err) {+ console.error('Manual paste failed:', err);+ alert('Could not paste from clipboard. Please try typing or using Cmd+V/Ctrl+V.');+ }+ }}>- Copy+ Inscribe</Button></div>- ))}+ <p className="text-xs text-[#6B5D52] mt-2 italic">+ Your API key will be securely stored and used only for transcription services.+ </p>+ </div>+ <Button+ onClick={saveApiKey}+ disabled={!apiKey.trim()}+ className="w-full bg-[#4B2E2B] hover:bg-[#C0A77D] text-[#F5F0E6] hover:text-[#2B1F14] font-semibold py-3"+ >+ Save API Credentials+ </Button></div>- )}- </CardContent>- </Card>-- {/* App Info */}- <Card>- <CardHeader>- <CardTitle>About OpenScribe</CardTitle>- </CardHeader>- <CardContent>- <p className="text-sm text-muted-foreground mb-4">- OpenScribe is a desktop dictation app that uses OpenAI Whisper for accurate speech-to-text transcription.+ </CardContent>+ </Card>++ {/* Dictation Settings Card */}+ <Card className="card">+ <CardHeader className="border-b border-[#DDD4C7] bg-gradient-to-r from-[#FFFFFF] to-[#F9F6F1]">+ <CardTitle className="brand-heading text-2xl text-[#2B1F14] flex items-center gap-3">+ <span className="text-[#C0A77D]">β¨οΈ</span>+ Dictation Preferences+ </CardTitle>+ <p className="text-sm text-[#6B5D52] mt-2">+ Configure your voice inscription settings and system permissions.+ </p>+ </CardHeader>+ <CardContent className="space-y-6 p-8">+ <div className="space-y-4">+ <div>+ <label className="block text-sm font-semibold text-[#2B1F14] mb-3 brand-body">+ Dictation Activation Key+ </label>+ <Input+ placeholder="Currently: ` (backtick)"+ value={key}+ onChange={(e) => setKey(e.target.value)}+ className="mb-3 text-base"+ onPaste={(e) => {+ e.stopPropagation();+ console.log('Hotkey paste event triggered');+ }}+ onKeyDown={(e) => {+ if ((e.metaKey || e.ctrlKey) && e.key === 'v') {+ console.log('Hotkey paste shortcut detected');+ }+ }}+ autoComplete="off"+ spellCheck={false}+ />+ <Button onClick={saveKey} disabled={!key.trim()} variant="outline" className="mb-6">+ Save Activation Key+ </Button>+ </div>++ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">+ <Button onClick={requestPermissions} variant="outline" className="py-3">+ <span className="mr-2">π€</span>+ Request Microphone Access+ </Button>+ <Button onClick={requestAccessibilityPermissions} variant="outline" className="py-3">+ <span className="mr-2">π</span>+ Verify Accessibility+ </Button>+ </div>++ <Button onClick={resetAccessibilityPermissions} variant="secondary" className="w-full py-3">+ <span className="mr-2">π</span>+ Reset Accessibility Permissions+ </Button>+ </div>+ </CardContent>+ </Card>++ {/* Transcription History Card */}+ <Card className="card">+ <CardHeader className="border-b border-[#DDD4C7] bg-gradient-to-r from-[#FFFFFF] to-[#F9F6F1]">+ <div className="flex flex-row items-center justify-between">+ <div>+ <CardTitle className="brand-heading text-2xl text-[#2B1F14] flex items-center gap-3">+ <span className="text-[#C0A77D]">π</span>+ Inscription Chronicles+ </CardTitle>+ <p className="text-sm text-[#6B5D52] mt-2">+ Your recorded voice transcriptions, preserved for posterity.+ </p>+ </div>+ <div className="flex gap-3">+ <Button onClick={refreshHistory} variant="outline" size="sm">+ <span className="mr-1">π</span>+ Refresh+ </Button>+ <Button onClick={clearHistory} variant="destructive" size="sm">+ <span className="mr-1">ποΈ</span>+ Clear All+ </Button>+ </div>+ </div>+ </CardHeader>+ <CardContent className="p-8">+ {isLoading ? (+ <div className="text-center py-12">+ <div className="text-[#C0A77D] text-2xl mb-3">π</div>+ <p className="text-[#6B5D52] brand-body">+ Loading your inscription chronicles...+ </p>+ </div>+ ) : history.length === 0 ? (+ <div className="text-center py-12">+ <div className="text-[#C0A77D] text-4xl mb-4">βοΈ</div>+ <p className="text-[#6B5D52] brand-body text-lg mb-2">+ No inscriptions yet recorded+ </p>+ <p className="text-[#6B5D52] text-sm italic">+ Begin dictating to see your chronicles appear here+ </p>+ </div>+ ) : (+ <div className="space-y-4 max-h-96 overflow-y-auto">+ {history.map((item, index) => (+ <div key={item.id} className="border border-[#DDD4C7] rounded-lg p-6 bg-gradient-to-r from-[#FFFFFF] to-[#F9F6F1] hover:shadow-md transition-all duration-200">+ <div className="flex items-start justify-between">+ <div className="flex-1 mr-4">+ <div className="flex items-center gap-2 mb-2">+ <span className="text-[#C0A77D] text-sm">#{history.length - index}</span>+ <div className="w-px h-4 bg-[#DDD4C7]"></div>+ <span className="text-xs text-[#6B5D52] brand-body">+ {new Date(item.timestamp).toLocaleString('en-US', {+ weekday: 'short',+ year: 'numeric',+ month: 'short',+ day: 'numeric',+ hour: '2-digit',+ minute: '2-digit'+ })}+ </span>+ </div>+ <p className="text-[#2B1F14] brand-body leading-relaxed text-base">+ "{item.text}"+ </p>+ </div>+ <div className="flex gap-2 flex-shrink-0">+ <Button+ size="sm"+ variant="outline"+ onClick={() => copyToClipboard(item.text)}+ className="text-xs"+ >+ Copy+ </Button>+ <Button+ size="sm"+ variant="destructive"+ onClick={() => deleteTranscription(item.id)}+ className="text-xs"+ >+ Remove+ </Button>+ </div>+ </div>+ </div>+ ))}+ </div>+ )}+ </CardContent>+ </Card>++ {/* About Card */}+ <Card className="card">+ <CardHeader className="border-b border-[#DDD4C7] bg-gradient-to-r from-[#FFFFFF] to-[#F9F6F1]">+ <CardTitle className="brand-heading text-2xl text-[#2B1F14] flex items-center gap-3">+ <span className="text-[#C0A77D]">βΉοΈ</span>+ About OpenScribe+ </CardTitle>+ </CardHeader>+ <CardContent className="p-8">+ <p className="text-[#6B5D52] brand-body text-base leading-relaxed mb-6">+ OpenScribe is an elegant dictation companion that transforms your spoken words into written text using advanced AI transcription.+ Like a skilled scribe of old, it captures your thoughts with precision and care.+ </p>+ <div className="grid grid-cols-1 md:grid-cols-3 gap-6 text-sm">+ <div className="text-center p-4 border border-[#DDD4C7] rounded-lg bg-gradient-to-b from-[#FFFFFF] to-[#F9F6F1]">+ <div className="text-[#C0A77D] text-xl mb-2">β¨οΈ</div>+ <p className="font-semibold text-[#2B1F14] mb-1">Default Hotkey</p>+ <p className="text-[#6B5D52]">` (backtick)</p>+ </div>+ <div className="text-center p-4 border border-[#DDD4C7] rounded-lg bg-gradient-to-b from-[#FFFFFF] to-[#F9F6F1]">+ <div className="text-[#C0A77D] text-xl mb-2">π·οΈ</div>+ <p className="font-semibold text-[#2B1F14] mb-1">Version</p>+ <p className="text-[#6B5D52]">0.1.0</p>+ </div>+ <div className="text-center p-4 border border-[#DDD4C7] rounded-lg bg-gradient-to-b from-[#FFFFFF] to-[#F9F6F1]">+ <div className="text-[#C0A77D] text-xl mb-2">β </div>+ <p className="font-semibold text-[#2B1F14] mb-1">Status</p>+ <p className="status-active">Active</p>+ </div>+ </div>+ </CardContent>+ </Card>++ {/* Footer */}+ <div className="text-center py-8">+ <p className="text-[#6B5D52] text-sm brand-script italic">+ "In every word lies a story waiting to be inscribed"</p>- <div className="space-y-2 text-sm">- <p><strong>Default Hotkey:</strong> ` (backtick)</p>- <p><strong>Version:</strong> 0.1.0</p>- <p><strong>Status:</strong> <span className="text-green-600">Active</span></p>- </div>- </CardContent>- </Card>+ </div>+ </div></div>);}\ No newline at end of filediff --git a/src/index.css b/src/index.cssindex fbe6966d7..93eb3f2d9 100644--- a/src/index.css+++ b/src/index.css@@ -1,48 +1,53 @@@import "tailwindcss";+@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Italiana&display=swap');@theme {- --color-primary: oklch(0.205 0 0);- --color-primary-foreground: oklch(0.985 0 0);- --color-secondary: oklch(0.97 0 0);- --color-secondary-foreground: oklch(0.205 0 0);- --color-muted: oklch(0.97 0 0);- --color-muted-foreground: oklch(0.556 0 0);- --color-accent: oklch(0.97 0 0);- --color-accent-foreground: oklch(0.205 0 0);- --color-destructive: oklch(0.577 0.245 27.325);- --color-border: oklch(0.922 0 0);- --color-input: oklch(0.922 0 0);- --color-ring: oklch(0.708 0 0);- --color-background: oklch(1 0 0);- --color-foreground: oklch(0.145 0 0);- --color-card: oklch(1 0 0);- --color-card-foreground: oklch(0.145 0 0);- --color-popover: oklch(1 0 0);- --color-popover-foreground: oklch(0.145 0 0);- --radius: 0.625rem;+ /* OpenScribe Brand Theme - Parchment & Ink */+ --color-primary: #4B2E2B;+ --color-primary-foreground: #F5F0E6;+ --color-secondary: #F5F0E6;+ --color-secondary-foreground: #2B1F14;+ --color-muted: #EDE7DC;+ --color-muted-foreground: #6B5D52;+ --color-accent: #C0A77D;+ --color-accent-foreground: #2B1F14;+ --color-destructive: #874F3E;+ --color-destructive-foreground: #F5F0E6;+ --color-border: #DDD4C7;+ --color-input: #F9F6F1;+ --color-ring: #C0A77D;+ --color-background: #F5F0E6;+ --color-foreground: #2B1F14;+ --color-card: #FFFFFF;+ --color-card-foreground: #2B1F14;+ --color-popover: #FFFFFF;+ --color-popover-foreground: #2B1F14;+ --color-link: #2E3659;+ --radius: 0.5rem;}@custom-variant dark (&:is(.dark *));@variant dark {- --color-background: oklch(0.145 0 0);- --color-foreground: oklch(0.985 0 0);- --color-card: oklch(0.205 0 0);- --color-card-foreground: oklch(0.985 0 0);- --color-popover: oklch(0.205 0 0);- --color-popover-foreground: oklch(0.985 0 0);- --color-primary: oklch(0.922 0 0);- --color-primary-foreground: oklch(0.205 0 0);- --color-secondary: oklch(0.269 0 0);- --color-secondary-foreground: oklch(0.985 0 0);- --color-muted: oklch(0.269 0 0);- --color-muted-foreground: oklch(0.708 0 0);- --color-accent: oklch(0.269 0 0);+ /* Dark mode - sophisticated and rich */+ --color-background: oklch(0.08 0 0);+ --color-foreground: oklch(0.95 0 0);+ --color-card: oklch(0.12 0 0);+ --color-card-foreground: oklch(0.95 0 0);+ --color-popover: oklch(0.12 0 0);+ --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.704 0.191 22.216);- --color-border: oklch(1 0 0 / 10%);- --color-input: oklch(1 0 0 / 15%);- --color-ring: oklch(0.556 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);}@layer base {@@ -51,10 +56,12 @@}body {- @apply bg-background text-foreground font-sans;+ @apply bg-background text-foreground;margin: 0;padding: 0;- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;+ font-family: 'Lora', 'Libre Baskerville', Georgia, serif;+ font-feature-settings: "liga" 1, "kern" 1;+ text-rendering: optimizeLegibility;}/* Electron specific styles */@@ -63,16 +70,56 @@}}-/* Custom glass effect for the main app window */+/* OpenScribe Brand Typography */+.brand-heading {+ font-family: 'Cormorant Garamond', 'Crimson Pro', serif;+ font-weight: 600;+ letter-spacing: -0.02em;+}++.brand-body {+ font-family: 'Lora', 'Libre Baskerville', Georgia, serif;+ line-height: 1.6;+}++.brand-script {+ font-family: 'Italiana', cursive;+ font-style: italic;+}++/* Elegant parchment-inspired glass effect */.glass-effect {- backdrop-filter: blur(20px);- background: rgba(255, 255, 255, 0.1);- border: 1px solid rgba(255, 255, 255, 0.2);+ backdrop-filter: blur(20px) saturate(1.1);+ box-shadow: 0 8px 32px rgba(43, 31, 20, 0.08),+ 0 1px 0 rgba(255, 255, 255, 0.2) inset;+}++/* Light mode glass effect */+:root .glass-effect {+ background: rgba(255, 255, 255, 0.85);+ border: 1px solid rgba(43, 31, 20, 0.1);+ box-shadow: 0 8px 32px rgba(43, 31, 20, 0.05),+ 0 1px 0 rgba(255, 255, 255, 0.5) inset;+}++/* Dark mode glass effect */+.dark .glass-effect {+ background: rgba(15, 15, 25, 0.85);+ border: 1px solid rgba(100, 150, 255, 0.2);+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),+ 0 0 0 1px rgba(100, 150, 255, 0.1) inset;+}++h1, h2, h3, h4, h5, h6 {+ font-family: 'Cormorant Garamond', 'Crimson Pro', serif;+ font-weight: 600;+ letter-spacing: -0.02em;+ line-height: 1.2;}h1 {- font-size: 3.2em;- line-height: 1.1;+ font-size: 2.5rem;+ font-weight: 700;}button {@@ -81,30 +128,176 @@ button {padding: 0.6em 1.2em;font-size: 1em;font-weight: 500;- font-family: inherit;- background-color: #1a1a1a;+ font-family: 'Lora', Georgia, serif;cursor: pointer;- transition: border-color 0.25s;+ transition: all 0.2s ease;+ box-shadow: 0 2px 4px rgba(43, 31, 20, 0.1);+}++/* OpenScribe Brand Button Styling */+:root button {+ background-color: #FFFFFF;+ color: #2B1F14;+ border-color: #DDD4C7;+}++:root button:hover {+ border-color: #C0A77D;+ background-color: #F9F6F1;+ box-shadow: 0 4px 8px rgba(43, 31, 20, 0.1);+ transform: translateY(-1px);+}++/* Primary CTA buttons - Deep oxblood with bronze hover */+button[class*="bg-primary"] {+ background-color: #4B2E2B;+ color: #F5F0E6;+ border-color: #4B2E2B;+ font-weight: 600;+}++button[class*="bg-primary"]:hover {+ background-color: #C0A77D;+ color: #2B1F14;+ border-color: #C0A77D;+ box-shadow: 0 6px 12px rgba(75, 46, 43, 0.2);+}++/* Secondary buttons - Parchment with ink accents */+:root button[class*="variant-secondary"] {+ background-color: #F5F0E6;+ border-color: #C0A77D;+ color: #2B1F14;+}++:root button[class*="variant-secondary"]:hover {+ background-color: #EDE7DC;+ border-color: #4B2E2B;+ color: #4B2E2B;+}++/* Outline buttons */+:root button[class*="variant-outline"] {+ background-color: transparent;+ border-color: #C0A77D;+ color: #4B2E2B;+}++:root button[class*="variant-outline"]:hover {+ background-color: #F9F6F1;+ border-color: #4B2E2B;+ color: #2B1F14;+}++/* Destructive buttons - Dried blood red */+button[class*="variant-destructive"] {+ background-color: #874F3E;+ color: #F5F0E6;+ border-color: #874F3E;+}++button[class*="variant-destructive"]:hover {+ background-color: #6B3D32;+ border-color: #6B3D32;}-button:hover {- border-color: #646cff;++/* Dark mode button styling */+.dark button {+ background-color: oklch(0.12 0 0);+ color: oklch(0.9 0 0);+ border-color: oklch(0.22 0 0);+}++.dark button:hover {+ border-color: oklch(0.55 0.25 250);+ background-color: oklch(0.15 0 0);}+button:focus,button:focus-visible {- outline: 4px auto -webkit-focus-ring-color;+ outline: 2px solid #C0A77D;+ outline-offset: 2px;}-@media (prefers-color-scheme: light) {- :root {- color: #213547;- background-color: #ffffff;- }- a:hover {- color: #747bff;- }- button {- background-color: #f9f9f9;- }+/* Embossed paper-like input styling */+input, textarea {+ border-radius: 8px;+ transition: all 0.2s ease;+ font-family: 'Lora', Georgia, serif;+ box-shadow: inset 0 1px 3px rgba(43, 31, 20, 0.1);+}++/* Light mode inputs - embossed parchment */+:root input, :root textarea {+ background-color: #F9F6F1;+ border: 1px solid #DDD4C7;+ color: #2B1F14;+}++:root input:focus, :root textarea:focus {+ border-color: #C0A77D;+ 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;+}++/* Dark mode inputs */+.dark input, .dark textarea {+ background-color: oklch(0.15 0 0);+ border: 1px solid oklch(0.25 0 0);+ color: oklch(0.9 0 0);+}++.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);+}++/* Card styling - elevated parchment */+.card {+ background-color: #FFFFFF;+ border: 1px solid #DDD4C7;+ border-radius: 12px;+ box-shadow: 0 4px 8px rgba(43, 31, 20, 0.08), 0 1px 0 rgba(255, 255, 255, 0.5) 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;+ transform: translateY(-1px);+}++/* Link styling */+a {+ color: #2E3659;+ text-decoration: none;+ transition: color 0.2s ease;+}++a:hover {+ color: #4B2E2B;+ text-decoration: underline;+}++/* Status indicators */+.status-active {+ color: #4B2E2B;+ font-weight: 600;+}++.text-brand-primary {+ color: #2B1F14;+}++.text-brand-accent {+ color: #4B2E2B;+}++.text-brand-highlight {+ color: #C0A77D;+}++.text-brand-link {+ color: #2E3659;}@theme inline {