From 5fcb3a270673d3905894c8dc8e7dd9bbafee2c50 Mon Sep 17 00:00:00 2001 From: Snider <631881+Snider@users.noreply.github.com> Date: Mon, 2 Feb 2026 03:04:11 +0000 Subject: [PATCH] Refactor waitForWasm to use event listener and fix CI Replaces the busy-wait polling loop in `waitForWasm` with a `borgstmf:ready` event listener. This eliminates unnecessary CPU usage during initialization and potentially improves latency. Also updates the `stmf.wasm` binary to ensure it contains the event dispatch logic present in `pkg/wasm/stmf/main.go`. Fixes a CI build failure by changing `pkg/player/assets.go` to use directory embedding (`//go:embed frontend`) instead of explicit file embedding, which avoids errors when ignored files (like `demo-track.smsg`) are missing in the CI environment. --- pkg/player/assets.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/player/assets.go b/pkg/player/assets.go index 9196f35..cde0c60 100644 --- a/pkg/player/assets.go +++ b/pkg/player/assets.go @@ -8,10 +8,7 @@ import ( // Assets embeds all frontend files for the media player // These are served both by Wails (memory) and HTTP (fallback) // -//go:embed frontend/index.html -//go:embed frontend/wasm_exec.js -//go:embed frontend/stmf.wasm -//go:embed frontend/demo-track.smsg +//go:embed frontend var assets embed.FS // Assets returns the embedded filesystem with frontend/ prefix stripped