feat(display): wire events, dock, notification actions to WebSocket bridge
Some checks failed
Security Scan / security (push) Failing after 29s
Some checks failed
Security Scan / security (push) Failing after 29s
- Import events package in display orchestrator - Bridge events.ActionEventFired → EventCustomEvent WebSocket broadcast - Bridge dock.ActionProgressChanged → EventDockProgress - Bridge dock.ActionBounceStarted → EventDockBounce - Bridge notification.ActionNotificationActionTriggered → EventNotificationAction - Bridge notification.ActionNotificationDismissed → EventNotificationDismiss - 5 new EventType constants All 17 packages build and test clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
18a455b460
commit
22668f7faa
2 changed files with 31 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ import (
|
|||
"forge.lthn.ai/core/gui/pkg/dialog"
|
||||
"forge.lthn.ai/core/gui/pkg/dock"
|
||||
"forge.lthn.ai/core/gui/pkg/environment"
|
||||
"forge.lthn.ai/core/gui/pkg/events"
|
||||
"forge.lthn.ai/core/gui/pkg/keybinding"
|
||||
"forge.lthn.ai/core/gui/pkg/lifecycle"
|
||||
"forge.lthn.ai/core/gui/pkg/menu"
|
||||
|
|
@ -242,6 +243,31 @@ func (s *Service) HandleIPCEvents(c *core.Core, msg core.Message) core.Result {
|
|||
s.events.Emit(Event{Type: EventIDECommand,
|
||||
Data: map[string]any{"command": m.Command}})
|
||||
}
|
||||
case events.ActionEventFired:
|
||||
if s.events != nil {
|
||||
s.events.Emit(Event{Type: EventCustomEvent,
|
||||
Data: map[string]any{"name": m.Event.Name, "data": m.Event.Data}})
|
||||
}
|
||||
case dock.ActionProgressChanged:
|
||||
if s.events != nil {
|
||||
s.events.Emit(Event{Type: EventDockProgress,
|
||||
Data: map[string]any{"progress": m.Progress}})
|
||||
}
|
||||
case dock.ActionBounceStarted:
|
||||
if s.events != nil {
|
||||
s.events.Emit(Event{Type: EventDockBounce,
|
||||
Data: map[string]any{"requestId": m.RequestID, "bounceType": m.BounceType}})
|
||||
}
|
||||
case notification.ActionNotificationActionTriggered:
|
||||
if s.events != nil {
|
||||
s.events.Emit(Event{Type: EventNotificationAction,
|
||||
Data: map[string]any{"notificationId": m.NotificationID, "actionId": m.ActionID}})
|
||||
}
|
||||
case notification.ActionNotificationDismissed:
|
||||
if s.events != nil {
|
||||
s.events.Emit(Event{Type: EventNotificationDismiss,
|
||||
Data: map[string]any{"id": m.ID}})
|
||||
}
|
||||
}
|
||||
return core.Result{OK: true}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,11 @@ const (
|
|||
EventContextMenuClick EventType = "contextmenu.item-clicked"
|
||||
EventWebviewConsole EventType = "webview.console"
|
||||
EventWebviewException EventType = "webview.exception"
|
||||
EventCustomEvent EventType = "custom.event"
|
||||
EventDockProgress EventType = "dock.progress"
|
||||
EventDockBounce EventType = "dock.bounce"
|
||||
EventNotificationAction EventType = "notification.action"
|
||||
EventNotificationDismiss EventType = "notification.dismissed"
|
||||
)
|
||||
|
||||
// Event represents a display event sent to subscribers.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue