Branch: bound-surface → main
PR 8b of the review fixes plan (docs/review-fixes-plan.md), part of the 0.5.3 series; the version does not change in this PR.
The window can no longer reach the Go-only methods (S4, rest).
LoadPath and AssignSamplePath with //wails:ignore. That only keeps them out of the generated bindings. Wails 3.1.0 binds every exported method of a bound type by reflection, so any script in the window could still call them by name with any path.main, a scratch build confirmed it; see Testing.Service, the type main.go binds, now has only the 21 methods the frontend calls. None takes a file path.Host: LoadPath, AssignSamplePath, Dirty, SetCloser and AudioMiddleware. Host shares the Service's state, and NewService returns both.Service.Load and AssignSampleDialog call unexported helpers (loadPath, assignSample) that Host uses too.//wails:ignore: nothing on Service needs it now.main.go uses Host for the close hook, the file-drop handler and the audio middleware, and binds only Service.Declining "Replace existing files?" forgets the target.
ExportFolder(true) would have overwritten it without asking.CancelExport() forgets both targets. exportWith in store.svelte.ts calls it when the user declines.Tests.
TestBoundMethods lists *Service's exported methods by reflection and compares them with an explicit list. If they differ, the message explains:
Host;With LoadPath(string) temporarily added back to Service, it fails as intended.
TestCancelExport: after CancelExport, ExportFolder(true) and ExportZip(true) fail with "choose where to export first" and write nothing.hostOf(s).frontend/src/main.ts and not committed; the file is back to its committed state:
Call.ByName("git.monoexp.com/bajdev/mpckit/internal/app.Service.LoadPath", <path>), and in the fixed build also AssignSamplePath.CloseWindow:| Build | Probe | Result |
| --- | --- | --- |
| main before this PR | LoadPath | Closed after 4 s: the call succeeded and Go loaded the file. |
| main before this PR | control: a method that does not exist | Closed after 10 s: rejected as unknown. |
| This branch | LoadPath and AssignSamplePath | Closed after 10 s, twice: both rejected with "unknown bound method name". |
CloseWindow stays bound, because the frontend needs it after "Close without exporting?". It takes no arguments and only closes the window.On the server, every command with GOTOOLCHAIN=go1.27.4:
go test ./... passes, including TestBoundMethods and TestCancelExport.go vet ./... (also with GOOS=windows) and staticcheck ./... are clean.govulncheck ./...: "No vulnerabilities found."frontend: npm ci, npm run check (0 errors, 0 warnings) and npm run build.wails3 build builds, and the app starts under Xvfb.On the laptop (PowerShell, in the repo):
git fetch; git checkout bound-surfacego test ./internal/app: ok.wails3 dev, then:
testdata\device\DemoFile.xpj. It opens as before.wails3 dev again, assign a WAV, and export: