feat(display): bridge new service Actions to WSEventManager

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Snider 2026-03-13 14:20:43 +00:00
parent 91f4532b50
commit 335d93d05c
2 changed files with 23 additions and 0 deletions

View file

@ -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
}

View file

@ -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"
)