From 335d93d05c0b3ecab5a07556c4eca2eb18a67675 Mon Sep 17 00:00:00 2001 From: Snider Date: Fri, 13 Mar 2026 14:20:43 +0000 Subject: [PATCH] feat(display): bridge new service Actions to WSEventManager Co-Authored-By: Claude Opus 4.6 --- pkg/display/display.go | 22 ++++++++++++++++++++++ pkg/display/events.go | 1 + 2 files changed, 23 insertions(+) diff --git a/pkg/display/display.go b/pkg/display/display.go index 765b4e1..33a3b78 100644 --- a/pkg/display/display.go +++ b/pkg/display/display.go @@ -9,7 +9,10 @@ import ( "forge.lthn.ai/core/go-config" "forge.lthn.ai/core/go/pkg/core" + "forge.lthn.ai/core/gui/pkg/environment" "forge.lthn.ai/core/gui/pkg/menu" + "forge.lthn.ai/core/gui/pkg/notification" + "forge.lthn.ai/core/gui/pkg/screen" "forge.lthn.ai/core/gui/pkg/systray" "forge.lthn.ai/core/gui/pkg/window" "github.com/wailsapp/wails/v3/pkg/application" @@ -127,6 +130,25 @@ func (s *Service) HandleIPCEvents(c *core.Core, msg core.Message) error { Data: map[string]any{"actionId": m.ActionID}}) } s.handleTrayAction(m.ActionID) + case environment.ActionThemeChanged: + if s.events != nil { + theme := "light" + if m.IsDark { + theme = "dark" + } + s.events.Emit(Event{Type: EventThemeChange, + Data: map[string]any{"isDark": m.IsDark, "theme": theme}}) + } + case notification.ActionNotificationClicked: + if s.events != nil { + s.events.Emit(Event{Type: EventNotificationClick, + Data: map[string]any{"id": m.ID}}) + } + case screen.ActionScreensChanged: + if s.events != nil { + s.events.Emit(Event{Type: EventScreenChange, + Data: map[string]any{"screens": m.Screens}}) + } } return nil } diff --git a/pkg/display/events.go b/pkg/display/events.go index eb378de..7ac6bcf 100644 --- a/pkg/display/events.go +++ b/pkg/display/events.go @@ -23,6 +23,7 @@ const ( EventWindowCreate EventType = "window.create" EventThemeChange EventType = "theme.change" EventScreenChange EventType = "screen.change" + EventNotificationClick EventType = "notification.click" EventTrayClick EventType = "tray.click" EventTrayMenuItemClick EventType = "tray.menuitem.click" )