Commit graph

70 commits

Author SHA1 Message Date
Snider
8abfca31e7 feat(gui): 4 smart layout helpers + Good/Bad/Ugly coverage
Added layout primitives to pkg/window/tiling.go:
- BesideEditor — position a window beside an editor, same height,
  on the side with more empty space
- SuggestLayout — layout N windows on screen (golden-ratio split
  for 2, grid for 3+)
- FindEmptySpace — find the largest rectangular empty region that
  fits a minimum size; return (rect, ok)
- ArrangePair — 60/40 or 50/50 split based on aspect ratios

Plus Rect/Size aliases and a WindowPlacement type. Good/Bad/Ugly
test coverage + godoc examples.

pkg/mcp/tools_layout.go left unchanged — this branch already
registers layout_beside_editor / layout_suggest / screen_find_space
/ window_arrange_pair on top of the new helpers.

go vet clean. go test pkg/window/... passes under HOME override
(legacy layout-save tests need writeable ~/Library on non-sandbox).

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

Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-24 07:26:22 +01:00
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
Snider
6a4edb0090 Harden layout persistence path handling
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
2026-04-18 08:55:14 +01:00
Snider
db535805a1 Harden window state path configuration
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-18 08:49:04 +01:00
Snider
337590573b Harden window task payload validation
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-17 18:16:20 +01:00
Snider
fbd6719ee6 Harden window state persistence
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-17 17:59:28 +01:00
Snider
d58ce941e6 Fix window state load hardening
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-17 17:57:17 +01:00
Snider
50e96c0883 Harden window state persistence errors
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-17 17:48:02 +01:00
Snider
e83d2559bb Add missing GUI unit coverage
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 23:17:52 +01:00
Snider
d54a57e158 Harden display routing and window aliases
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 23:03:11 +01:00
Snider
4e690f1794 test: add missing GUI coverage
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 20:59:45 +01:00
Snider
d4a1015c86 test: cover gui spec gaps
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 19:31:12 +01:00
Snider
569a3427dc Add Electron menu and tray bridge
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 19:25:16 +01:00
Snider
c9562e5e59 Add window opacity support
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 18:41:31 +01:00
Snider
ccc01b408b Add missing GUI unit coverage 2026-04-15 17:44:05 +01:00
Snider
866a4814d8 refine gui docs and local names for AX 2026-04-15 14:33:56 +01:00
Snider
2a9968354b Implement remaining GUI integration tools
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 13:58:56 +01:00
Snider
2c59364250 Implement chat, preload shims, and smart layouts
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 13:39:13 +01:00
Snider
be0e66663e Merge feat/wails-submodule: Wails v3 submodule + Core v0.8.0 migration
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 12:41:55 +01:00
Snider
f1d1294abd Implement GUI RFC integrations and stabilize specs
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-15 10:28:38 +01:00
Claude
168dd37cb0 Implement missing GUI RFC route and preload features
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-14 16:37:23 +01:00
Claude
8d3c0fb6d2
feat(gui): implement chat-first UI and display primitives
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
- Replace provider dashboard with full chat UI (history, model selection, image attachments)
- Add chat settings/history/image queue/tool-call metadata persistence
- Add core://settings and core://store route handling in display package
- Add progressive assistant rendering, collapsible thinking/tool-call blocks
- Add markdown/code rendering with copy actions and lightbox image preview
- Add app mode detection (pkg/display/mode.go)
- Add chat backend coverage (pkg/display/chat_test.go)
- Add chat.service.ts frontend service
- AX sweep across pkg/mcp tools and pkg/window/webview/systray/notification

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-14 14:36:01 +01:00
Claude
58308d74cc
Merge remote-tracking branch 'origin/dev-homelab-20260414-1418' into dev
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-14 14:20:11 +01:00
Snider
62ec735c10 refactor: AX compliance sweep — replace banned stdlib imports with core primitives
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
Replaced fmt, strings, sort, os, io, sync, encoding/json, path/filepath,
errors, log, reflect with core.Sprintf, core.E, core.Contains, core.Trim,
core.Split, core.Join, core.JoinPath, slices.Sort, c.Fs(), c.Lock(),
core.JSONMarshal, core.ReadAll and other CoreGO v0.8.0 primitives.

Framework boundary exceptions preserved where stdlib types are required
by external interfaces (Gin, net/http, CGo, Wails, bubbletea).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-13 09:32:01 +01:00
Virgil
031c286fb9 Align GUI packages with AX conventions
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
2026-04-02 20:51:26 +00:00
Virgil
274a81689c chore(gui): add AX usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-02 20:36:02 +00:00
Virgil
d3443d4be9 chore(gui): add AX usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-02 20:31:56 +00:00
Virgil
0204540b20 fix(window): fallback title for wails windows
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-02 20:26:27 +00:00
Virgil
a23e265cc6 fix(window): normalize layout state before applying geometry
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-02 20:04:12 +00:00
Virgil
0423f3058d chore(gui): add AX usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-02 19:54:47 +00:00
Virgil
81503d0968 chore(gui): align AX naming and docs
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 19:50:55 +00:00
Virgil
cf284e9954 feat(gui): add event info and layout query fixes
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-02 19:21:28 +00:00
Virgil
856bb89022 docs(gui): align public API comments with AX
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
2026-04-02 19:12:40 +00:00
Virgil
54d77d85cd fix(window): use detected screen size for tiling
Some checks failed
Security Scan / security (push) Failing after 35s
Test / test (push) Successful in 1m4s
2026-04-02 14:47:40 +00:00
Virgil
4f4a4eb8e4 feat(window): add window opacity support
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Failing after 35s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:42:03 +00:00
Virgil
45fa6942f7 feat(window): expose visibility in window lists
Some checks failed
Security Scan / security (push) Failing after 29s
Test / test (push) Successful in 1m18s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:36:08 +00:00
Virgil
77e03060ac feat(window): expose visibility and minimized state
Some checks failed
Security Scan / security (push) Failing after 31s
Test / test (push) Successful in 1m28s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:30:42 +00:00
Virgil
973217ae54 feat(gui): bridge arrange-pair and find-space
Some checks failed
Security Scan / security (push) Failing after 42s
Test / test (push) Successful in 1m34s
2026-04-02 14:08:32 +00:00
Virgil
a07fa49c20 feat(gui): add missing window mutators and MCP tools
Some checks failed
Security Scan / security (push) Failing after 35s
Test / test (push) Successful in 1m34s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:03:29 +00:00
Virgil
57fb567a68 feat(gui): add webview element screenshots
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Successful in 1m36s
2026-04-02 13:55:56 +00:00
Virgil
3413b64f6c Expose layout stack and workflow actions 2026-04-02 13:23:17 +00:00
Virgil
a1fbcdf6ed feat(window): restore config and screen-aware layouts
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:09:54 +00:00
Virgil
5653bfcc8d feat(mcp): implement missing GUI features
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:03:55 +00:00
Claude
a9b795f223
feat: Wails v3 stub bridge + feature expansion + display bridge + MCP events
Some checks failed
Security Scan / security (push) Failing after 29s
Test / test (push) Successful in 2m9s
Stubs (15 files, 479 exports):
- All managers: Dialog, Event, Browser, Clipboard, ContextMenu, Environment, Screen, KeyBinding
- Window interface (~50 methods), BrowserWindow, platform options (iOS/Android)
- MenuItem (42 roles), WebviewWindowOptions (full platform types)
- Wails v3 submodule pinned at alpha 74

New events package (17th package):
- Custom event system bridged to Core IPC
- TaskEmit, TaskOn, TaskOff, QueryListeners, ActionEventFired

Feature expansions:
- Window: zoom, content (SetURL/SetHTML/ExecJS), bounds, print, flash
- Screen: QueryCurrent, ScreenPlacement, Rect geometry
- Dialog: typed tasks, file options, Info/Question/Warning/Error
- Keybinding: TaskProcess, ErrorNotRegistered
- Notification: RevokePermission, RegisterCategory, action broadcasts
- Dock: SetProgressBar, Bounce/StopBounce
- Environment: HasFocusFollowsMouse
- ContextMenu: QueryGetAll, TaskUpdate, TaskDestroy

Display bridge: 5 new event types wired to WebSocket
MCP: 4 event tools (emit, on, off, list)

17 packages build and test clean (1 flaky test ordering issue in window).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:42:09 +01:00
Claude
9bd0e7b025
refactor: remove banned imports from test files
Some checks failed
Security Scan / security (push) Failing after 27s
- window/persistence_test.go: path/filepath → core.JoinPath
- display/display_test.go: path/filepath → core.JoinPath/PathDir
- browser/service_test.go: errors → core.NewError
- notification/service_test.go: errors → core.NewError

Zero banned imports in ALL gui files — production AND test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:53:40 +01:00
Claude
f1f7fcfab9
refactor: remove banned imports from display, window/layout, window/state
Some checks failed
Security Scan / security (push) Failing after 28s
- display/events.go: encoding/json → core.JSONMarshal/JSONUnmarshal
- display/display.go: os, filepath → core.Env, core.JoinPath
- window/layout.go: encoding/json, os, filepath → core primitives
- window/state.go: encoding/json, os, filepath → core primitives

All 17 packages build and test clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:37:47 +01:00
Claude
18a455b460
refactor: migrate entire gui to Core v0.8.0 API
Some checks failed
Security Scan / security (push) Failing after 25s
- Import paths: forge.lthn.ai/core/go → dappco.re/go/core
- Import paths: forge.lthn.ai/core/go-log → dappco.re/go/core/log
- Import paths: forge.lthn.ai/core/go-io → dappco.re/go/core/io
- RegisterTask → c.Action("name", handler) across all 15 services
- QueryHandler signature: (any, bool, error) → core.Result
- PERFORM(task) → Action.Run(ctx, opts)
- QUERY returns single core.Result (not 3 values)
- All 17 packages build and test clean on v0.8.0-alpha.1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:14:19 +01:00
Claude
de6c6c3405
feat(window): zoom, content, bounds, fullscreen, print + new events pkg
Some checks failed
Security Scan / security (push) Failing after 26s
Window package:
- 15 new PlatformWindow methods (zoom, content, bounds, states, print, flash)
- 16 new IPC types (tasks + queries for all new capabilities)
- ZoomIn/ZoomOut step 0.1, clamped to minimum 0.1
- SetURL, SetHTML, ExecJS for webview content control
- 36 new tests with Good/Bad/Ugly coverage

Events package (NEW — 17th package):
- Custom event system bridged to Core IPC
- Emit, On, Off, OnMultiple, Reset via Platform interface
- ActionEventFired broadcast for agent consumption
- 17 tests

All 17 packages build and test clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 15:01:40 +01:00
Virgil
3bcca95b5e refactor(ax): align GUI code with declarative AX principles
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 13:19:46 +00:00
Snider
13a493f57d refactor(ax): AX compliance sweep — comments, error handling, test names
Some checks failed
Security Scan / security (push) Failing after 26s
Test / test (push) Failing after 56s
- Fix window/service.go: replace 3 fmt.Errorf calls with coreerr.E() (removes implicit fmt dependency)
- Add usage-example comments to all bare Register() functions across 10 packages
- Remove redundant prose comments (Options/Service/Register/OnStartup/HandleIPCEvents boilerplate)
- Add Result-type comments to message types in contextmenu, keybinding, notification packages
- Fix test naming to TestFilename_Function_{Good,Bad,Ugly} pattern in display_test, window_test, persistence_test, service_screen_test
- Convert New() and CreateWindowOptions doc comments to usage-example style

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 12:18:41 +01:00