Align GUI packages with AX conventions
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled

This commit is contained in:
Virgil 2026-04-02 20:51:26 +00:00
parent 6b3879fb9a
commit 031c286fb9
13 changed files with 31 additions and 13 deletions

View file

@ -1,3 +1,4 @@
// pkg/display/display.go
package display
import (

View file

@ -1,3 +1,4 @@
// pkg/menu/messages.go
package menu
// QueryConfig requests this service's config section from the display orchestrator.

View file

@ -1,3 +1,4 @@
// pkg/menu/mock_platform.go
package menu
// MockPlatform is an exported mock for cross-package integration tests.
@ -5,15 +6,19 @@ type MockPlatform struct{}
func NewMockPlatform() *MockPlatform { return &MockPlatform{} }
func (m *MockPlatform) NewMenu() PlatformMenu { return &exportedMockPlatformMenu{} }
func (m *MockPlatform) NewMenu() PlatformMenu { return &exportedMockPlatformMenu{} }
func (m *MockPlatform) SetApplicationMenu(menu PlatformMenu) {}
type exportedMockPlatformMenu struct{}
func (m *exportedMockPlatformMenu) Add(label string) PlatformMenuItem { return &exportedMockPlatformMenuItem{} }
func (m *exportedMockPlatformMenu) AddSeparator() {}
func (m *exportedMockPlatformMenu) AddSubmenu(label string) PlatformMenu { return &exportedMockPlatformMenu{} }
func (m *exportedMockPlatformMenu) AddRole(role MenuRole) {}
func (m *exportedMockPlatformMenu) Add(label string) PlatformMenuItem {
return &exportedMockPlatformMenuItem{}
}
func (m *exportedMockPlatformMenu) AddSeparator() {}
func (m *exportedMockPlatformMenu) AddSubmenu(label string) PlatformMenu {
return &exportedMockPlatformMenu{}
}
func (m *exportedMockPlatformMenu) AddRole(role MenuRole) {}
type exportedMockPlatformMenuItem struct{}

View file

@ -1,3 +1,4 @@
// pkg/menu/register.go
package menu
import "forge.lthn.ai/core/go/pkg/core"

View file

@ -1,3 +1,4 @@
// pkg/menu/service.go
package menu
import (

View file

@ -1,3 +1,4 @@
// pkg/systray/messages.go
package systray
// QueryConfig requests this service's config section from the display orchestrator.

View file

@ -1,3 +1,4 @@
// pkg/systray/mock_platform.go
package systray
// MockPlatform is an exported mock for cross-package integration tests.

View file

@ -1,3 +1,4 @@
// pkg/systray/register.go
package systray
import "forge.lthn.ai/core/go/pkg/core"

View file

@ -1,3 +1,4 @@
// pkg/webview/diagnostics.go
package webview
import (

View file

@ -87,7 +87,8 @@ type TaskSetPosition struct {
type TaskSetSize struct {
Name string
Width, Height int
W, H int
// W and H are compatibility aliases for older call sites.
W, H int
}
// TaskMaximise maximises a window.
@ -244,7 +245,8 @@ type ActionWindowMoved struct {
type ActionWindowResized struct {
Name string
Width, Height int
W, H int
// W and H are compatibility aliases for older listeners.
W, H int
}
// ActionWindowFocused is broadcast when a window gains focus.

View file

@ -1,3 +1,4 @@
// pkg/window/mock_platform.go
package window
// MockPlatform is an exported mock for cross-package integration tests.
@ -76,12 +77,12 @@ func (w *MockWindow) Close() {
w.closed = true
w.emit(WindowEvent{Type: "close", Name: w.name})
}
func (w *MockWindow) Show() { w.visible = true }
func (w *MockWindow) Hide() { w.visible = false }
func (w *MockWindow) Fullscreen() {}
func (w *MockWindow) UnFullscreen() {}
func (w *MockWindow) OpenDevTools() {}
func (w *MockWindow) CloseDevTools() {}
func (w *MockWindow) Show() { w.visible = true }
func (w *MockWindow) Hide() { w.visible = false }
func (w *MockWindow) Fullscreen() {}
func (w *MockWindow) UnFullscreen() {}
func (w *MockWindow) OpenDevTools() {}
func (w *MockWindow) CloseDevTools() {}
func (w *MockWindow) OnWindowEvent(handler func(WindowEvent)) {
w.eventHandlers = append(w.eventHandlers, handler)
}

View file

@ -1,3 +1,4 @@
// pkg/window/register.go
package window
import "forge.lthn.ai/core/go/pkg/core"

View file

@ -582,6 +582,7 @@ func (s *Service) primaryScreenSize() (int, int) {
}
// Manager returns the underlying window Manager for direct access.
// Use: mgr := svc.Manager()
func (s *Service) Manager() *Manager {
return s.manager
}