gui/pkg/environment/platform.go
Snider a7c976ff3c feat(environment): add environment core.Service with theme change broadcasts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 14:19:05 +00:00

31 lines
873 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
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"
}