feat(17-02): implement save flow, cover art editing, and error handling
- Wire saveEdit() to WriteTrackTagsByPath with diff-only TagChanges map - Add cover art selection via ImageFilePicker with instant blob preview - Add cover art removal (× button) with clearCoverArt state - Show saving indicator and disable buttons during save - Display errors inline in action bar; edit mode stays active on error - Add ReadFile Go method on FrontendUtil to read cover art bytes - Add Wails binding for ReadFile - Clean up all edit state (editValues, pendingCoverArt, errorMessage) on close/cancel
This commit is contained in:
@@ -4,6 +4,7 @@ package frontendutil
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
)
|
||||
@@ -90,3 +91,15 @@ func (fe *FrontendUtil) ImageFilePicker() (string, error) {
|
||||
|
||||
return file, nil
|
||||
}
|
||||
|
||||
// ReadFile reads a file from disk and returns its contents.
|
||||
// Used by the frontend to read cover art image files selected
|
||||
// via ImageFilePicker.
|
||||
func (fe *FrontendUtil) ReadFile(path string) ([]byte, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("read file %q: %w", path, err)
|
||||
}
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user