-
Notifications
You must be signed in to change notification settings - Fork 0
feat: v0.4.1 - Premium Settings Panel with Smart Restart #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**New Features:** - Complete settings UI with glassmorphic design - Edit config.toml visually (no manual file editing needed) - Live config loading and saving **Settings Sections:** 1. **Model Configuration** - Model selector dropdown (tiny, base, small, large-v3-turbo) - Language input (e.g., 'en') - Model path editor - Technical vocabulary prompt (optional textarea) 2. **Audio Configuration** - Recording timeout slider (10-300 seconds with live preview) - Save audio clips toggle (animated glassmorphic toggle) - Audio clips path editor (conditional, only shows if enabled) 3. **Output Configuration** - Append space toggle - Refresh command editor (for Waybar/Polybar integration) **UX Features:** - Save button with states: Save → Saving (spinner) → Saved! (green checkmark) - Reset button to reload from disk - Smooth animations on all interactions - Input validation and error handling - Glassmorphic inputs with focus states **Backend:** - Added get_config() Tauri command - Added save_config() Tauri command - Reads/writes ~/.config/hyprvoice/config.toml - Type-safe config structures **Styling:** - New .glass-input utility class - Focus states with cyan glow - Disabled states - Custom select and textarea styling Settings changes hot-reload in the Tauri window!
**Smart Restart System:** **Banner Component (RestartBanner.tsx):** - Animated slide-down notification - Context-aware states: - ⚡ Needs restart (cyan) - Shows after saving -⚠️ Recording warning (yellow) - If trying to restart while recording - ✓ Success (green) - Daemon restarted successfully - ✗ Error (red) - Restart failed with retry button - Auto-dismisses success after 3 seconds - Manual dismiss with X button **Restart Flow:** 1. User saves settings → Banner appears: 'Restart needed' 2. User clicks 'Apply Changes' → Button shows spinner 3. Backend: - Sends Shutdown to daemon - Waits up to 3s for graceful shutdown - Spawns new daemon process - Waits up to 5s for startup - Verifies daemon is responsive 4. Success → Green banner: '✓ Daemon restarted!' (auto-dismiss 3s) 5. Error → Red banner with 'Retry' button **Safety Features:** - ✅ Checks if recording before restart - ✅ Shows warning if recording active - ✅ Graceful daemon shutdown (not force-kill) - ✅ Verifies new daemon started successfully - ✅ Error handling with retry option **Backend (restart_daemon command):** - Auto-detects daemon binary (hyprvoice-test > hyprvoice-cuda > hyprvoice) - Detached process (daemon runs independently) - Timeout handling - Detailed error messages **UX Details:** - Smooth animations (slide, fade) - Colored borders (cyan/yellow/green/red) - Spinning refresh icon while restarting - Clear messaging at each step - Matches Raycast/VS Code restart patterns Premium, professional experience that prevents user errors!
**Cross-Platform File Selection:** - Added @tauri-apps/plugin-dialog (works on Linux, macOS, Windows) - Native OS file picker dialogs **New Browse Buttons:** - 📁 Model Path - File picker for model selection - 📁 Audio Clips Path - Folder picker for recordings directory - Glassmorphic folder icon buttons - Opens native file dialog **UX Improvements:** - No more typing paths manually - Native OS dialogs (file explorer on Linux, Finder on macOS) - Auto-populates with current path as default - Validates selection automatically - Updates input field when folder selected **Technical:** - tauri-plugin-dialog handles platform differences - Single API works everywhere - Respects OS native UI/UX patterns Premium experience - users never have to type file paths!
- Set select background to dark (#0a0a0a) - Style option elements with dark background (#1a1a1a) - White text on dark background (readable) - Hover state for options (#2a2a2a) Fixes white-on-white text issue in model selector dropdown
- Use !important to override browser defaults - Darker select background (#0a0a0a) - White text explicitly set - Cyan highlight for selected option - Ensures readability across all browsers/themes
- Remove browser default appearance - Add custom cyan dropdown arrow (SVG) - Force very dark background - Force white text - Proper padding for custom arrow Fixes light gray on light gray issue in select element
Add console.log and try/catch to debug folder picker Will help identify why dialog isn't opening
Added permissions for dialog plugin: - dialog:allow-open - Allow file/folder dialogs - dialog:default - Default dialog permissions - shell:allow-execute - For daemon restart Fixes 'dialog.open not allowed' permission error
**PathInput Component:**
- Reusable validated path input
- Works for both files and directories
- Real-time validation with visual feedback
**Validation Features:**
- ✅ Checks if path exists (500ms debounce)
- ✅ Verifies type matches (file vs directory)
- ✅ Expands ~ to home directory
- ✅ Shows validation icon:
- 🔄 Spinner while checking
- ✓ Green check if valid
- ✗ Red X if doesn't exist
- ⚠ Yellow warning if wrong type
- ✅ Helper text below input
- ✅ Border color changes (green/red/cyan)
**Icon Indicators:**
- File picker: 📄 FileText icon
- Folder picker: 📁 FolderOpen icon
- Validation: Animated spinner → Check/X/Warning
**UX Details:**
- Debounced validation (doesn't spam while typing)
- Spinner rotates smoothly
- Color-coded feedback (green = good, red = bad, yellow = warning)
- Helpful messages ('File exists', 'Path does not exist', etc.)
- Type checking ('Expected directory, found file')
**Replaces:**
- Raw model path input → PathInput with file validation
- Raw audio clips path input → PathInput with directory validation
Premium, foolproof UX that prevents invalid paths!
Model paths can be: - Directory (e.g., whisper-large-v3-turbo-safetensors/) - OR file (e.g., model.gguf) Changed model path validation from type='file' to type='any' to accept both. Validation now shows green checkmark for existing paths regardless of type.
Fixed getValidationMessage() to properly handle type='any' Now shows green 'Directory exists' instead of yellow warning
**Problem:** - User running hyprvoice-gpu - Restart always started hyprvoice-test (hardcoded priority) - Wrong daemon started after restart! **Solution:** - Added detect_running_binary() function - Parses 'ps aux' to find actual running process - Extracts the binary path from process list - Restarts the SAME binary that was running **Detection Logic:** 1. Run ps aux 2. Find line with 'hyprvoice' and 'daemon' 3. Extract path (e.g., /home/user/.local/bin/hyprvoice-gpu) 4. Use that exact path to restart **Fallback:** If detection fails, tries in order: - hyprvoice-gpu - hyprvoice-cuda - hyprvoice-test - hyprvoice **Result:** - hyprvoice-gpu → restarts hyprvoice-gpu ✅ - hyprvoice-cuda → restarts hyprvoice-cuda ✅ - Maintains user's daemon choice Debug output: Logs detected binary to stderr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Complete settings panel with path validation, native file pickers, and smart daemon restart.
Features
Settings Panel ⚙️
Premium Path Validation ✅
Native File/Folder Pickers 📁
Smart Daemon Restart 🔄
Dropdown Fixes 🎨
Technical
Testing
Premium UX throughout! 🚀