feat(frontend): use Wails bindings for file I/O

Replace hidden file inputs and anchor downloads with native open/save
dialogs via a thin platform layer. WAV export sends base64 audio data to
the Go backend for writing to the user-chosen path.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-29 22:23:35 -07:00
parent 3a5d9d849f
commit 45075b3328
8 changed files with 120 additions and 42 deletions
+7 -1
View File
@@ -1,6 +1,7 @@
package main
import (
"encoding/base64"
"net/http"
"os"
"path/filepath"
@@ -102,11 +103,16 @@ func (s *FileService) SaveProject(content string, defaultName string) error {
return os.WriteFile(path, []byte(content), 0o644)
}
func (s *FileService) SaveAudio(data []byte, defaultName string) error {
func (s *FileService) SaveAudio(dataBase64 string, defaultName string) error {
if defaultName == "" {
defaultName = "keyboard_track.wav"
}
data, err := base64.StdEncoding.DecodeString(dataBase64)
if err != nil {
return err
}
path, err := s.app.Dialog.SaveFile().
SetMessage("Export Audio").
SetFilename(defaultName).