Files
drover-go/internal/gui/frontend/wailsjs/go/gui/App.js
T
root 1c1ab566d9
Build / test (push) Failing after 29s
Build / build-windows (push) Has been skipped
internal/gui: wire real checker.Run + CancelCheck binding + RawHex display
- RunCheck now drives internal/checker.Run instead of the fake 7-step
  sleep loop. Streams checker.Result events as "check:result" with
  Duration converted to milliseconds; emits "check:done" summary on
  channel close. Re-running while a check is in flight cancels the
  previous run and waits for its goroutine to drain so two emitter
  goroutines never race on event order.
- New CancelCheck method (no-op when nothing is running) is bound
  through wailsjs/go/gui/App.js and surfaced in useDrover as
  cancelCheck() with a "check cancelled by user" log line.
- Classic.jsx: while phase==='checking', the Check button collapses to
  a disabled "Checking…" pill side-by-side with a Cancel button (uses
  Stop's secondary visual weight, t.danger on hover). The expanded
  failure row now renders r.rawHex (truncated to 64 chars) on its own
  mono line and the copy button includes raw=<hex> when present.
- CheckResult struct gains RawHex (json:"rawHex") and Attempt fields.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 16:13:02 +03:00

20 lines
1.1 KiB
JavaScript

// Manually-written JS bindings for the App struct in package
// git.okcu.io/root/drover-go/internal/gui.
//
// Wails Bind() exposes the app's methods at runtime under
// window.go.<package>.App.<Method>, where <package> is the Go package
// where App is defined (here: "gui"). These wrappers give us a stable
// import path from the React side and are the equivalent of what
// `wails generate module` would have produced if we used the standard
// flat layout.
//
// Whenever a new App method is added in internal/gui/app.go, mirror it here.
export function RunCheck(cfg) { return window['go']['gui']['App']['RunCheck'](cfg) }
export function CancelCheck() { return window['go']['gui']['App']['CancelCheck']() }
export function StartEngine() { return window['go']['gui']['App']['StartEngine']() }
export function StopEngine() { return window['go']['gui']['App']['StopEngine']() }
export function GetStatus() { return window['go']['gui']['App']['GetStatus']() }
export function Version() { return window['go']['gui']['App']['Version']() }
export function Greet(name) { return window['go']['gui']['App']['Greet'](name) }