feat: .voicebox bundle — portable voice profile export with full metadata - #938
feat: .voicebox bundle — portable voice profile export with full metadata#938andreolf wants to merge 1 commit into
Conversation
Upgrades the export/import format from a minimal ZIP (name, description, language only) to a richer .voicebox bundle (a ZIP under the hood) that carries ALL profile metadata so cloned voices can be moved between machines or shared with other users without losing any configuration. Backend — backend/services/export_import.py: - Bump manifest to version "1.1" - Export now includes voice_type, preset_engine, preset_voice_id, design_prompt, default_engine, personality, and effects_chain - Import reads all new fields; version "1.0" bundles still import cleanly (missing fields default to None for backward compat) - After profile creation the effects_chain is written back directly because VoiceProfileCreate does not expose that field Route — backend/routes/profiles.py: - Change download filename from .voicebox.zip to .voicebox - Change Content-Type to application/octet-stream so browsers don't try to treat the file as a generic ZIP Frontend: - useExportProfile: saves as .voicebox, filter label "Voicebox Profile" with extension 'voicebox' - MainEditor file input: accept=".voicebox,.voicebox.zip" and the validation guard accepts both extensions for backward compat with bundles exported by older versions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughVoice profile exports now use ChangesVoice profile archive flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MainEditor
participant ProfilesRoute
participant ExportImportService
participant Database
MainEditor->>ProfilesRoute: request profile export
ProfilesRoute->>ExportImportService: generate voice profile archive
ExportImportService->>Database: read profile fields and effects_chain
Database-->>ExportImportService: profile data
ExportImportService-->>ProfilesRoute: manifest version 1.1 archive
ProfilesRoute-->>MainEditor: .voicebox download response
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Hell yeah I love this |
Problem
Voicebox's export has always been crippled compared to cloud TTS tools: the downloaded archive only contained
name,description, andlanguage. Every other piece of configuration —voice_type,preset_engine,preset_voice_id,design_prompt,default_engine,personality, and theeffects_chain— was silently discarded on export and lost on import. Practically speaking this made voice-profile portability useless: cloned voices could not be moved to a new machine, shared with teammates, or restored from a backup without manually re-entering all settings.Solution
Introduces the
.voiceboxbundle format (a ZIP archive under the hood, renamed to signal intent). The manifest is bumped to version1.1and now serialises the full profile metadata.Changes
backend/services/export_import.pyexport_profile_to_zip()writes manifest v1.1, addingvoice_type,preset_engine,preset_voice_id,design_prompt,default_engine,personality, andeffects_chain(deserialized from JSON before embedding).import_profile_from_zip()reads every new field and passes them intoVoiceProfileCreate; after the profile is created,effects_chainis written back directly (it is not exposed byVoiceProfileCreate) with a db commit + refresh."1.0"bundles still import cleanly — missing fields default toNone.backend/routes/profiles.pyprofile-<name>.voicebox.zip→profile-<name>.voicebox.Content-Typechanged fromapplication/zip→application/octet-streamso browsers don't handle the file as a generic ZIP.app/src/lib/hooks/useProfiles.tsuseExportProfilesaves with the.voiceboxextension and uses the'Voicebox Profile / voicebox'file filter in the native save dialog.app/src/components/MainEditor/MainEditor.tsxacceptattribute updated to.voicebox,.voicebox.zip(backward compat with bundles exported by older versions).Backward compatibility
1.0(old.voicebox.zip)None1.1(new.voicebox)Test plan
profile-<name>.voicebox.voiceboxfile on a fresh install → all fields restored: name, description, language, voice_type, personality, effects_chainpreset_engineandpreset_voice_idround-trip correctly.voicebox.zipbundle → still works, no crash, missing fields default gracefullyeffects_chain: nullin manifest, no error on import🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
.voiceboxfiles..voiceboxformat.Bug Fixes
.voiceboxand.voicebox.zipfiles.