ui

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatReviewSummaryForMenu

func FormatReviewSummaryForMenu(summary *pullrequest.ReviewSummary) string

FormatReviewSummaryForMenu returns a formatted string for display in the system tray menu. Groups reviewers by state:

  • (✅ Joe, Mike | ❌ Alice) — approved and changes requested
  • (✅ Joe) — only approved
  • (💬 Bob) — only commented

Types

type IgnoreMenuHandler

type IgnoreMenuHandler func()

IgnoreMenuHandler is a callback for when the Ignore Rules menu item is clicked.

type MenuAdapter struct {
	// contains filtered or unexported fields
}

MenuAdapter adapts the systray menu to the MenuPort interface

func NewMenuAdapter

func NewMenuAdapter(maxNumberOfRepos, maxNumberOfPRs int, themeProvider ThemeProvider, authenticatedUser string) *MenuAdapter

NewMenuAdapter creates a new menu adapter

func (m *MenuAdapter) ClearWaitingState()

ClearWaitingState hides the waiting-mode menu items so the normal PR menu can take over. Called when a valid config is detected.

func (m *MenuAdapter) RegisterIgnoreHandler(handler IgnoreMenuHandler)

RegisterIgnoreHandler stores the callback to invoke when "Configuration > Ignore Rules" is clicked. It must be called before the first UpdateDisplay so that initializeMenuStructure can wire up the menu item at the right position.

func (m *MenuAdapter) SetThemeIcons(darkIcon, lightIcon []byte)

SetThemeIcons sets the dark and light icons

func (m *MenuAdapter) Setup()

Setup initializes the menu

func (m *MenuAdapter) SetupWaitingState(configFilePath string)

SetupWaitingState shows a minimal systray menu indicating the app is waiting for a valid configuration. It displays the config file path and a quit button.

func (m *MenuAdapter) Shutdown()

Shutdown cleans up the menu adapter

func (m *MenuAdapter) UpdateDisplay(requestedReviewPRs, userCreatedPRs []*pullrequest.PullRequest, prTrackingRepo pullrequest.PRTrackingRepository)

UpdateDisplay implements the UIPort interface for systray menu display This adapter specifically renders PRs as a system tray menu with dropdowns

type MenuItemPair struct {
	Parent   *systray.MenuItem
	Children []*systray.MenuItem
}

MenuItemPair represents a parent menu item with its children

type SystemThemeProvider

type SystemThemeProvider struct{}

SystemThemeProvider implements ThemeProvider using system detection

func NewSystemThemeProvider

func NewSystemThemeProvider() *SystemThemeProvider

NewSystemThemeProvider creates a new system theme provider

func (*SystemThemeProvider) GetSystemTheme

func (p *SystemThemeProvider) GetSystemTheme() string

GetSystemTheme detects the system theme (dark or light) across platforms

type ThemeProvider

type ThemeProvider interface {
	GetSystemTheme() string
}

ThemeProvider provides the current system theme

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL