gui/pkg
Snider fa4168e380 feat(gui): InjectPreload — storage polyfills + Electron shim + app preloads
New pkg/preload package:
- preload.go — InjectPreload(webview, origin) entry point; builds
  three-step preload: storage polyfills, Electron shim (origin-
  filtered), app preloads from .core/view.yaml manifest.preloads.
- assets/storage_polyfills.js — localStorage/sessionStorage/
  IndexedDB bridges.
- assets/electron_shim.js — minimal ipcRenderer.send/invoke
  mapping to core.QUERY/ACTION.
- Adds a minimal window.core.ml.generate shim — gates the
  AI-native browser path (RFC §11a).

pkg/window/wails.go wires into Wails OnPageLoad via reflection when
the runtime exposes the hook, with a clean fallback for the
stubbed/test runtime. Legacy display-preload code detected and
skipped when the new package is in play.

Good/Bad/Ugly tests in pkg/preload/preload_test.go. go vet + go
test clean.

Closes tasks.lthn.sh/view.php?id=16

Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-24 06:17:34 +01:00
..
browser Add GUI coverage tests 2026-04-17 18:08:38 +01:00
chat Wire chat image picker through native dialog 2026-04-15 22:46:14 +01:00
clipboard Fix GUI image bridge wiring 2026-04-15 23:22:04 +01:00
container Add missing GUI unit coverage 2026-04-15 22:59:42 +01:00
contextmenu Harden context menu nil backend paths 2026-04-17 20:01:58 +01:00
deno Implement P2P, Deno, and container spec gaps 2026-04-15 22:12:19 +01:00
dialog Add GUI coverage tests 2026-04-17 18:08:38 +01:00
display feat(gui): core:// scheme handler + 7 route dispatches 2026-04-24 06:17:33 +01:00
dock feat: Wails v3 stub bridge + feature expansion + display bridge + MCP events 2026-03-31 17:42:09 +01:00
environment Harden environment file manager path handling 2026-04-17 19:49:52 +01:00
events Harden nil event handling 2026-04-17 21:01:05 +01:00
keybinding Harden GUI security boundaries 2026-04-15 17:19:11 +01:00
lifecycle feat(lifecycle): add AppMode type + DetectMode() 2026-04-23 13:12:12 +01:00
marketplace Harden websocket and marketplace failure paths 2026-04-17 20:38:57 +01:00
mcp Harden context menu MCP JSON bridge 2026-04-17 20:54:37 +01:00
menu Harden menu builder against nil handles 2026-04-17 21:02:34 +01:00
notification Wire notification categories and layout helpers 2026-04-15 22:18:35 +01:00
p2p Harden p2p bridge cleanup 2026-04-17 20:12:18 +01:00
preload feat(gui): InjectPreload — storage polyfills + Electron shim + app preloads 2026-04-24 06:17:34 +01:00
screen Harden screen state boundaries 2026-04-17 20:00:27 +01:00
systray Add missing GUI unit coverage 2026-04-15 23:17:52 +01:00
webview Fix webview target matching 2026-04-17 18:00:49 +01:00
window feat(gui): InjectPreload — storage polyfills + Electron shim + app preloads 2026-04-24 06:17:34 +01:00