2026-03-13 14:40:41 +00:00
|
|
|
// pkg/dock/platform.go
|
|
|
|
|
package dock
|
|
|
|
|
|
feat: notification perms/categories, dock progress/bounce, webview zoom/print
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>
2026-03-31 15:19:39 +01:00
|
|
|
// BounceType controls how the dock icon attracts attention.
|
|
|
|
|
// bounce := dock.BounceInformational — single bounce
|
|
|
|
|
// bounce := dock.BounceCritical — continuous bounce until focused
|
|
|
|
|
type BounceType int
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// BounceInformational performs a single bounce to indicate a background event.
|
|
|
|
|
BounceInformational BounceType = iota
|
|
|
|
|
// BounceCritical bounces continuously until the application becomes active.
|
|
|
|
|
BounceCritical
|
|
|
|
|
)
|
|
|
|
|
|
2026-03-13 14:40:41 +00:00
|
|
|
// Platform abstracts the dock/taskbar backend (Wails v3).
|
feat: notification perms/categories, dock progress/bounce, webview zoom/print
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>
2026-03-31 15:19:39 +01:00
|
|
|
// macOS: dock icon show/hide, badge, progress bar, bounce.
|
|
|
|
|
// Windows: taskbar badge + progress bar (show/hide and bounce not supported).
|
2026-03-13 14:40:41 +00:00
|
|
|
// Linux: not supported — adapter returns nil for all operations.
|
|
|
|
|
type Platform interface {
|
|
|
|
|
ShowIcon() error
|
|
|
|
|
HideIcon() error
|
|
|
|
|
SetBadge(label string) error
|
|
|
|
|
RemoveBadge() error
|
|
|
|
|
IsVisible() bool
|
feat: notification perms/categories, dock progress/bounce, webview zoom/print
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>
2026-03-31 15:19:39 +01:00
|
|
|
// SetProgressBar sets a progress indicator on the dock/taskbar icon.
|
|
|
|
|
// progress is clamped to [0.0, 1.0]. Pass -1.0 to hide the indicator.
|
|
|
|
|
SetProgressBar(progress float64) error
|
|
|
|
|
// Bounce requests user attention by animating the dock icon.
|
|
|
|
|
// Returns a request ID that can be passed to StopBounce.
|
|
|
|
|
Bounce(bounceType BounceType) (int, error)
|
|
|
|
|
// StopBounce cancels a pending attention request by its ID.
|
|
|
|
|
StopBounce(requestID int) error
|
2026-03-13 14:40:41 +00:00
|
|
|
}
|