From 450d04411aeca46e825159bcf993e8b23a53ac4e Mon Sep 17 00:00:00 2001 From: Virgil Date: Tue, 31 Mar 2026 07:28:11 +0000 Subject: [PATCH] refactor(ax): remove legacy compatibility aliases Co-Authored-By: Virgil --- docs/framework/help.md | 20 +++----------------- pkg/display/display.go | 16 ---------------- pkg/display/events.go | 6 ------ pkg/mcp/subsystem.go | 5 ----- pkg/window/messages.go | 6 ------ 5 files changed, 3 insertions(+), 50 deletions(-) diff --git a/docs/framework/help.md b/docs/framework/help.md index 8f2614f..3adf228 100644 --- a/docs/framework/help.md +++ b/docs/framework/help.md @@ -74,10 +74,9 @@ The help service can work standalone or integrated with Core: ### With Display Service -When Display service is available, help opens through the IPC action system: +When Display service is available, help opens through the display service's declarative window API: ```go -// Automatically uses display.open_window action helpService.Init(core, displayService) helpService.Show() ``` @@ -134,19 +133,6 @@ The help window opens with default settings: | Width | 800px | | Height | 600px | -## IPC Action +## Display Integration -When using Display service, help triggers this action: - -```go -{ - "action": "display.open_window", - "name": "help", - "options": { - "Title": "Help", - "Width": 800, - "Height": 600, - "URL": "/#anchor", // When using ShowAt - }, -} -``` +The help window spec stays internal to the service. Callers initialize the help service with the display service and then call `Show()` or `ShowAt()`; the display layer opens the window from a declarative `window.Window` spec. diff --git a/pkg/display/display.go b/pkg/display/display.go index f646eeb..6703f33 100644 --- a/pkg/display/display.go +++ b/pkg/display/display.go @@ -30,9 +30,6 @@ import ( // Options holds configuration for the display service. type Options struct{} -// WindowInfo is an alias for window.WindowInfo (backward compatibility). -type WindowInfo = window.WindowInfo - // Service manages windowing, dialogs, and other visual elements. // It orchestrates sub-services (window, systray, menu) via IPC and bridges // IPC actions to WebSocket events for TypeScript apps. @@ -56,11 +53,6 @@ func NewService() (*Service, error) { }, nil } -// New is kept for backward compatibility with older callers. -func New() (*Service, error) { - return NewService() -} - // Register creates a factory closure that captures the Wails app. // Pass nil for testing without a Wails runtime. func Register(wailsApp *application.App) func(*core.Core) (any, error) { @@ -241,9 +233,6 @@ type WebSocketMessage struct { Data map[string]any `json:"data,omitempty"` } -// WSMessage is kept for backward compatibility with older callers. -type WSMessage = WebSocketMessage - // requireWebSocketField extracts a string field from WebSocket data and returns an error if it is empty. func requireWebSocketField(data map[string]any, key string) (string, error) { v, _ := data[key].(string) @@ -848,11 +837,6 @@ func (s *Service) GetWebSocketEventManager() *WebSocketEventManager { return s.events } -// GetEventManager is kept for backward compatibility with older callers. -func (s *Service) GetEventManager() *WebSocketEventManager { - return s.GetWebSocketEventManager() -} - // --- Menu (handlers stay in display, structure delegated via IPC) --- func (s *Service) buildMenu() { diff --git a/pkg/display/events.go b/pkg/display/events.go index 4db69a8..7a7c241 100644 --- a/pkg/display/events.go +++ b/pkg/display/events.go @@ -91,12 +91,6 @@ func NewWebSocketEventManager() *WebSocketEventManager { return em } -// WSEventManager is kept for backward compatibility with older callers. -type WSEventManager = WebSocketEventManager - -// NewWSEventManager is kept for backward compatibility with older callers. -func NewWSEventManager() *WebSocketEventManager { return NewWebSocketEventManager() } - // broadcaster sends events to all subscribed clients. func (em *WebSocketEventManager) broadcaster() { for event := range em.eventBuffer { diff --git a/pkg/mcp/subsystem.go b/pkg/mcp/subsystem.go index 0648617..7aa0ee7 100644 --- a/pkg/mcp/subsystem.go +++ b/pkg/mcp/subsystem.go @@ -17,11 +17,6 @@ func NewService(c *core.Core) *Subsystem { return &Subsystem{core: c} } -// New is kept for backward compatibility with older callers. -func New(c *core.Core) *Subsystem { - return NewService(c) -} - // Name returns the subsystem identifier. func (s *Subsystem) Name() string { return "display" } diff --git a/pkg/window/messages.go b/pkg/window/messages.go index 8960f8c..bda6185 100644 --- a/pkg/window/messages.go +++ b/pkg/window/messages.go @@ -41,12 +41,6 @@ type TaskMaximize struct{ Name string } // TaskMinimize minimizes a named window. type TaskMinimize struct{ Name string } -// TaskMaximise is kept for backward compatibility with older callers. -type TaskMaximise = TaskMaximize - -// TaskMinimise is kept for backward compatibility with older callers. -type TaskMinimise = TaskMinimize - type TaskFocus struct{ Name string } type TaskRestore struct{ Name string }