3.4 KiB
3.4 KiB
Implementation Plan: Project Management, Save As, and File Management inside Profile
We will add robust cloud/local project management, a custom "Save Project" name modal, a "Save As..." dialog offering server/local options, and a comprehensive file and project manager inside the User Profile Modal.
User Review Required
Important
The profile modal will now contain three tabs: Account, Cloud Projects, and My Uploaded Files. Unused files (those not in the current session tracks or any saved projects) can be deleted by the user to free up quota storage.
Save As... will trigger a modal allowing the user to type a new name and save it to either the server or export locally as a
.sfsfile.
Proposed Changes
Backend APIs
[MODIFY] projects.py
GET /cloud/{project_id}: Retrieves a specific user cloud project.DELETE /cloud/{project_id}: Deletes a specific user cloud project.PUT /cloud/{project_id}: Updates/overwrites an existing user cloud project.
[MODIFY] audio.py
POST /upload,run_python_dsp_tool(for synth), andai_cut_audio: Prefix file IDs withuser_{user_id}_to establish file ownership and quota tracking securely.POST /my-files: Lists all files starting withuser_{user_id}_on the server disk. Identifies if they are referenced in the active project session or any database project records to compute theiris_in_usestatus.DELETE /my-files/{file_id}: Deletes a user's uploaded/generated file from the server uploads and processed directories after verifying ownership.
Frontend Services & UI
[MODIFY] api.js
- Expose APIs for fetching, deleting, and updating cloud projects.
- Expose APIs for listing and deleting user audio files.
[MODIFY] app.jsx
- State Additions:
currentProjectId: Tracks the ID of the loaded cloud project (synced with localStorage).saveProjectModalOpen,saveAsModalOpen: Controls the new custom modals.
- Save Project Modal:
- Modal with an input for project name, used when saving a project that doesn't have a name yet.
- Save As Modal:
- Allows choosing to save under a new name either locally (.sfs file) or on the server.
- Profile Modal Extensions:
- Add Tabs: Account Settings, Cloud Projects, My Uploaded Files.
- Cloud Projects Tab: Displays saved projects with load (open DAW project) and delete options.
- My Uploaded Files Tab: Displays files with sizes, creation dates, usage badges, individual delete buttons, and a global "Clean Up Unused Files" button.
Verification Plan
Automated Tests
- Run backend lint and sanity checks.
python -m flake8 app/api/v1/projects.py app/api/v1/audio.py
Manual Verification
- Create a new project, press Save, verify the custom input modal appears.
- Upload some files, check the Profile -> My Uploaded Files tab. Verify the files are listed as "In Use".
- Remove a track containing a file, verify the file changes to "Not In Use". Press delete to free up quota.
- Click File -> Save As... and select either Cloud or Local .sfs and verify name updates and downloads.