Skip to content

feat: model management improvements and folder migration#268

Merged
jamiepine merged 1 commit intomainfrom
feat/model-management-improvements
Mar 13, 2026
Merged

feat: model management improvements and folder migration#268
jamiepine merged 1 commit intomainfrom
feat/model-management-improvements

Conversation

@jamiepine
Copy link
Owner

@jamiepine jamiepine commented Mar 13, 2026

Summary

  • Model folder migration: users can change the models storage directory with a full-screen migration overlay showing byte-level progress. Backend handles same-filesystem renames and cross-filesystem copies with progress tracking via SSE.
  • Custom models directory passed to the Python sidecar via VOICEBOX_MODELS_DIR env var, persisted in serverStore.
  • Hardcoded model descriptions for all supported models, displayed above HF badges in the detail card.
  • "Open Folder" button next to the storage location Change button (uses @tauri-apps/plugin-shell open).
  • Removed the "Not downloaded" badge from model cards.
  • Fixed server settings scroll not accounting for the audio player.
  • Fixed Tauri shell open permission (".*" regex instead of true) to allow opening file paths.
  • Added normalize toggle to generation settings.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added audio normalization option in generation settings to control output volume.
    • Introduced model storage management with ability to customize models directory and migrate existing models to a new location with progress tracking.
  • Improvements

    • Refined UI layout spacing in channel list and models sections.
    • Enhanced server startup to support custom model directories.
    • Improved server status polling efficiency.
  • Documentation

    • Added issue pain points analysis and updated project roadmap with new model candidates.

- Add model folder migration with byte-level progress tracking (backend + UI)
- Custom models directory support via VOICEBOX_MODELS_DIR env var passed to sidecar
- Hardcoded model descriptions displayed in model detail cards
- Open model folder button in storage location row
- Remove 'not downloaded' badge from model cards
- Fix server settings scroll offset for audio player
- Fix shell open permission to allow file paths
- Add normalize toggle to generation settings
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 18bae60a-63c3-4f7e-bd73-8cadcc8bcde2

📥 Commits

Reviewing files that changed from the base of the PR and between 325714b and 3ea5877.

⛔ Files ignored due to path filters (3)
  • bun.lock is excluded by !**/*.lock
  • tauri/src-tauri/gen/Assets.car is excluded by !**/gen/**
  • tauri/src-tauri/gen/voicebox.icns is excluded by !**/gen/**
📒 Files selected for processing (20)
  • app/src/App.tsx
  • app/src/components/AudioTab/AudioTab.tsx
  • app/src/components/ModelsTab/ModelsTab.tsx
  • app/src/components/ServerSettings/GenerationSettings.tsx
  • app/src/components/ServerSettings/ModelManagement.tsx
  • app/src/components/ServerTab/ServerTab.tsx
  • app/src/lib/api/client.ts
  • app/src/lib/api/types.ts
  • app/src/lib/hooks/useGenerationForm.ts
  • app/src/lib/hooks/useRestoreActiveTasks.tsx
  • app/src/platform/types.ts
  • app/src/stores/serverStore.ts
  • backend/main.py
  • backend/models.py
  • docs/issue-pain-points.md
  • docs/plans/PROJECT_STATUS.md
  • tauri/src-tauri/src/main.rs
  • tauri/src-tauri/tauri.conf.json
  • tauri/src/platform/lifecycle.ts
  • web/src/platform/lifecycle.ts

📝 Walkthrough

Walkthrough

This PR introduces audio normalization functionality across the generation pipeline, adds model cache directory management with migration capabilities including progress tracking via SSE endpoints, and updates the platform lifecycle to accept an optional modelsDir parameter throughout the frontend and backend stack.

Changes

Cohort / File(s) Summary
Audio Normalization
app/src/components/ServerSettings/GenerationSettings.tsx, app/src/lib/api/types.ts, app/src/lib/hooks/useGenerationForm.ts, backend/models.py
Added normalize boolean field to GenerationRequest, UI checkbox in GenerationSettings, and wired normalization flag through generation mutation payload.
Model Cache & Migration
app/src/components/ServerSettings/ModelManagement.tsx, app/src/lib/api/client.ts, backend/main.py
Introduced model cache directory retrieval and migration endpoints (/models/cache-dir, /models/migrate, /models/migrate/progress) with SSE-based progress tracking; added UI for directory selection, migration confirmation, and progress overlay; integrated backend directory copying and size calculation utilities.
Platform Lifecycle Updates
app/src/platform/types.ts, tauri/src/platform/lifecycle.ts, web/src/platform/lifecycle.ts, tauri/src-tauri/src/main.rs
Extended startServer and restartServer signatures to accept optional modelsDir parameter; propagated through Tauri/Web implementations and native Tauri handlers to set VOICEBOX_MODELS_DIR environment variable.
Server State Management
app/src/stores/serverStore.ts
Added normalizeAudio and customModelsDir persisted state properties with setter functions.
Layout & UI Adjustments
app/src/components/AudioTab/AudioTab.tsx, app/src/components/ModelsTab/ModelsTab.tsx, app/src/components/ServerTab/ServerTab.tsx
Removed padding from channel list container and ModelsTab root; added conditional bottom safe area padding in ServerTab based on player visibility; reformatted ternary expressions for readability.
App & API Integration
app/src/App.tsx
Updated server startup to pass customModelsDir from store as second argument to startServer.
Configuration
tauri/src-tauri/tauri.conf.json
Changed shell.open plugin setting from boolean true to regex pattern string ".*".
Polling Optimization
app/src/lib/hooks/useRestoreActiveTasks.tsx
Increased server polling interval from 2000ms to 30000ms.
Documentation
docs/issue-pain-points.md, docs/plans/PROJECT_STATUS.md
Added pain points snapshot documentation and updated project status with new model candidates (HumeAI TADA, MOSS-TTS, VoxCPM, Pocket TTS, Kokoro-82M) and expanded engine integration procedures.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant React as Client (React)
    participant API as API Client
    participant Server as Backend Server
    participant Platform as Tauri Platform

    User->>React: Click "Change" models directory
    React->>React: Show confirmation dialog
    User->>React: Confirm migration
    React->>API: migrateModels(destination)
    API->>Server: POST /models/migrate {destination}
    Server->>Server: Create progress tracker<br/>Start background migration
    Server-->>API: {source, destination}
    
    React->>Server: Subscribe to SSE /models/migrate/progress
    Server->>React: Stream progress updates<br/>(copied_bytes, filename)
    Note over React: Display progress bar<br/>& file details
    
    Server->>Server: Finish migration
    Server->>React: Final progress event
    
    React->>API: restartServer(customModelsDir)
    API->>Platform: Invoke restart_server
    Platform->>Server: Set VOICEBOX_MODELS_DIR env var<br/>Restart backend
    Server-->>Platform: Server ready
    Platform-->>API: Restart complete
    
    React->>React: Invalidate queries
    React->>User: Show success message
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Poem

🐰 hops excitedly
Audio whispers, normalized and bright,
Models waltz to their new home with delight,
Directories migrate with progress in tow,
Each file finds its place, watch the bar glow! 📊✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/model-management-improvements
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jamiepine jamiepine marked this pull request as ready for review March 13, 2026 16:12
@jamiepine jamiepine merged commit 5228536 into main Mar 13, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant