Some checks failed
Security Scan / security (push) Failing after 28s
Notification: RevokePermission, RegisterCategory, action broadcasts Dock: SetProgressBar, Bounce/StopBounce, ActionProgressChanged Webview: QueryZoom, TaskSetZoom, TaskSetURL, TaskPrint (with PDF export) MCP: 4 new event tools (emit, on, off, list) Environment: HasFocusFollowsMouse query ContextMenu: Update, Destroy, GetAll, OnShutdown cleanup Core upgraded to v0.8.0-alpha.1 (added alongside existing v0.3.3 — full module path migration pending). All 17 packages build and test clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
55 lines
1.9 KiB
Go
55 lines
1.9 KiB
Go
// pkg/dock/messages.go
|
|
package dock
|
|
|
|
// --- Queries (read-only) ---
|
|
|
|
// QueryVisible returns whether the dock icon is visible. Result: bool
|
|
type QueryVisible struct{}
|
|
|
|
// --- Tasks (side-effects) ---
|
|
|
|
// TaskShowIcon shows the dock/taskbar icon. Result: nil
|
|
type TaskShowIcon struct{}
|
|
|
|
// TaskHideIcon hides the dock/taskbar icon. Result: nil
|
|
type TaskHideIcon struct{}
|
|
|
|
// TaskSetBadge sets the dock/taskbar badge label.
|
|
// Empty string "" shows the default system badge indicator.
|
|
// Numeric "3", "99" shows unread count. Text "New", "Paused" shows brief status.
|
|
// Result: nil
|
|
type TaskSetBadge struct{ Label string }
|
|
|
|
// TaskRemoveBadge removes the dock/taskbar badge. Result: nil
|
|
type TaskRemoveBadge struct{}
|
|
|
|
// TaskSetProgressBar updates the progress indicator on the dock/taskbar icon.
|
|
// Progress is clamped to [0.0, 1.0]. Pass -1.0 to hide the indicator.
|
|
// c.PERFORM(dock.TaskSetProgressBar{Progress: 0.75}) // 75% complete
|
|
// c.PERFORM(dock.TaskSetProgressBar{Progress: -1.0}) // hide indicator
|
|
// Result: nil
|
|
type TaskSetProgressBar struct{ Progress float64 }
|
|
|
|
// TaskBounce requests user attention by animating the dock icon.
|
|
// Result: int (requestID for use with TaskStopBounce)
|
|
// c.PERFORM(dock.TaskBounce{BounceType: dock.BounceInformational})
|
|
type TaskBounce struct{ BounceType BounceType }
|
|
|
|
// TaskStopBounce cancels a pending attention request.
|
|
// c.PERFORM(dock.TaskStopBounce{RequestID: id})
|
|
// Result: nil
|
|
type TaskStopBounce struct{ RequestID int }
|
|
|
|
// --- Actions (broadcasts) ---
|
|
|
|
// ActionVisibilityChanged is broadcast after a successful TaskShowIcon or TaskHideIcon.
|
|
type ActionVisibilityChanged struct{ Visible bool }
|
|
|
|
// ActionProgressChanged is broadcast after a successful TaskSetProgressBar.
|
|
type ActionProgressChanged struct{ Progress float64 }
|
|
|
|
// ActionBounceStarted is broadcast after a successful TaskBounce.
|
|
type ActionBounceStarted struct {
|
|
RequestID int `json:"requestId"`
|
|
BounceType BounceType `json:"bounceType"`
|
|
}
|