gui/pkg/environment/platform.go
Claude bb5122580a
Some checks failed
Security Scan / security (push) Failing after 26s
feat(environment,contextmenu): expand with new queries and lifecycle
Environment:
- QueryFocusFollowsMouse IPC query
- 9 new tests (accent colour, file manager, focus follows mouse)

Context Menu:
- TaskUpdate (remove-then-add semantics)
- TaskDestroy (remove + release)
- QueryGetAll
- OnShutdown cleanup
- 12 new tests

All 17 packages build and test clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 15:08:50 +01:00

32 lines
902 B
Go

// pkg/environment/platform.go
package environment
// Platform abstracts environment and theme backend queries.
type Platform interface {
IsDarkMode() bool
Info() EnvironmentInfo
AccentColour() string
OpenFileManager(path string, selectFile bool) error
HasFocusFollowsMouse() bool
OnThemeChange(handler func(isDark bool)) func() // returns cancel func
}
// EnvironmentInfo contains system environment details.
type EnvironmentInfo struct {
OS string `json:"os"`
Arch string `json:"arch"`
Debug bool `json:"debug"`
Platform PlatformInfo `json:"platform"`
}
// PlatformInfo contains platform-specific details.
type PlatformInfo struct {
Name string `json:"name"`
Version string `json:"version"`
}
// ThemeInfo contains the current theme state.
type ThemeInfo struct {
IsDark bool `json:"isDark"`
Theme string `json:"theme"` // "dark" or "light"
}