gui: native WebView host as nested module yetano.dev/yetano/core/gui

Extracted from prototypes/yetano-webview (AP1): packages assets,
document, bridge and window (macOS Cocoa/WKWebView via cgo, Windows
Win32/WebView2 pure Go). No local HTTP listener or port: assets go
through the WebView's resource handler, app routes through the native
message binding. Own go.mod and gui/vX.Y.Z tags keep cgo and the
WebView dependencies out of the main core module. Adds backend-free
tests for the window's dispatch/destroy guards and a yet-gui migration
guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
terminarandClaude Opus 5.5 committed 2026-10-23 14:47:26 +02:00
1 parent 90132e2d76
commit 8c63d42a27
27 files changed
+4849 -3

No files matched your search

+19
View File
@@ -250,3 +250,22 @@ exists to do so (`config create`, `config upgrade --write`).
YAML tree, the templates and, via reflection on the program's struct,
which keys exist. It started as `yamase-core/pkg/configcmd` and moved
here unchanged in behavior when the other meta-repos needed it.
## core/gui: a nested module, not a package of this one
The WebView host needs cgo and Cocoa/WebKit on macOS and
`go-webview2`/`x/sys/windows` on Windows; a CLI or daemon importing
`core/paths` must not inherit any of that. So `gui/` has its own
`go.mod` (`yetano.dev/yetano/core/gui`), its own prefixed tags
(`gui/vX.Y.Z`) and its own Go version, while living in the same
repository (one vanity import, one history). It does not import the main
module today; a consumer passes `DataPath` (WebView2 user data) from its
own `core/paths` resolver instead.
Unlike `core/paths`, the GUI host *does* use one build-tagged file per OS
(`window_darwin.go` + `darwin.m`, `window_windows.go`, `window_other.go`):
these are real native bindings that can only be compiled for their OS,
the same exception the root AGENTS.md makes for
`paths/knownfolders_windows.go`. Everything above the window (`assets`,
`document`, `bridge`) is platform-free and unit-tested on any host;
browser behavior is verified by the prototype's in-window selftest.