Files
Anitrack/app.go
T
John O'Keefe 2a6397b964 refactor!: retire wails.json, config.yml is the version source
- version.go (generated, never hand-edited) carries the compiled-in
  version; app.go drops the wails.json embed plus the gjson dependency
- make release bumps config.yml and regenerates version.go in one
  commit; the re-run-safe guards from the 1.99.1 cycle carry over
- release guard reads config.yml; CI CLI pin and cache key move to
  beta.22 to match the lockstep above
- release wrapper and config NOTE comments updated; deletion proof:
  wails3 build green plus a dev boot reaching the connected state
  with the file absent (the one cold-boot failure reproduced as a
  Vite 8 cold-start vs app retry race, cleared by rerunning warm)
2026-09-16 16:29:35 -04:00

46 lines
994 B
Go

package main
import (
"strings"
"github.com/wailsapp/wails/v3/pkg/application"
)
// App struct
type App struct {
app *application.App
}
// NewApp creates a new App application struct
func NewApp(app *application.App) *App {
return &App{app: app}
}
// appVersion is the release version, stamped into version.go by
// `make release` from build/config.yml.
func appVersion() string {
return appVersionString
}
// appTitle is the window title: "AniTrack <version>".
func appTitle() string {
return "AniTrack " + appVersion()
}
func (a *App) onSecondInstanceLaunch(data application.SecondInstanceData) {
println("user opened second instance", strings.Join(data.Args, ","))
println("user opened second from", data.WorkingDir)
if w := a.app.Window.Current(); w != nil {
w.Restore()
w.Focus()
}
go a.app.Event.Emit("launchArgs", data.Args)
}
func (a *App) ShowVersion() {
a.app.Dialog.Info().
SetTitle("Version").
SetMessage("AniTrack Version: " + appVersion()).
Show()
}