mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-26 13:45:16 -07:00
Update dependencies and enhance UI components for better functionality
- Added new Tauri plugins: @tauri-apps/plugin-process and @tauri-apps/plugin-updater to improve application capabilities. - Introduced UpdateStatus component to display update information in the UI. - Enhanced GenerationForm to include an optional instruct field for additional input. - Refactored various components for improved styling and responsiveness, including Sidebar, AudioPlayer, and ProfileCard. - Updated API models and schemas to accommodate new instruct parameter in generation requests and responses. - Improved documentation for autoupdater setup and usage.
This commit is contained in:
+17
-36
@@ -148,47 +148,28 @@ Add your private key to GitHub secrets:
|
||||
- Add `TAURI_SIGNING_PRIVATE_KEY` with the content of `~/.tauri/voicebox.key`
|
||||
- Add `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` (empty string if no password)
|
||||
|
||||
## 5. Implementing Update Check in Frontend
|
||||
## 5. Frontend Integration (Already Completed)
|
||||
|
||||
Add the updater package:
|
||||
The frontend integration is already complete in this project with the following components:
|
||||
|
||||
```bash
|
||||
bun add @tauri-apps/plugin-updater
|
||||
```
|
||||
### Automatic Update Notifications
|
||||
- `app/src/components/UpdateNotification.tsx` - Shows a banner when updates are available
|
||||
- Automatically checks for updates on app startup
|
||||
- Displays download/install progress
|
||||
- Only shows in Tauri desktop builds
|
||||
|
||||
Example implementation:
|
||||
### Manual Update Check
|
||||
- `app/src/components/ServerSettings/UpdateStatus.tsx` - Settings panel for updates
|
||||
- Allows manual update checks via "Check for Updates" button
|
||||
- Shows current version and update status
|
||||
- Located in the Settings tab (only visible in Tauri builds)
|
||||
|
||||
```typescript
|
||||
import { check } from '@tauri-apps/plugin-updater';
|
||||
import { relaunch } from '@tauri-apps/plugin-process';
|
||||
### Update Hook
|
||||
- `app/src/hooks/useAutoUpdater.ts` - React hook for update functionality
|
||||
- Handles update checking, downloading, and installation
|
||||
- Includes Tauri context detection (won't run in web builds)
|
||||
|
||||
async function checkForUpdates() {
|
||||
try {
|
||||
const update = await check();
|
||||
|
||||
if (update?.available) {
|
||||
console.log(`Update available: ${update.version}`);
|
||||
|
||||
// Show UI to user
|
||||
const shouldUpdate = confirm(
|
||||
`Version ${update.version} is available. Install now?`
|
||||
);
|
||||
|
||||
if (shouldUpdate) {
|
||||
await update.downloadAndInstall();
|
||||
await relaunch();
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Update check failed:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Check on app startup
|
||||
checkForUpdates();
|
||||
|
||||
// Or add a manual check button
|
||||
```
|
||||
The components are already integrated into the main App layout.
|
||||
|
||||
## Security Notes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user