Documentation
¶
Index ¶
- Constants
- type ActionPrompt
- type AppInterface
- type BisectionViewModel
- type DialogManager
- func (m *DialogManager) ShowErrorDialog(title, message string, err error, onDismiss func())
- func (m *DialogManager) ShowInfoDialog(title, message, details string, onDismiss func())
- func (m *DialogManager) ShowQuestionDialog(title, question, details string, onYes func(), onNo func())
- func (m *DialogManager) ShowQuitDialog()
- type FocusChainEntry
- type FocusManager
- type Focusable
- type LayoutManager
- func (lm *LayoutManager) Pages() *tview.Pages
- func (lm *LayoutManager) RootPrimitive() tview.Primitive
- func (lm *LayoutManager) SetErrorCounters(warnCount, errorCount int)
- func (lm *LayoutManager) SetFooter(prompts []ActionPrompt)
- func (lm *LayoutManager) SetHeader(p *tview.TextView)
- func (lm *LayoutManager) SetStatusText(text string)
- type ModalPage
- type NavigationManager
- func (n *NavigationManager) CloseModal()
- func (n *NavigationManager) GetCurrentPage(includeModal bool) Page
- func (n *NavigationManager) GetCurrentPageID(includeModal bool) string
- func (n *NavigationManager) GoBack()
- func (n *NavigationManager) Register(pageID string, page Page)
- func (n *NavigationManager) ShowModal(pageID string, page Page)
- func (n *NavigationManager) SwitchTo(pageID string)
- type Page
- type PageActivator
- type SearchStateObserver
Constants ¶
const ( PageSetupID = "setup_page" PageMainID = "main_page" PageLogID = "log_page" PageLoadingID = "loading_page" PageManageModsID = "manage_mods" PageHistoryID = "history_page" PageResultID = "result_page" PageTestID = "test_page" )
Page IDs are constants used by the NavigationManager to identify pages. They are defined here in the high-level 'ui' package.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionPrompt ¶
type AppInterface ¶
type AppInterface interface {
// --- UI methods & Managers ---
QueueUpdateDraw(f func()) *tview.Application
Stop()
Dialogs() *DialogManager
Layout() *LayoutManager
GetLogger() *logging.Logger
GetFocus() tview.Primitive
SetFocus(tview.Primitive)
// --- Core Logic ---
StartLoadingProcess(modsPath string, quiltSupport, neoForgeSupport bool)
GetViewModel() BisectionViewModel
GetStateManager() *mods.StateManager // StateManager is still needed for detailed mod info.
// --- Actions ---
Step()
Undo() bool
ResetSearch()
ContinueSearch()
Reconcile(callback func())
}
AppInterface defines methods the UI layer needs to access from the main App struct. It acts as a facade for UI components to interact with the application's core.
type BisectionViewModel ¶
type BisectionViewModel struct {
IsReady bool
IsComplete bool
IsVerificationStep bool
StepCount int
Iteration int
Round int
EstimatedMaxTests int
LastTestResult imcs.TestResult
LastFoundElement string
AllModIDs []string
AllConflictSets []sets.Set
CurrentConflictSet sets.Set
CandidateSet sets.Set
ClearedSet sets.Set
PendingAdditions sets.Set
CurrentTestPlan *imcs.TestPlan
ExecutionLog []imcs.CompletedTest
QuiltSupport bool
NeoForgeSupport bool
}
BisectionViewModel provides a snapshot of the current bisection state, tailored for UI consumption. It decouples the UI from the underlying engine's implementation.
type DialogManager ¶
type DialogManager struct {
// contains filtered or unexported fields
}
func NewDialogManager ¶
func NewDialogManager(app AppInterface) *DialogManager
func (*DialogManager) ShowErrorDialog ¶
func (m *DialogManager) ShowErrorDialog(title, message string, err error, onDismiss func())
ShowErrorDialog displays a modal dialog with an error message.
func (*DialogManager) ShowInfoDialog ¶
func (m *DialogManager) ShowInfoDialog(title, message, details string, onDismiss func())
ShowInfoDialog displays a modal dialog with a neutral informational message.
func (*DialogManager) ShowQuestionDialog ¶
func (m *DialogManager) ShowQuestionDialog(title, question, details string, onYes func(), onNo func())
func (*DialogManager) ShowQuitDialog ¶
func (m *DialogManager) ShowQuitDialog()
ShowQuitDialog displays a confirmation dialog before quitting.
type FocusChainEntry ¶
FocusChainEntry holds a primitive and its complete ancestry path from the root.
type FocusManager ¶
type FocusManager struct {
// contains filtered or unexported fields
}
FocusManager handles cycling focus between a dynamic set of primitives.
func NewFocusManager ¶
func NewFocusManager(app AppInterface) *FocusManager
NewFocusManager creates a new focus manager.
type Focusable ¶
type Focusable interface {
// GetFocusablePrimitives returns a slice of the immediate child primitives
// that can receive focus.
GetFocusablePrimitives() []tview.Primitive
}
Focusable is an interface for any primitive that contains child elements which can be focused. It's used by the FocusManager to build a dynamic focus chain.
type LayoutManager ¶
type LayoutManager struct {
// contains filtered or unexported fields
}
LayoutManager handles the overall visual structure of the application.
func NewLayoutManager ¶
func NewLayoutManager(app AppInterface, ctx context.Context) *LayoutManager
NewLayoutManager creates and initializes the UI layout manager.
func (*LayoutManager) Pages ¶
func (lm *LayoutManager) Pages() *tview.Pages
Pages returns the tview.Pages container for content.
func (*LayoutManager) RootPrimitive ¶
func (lm *LayoutManager) RootPrimitive() tview.Primitive
RootPrimitive returns the main primitive that should be set as the application's root.
func (*LayoutManager) SetErrorCounters ¶
func (lm *LayoutManager) SetErrorCounters(warnCount, errorCount int)
SetErrorCounters updates the error and warning counters.
func (*LayoutManager) SetFooter ¶
func (lm *LayoutManager) SetFooter(prompts []ActionPrompt)
SetFooter updates the action hints flexbox.
func (*LayoutManager) SetHeader ¶
func (lm *LayoutManager) SetHeader(p *tview.TextView)
SetHeader updates the status bar
func (*LayoutManager) SetStatusText ¶
func (lm *LayoutManager) SetStatusText(text string)
type ModalPage ¶
ModalPage is a simple wrapper around a tview.Modal to conform to the Page interface.
func NewModalPage ¶
NewModalPage creates a new ModalPage.
func (*ModalPage) GetActionPrompts ¶
func (p *ModalPage) GetActionPrompts() []ActionPrompt
GetActionPrompts returns an empty map as modals have their own buttons.
func (*ModalPage) GetStatusPrimitive ¶
GetStatusPrimitive returns the tview.Primitive that displays the page's status
type NavigationManager ¶
type NavigationManager struct {
// contains filtered or unexported fields
}
NavigationManager handles page state and transitions using a hybrid model of persistent "workspace" pages and transient "modal" overlays.
func NewNavigationManager ¶
func NewNavigationManager(app AppInterface, pages *tview.Pages) *NavigationManager
NewNavigationManager creates a new manager for page navigation.
func (*NavigationManager) CloseModal ¶
func (n *NavigationManager) CloseModal()
CloseModal removes the top-most modal page.
func (*NavigationManager) GetCurrentPage ¶
func (n *NavigationManager) GetCurrentPage(includeModal bool) Page
GetCurrentPage returns the Page interface of the front-most primitive.
func (*NavigationManager) GetCurrentPageID ¶
func (n *NavigationManager) GetCurrentPageID(includeModal bool) string
GetCurrentPageID returns the page id of the front-most primitive.
func (*NavigationManager) GoBack ¶
func (n *NavigationManager) GoBack()
GoBack navigates to the previous page in the history stack.
func (*NavigationManager) Register ¶
func (n *NavigationManager) Register(pageID string, page Page)
Register adds a persistent page to the manager. These pages are created once and switched to by their ID.
func (*NavigationManager) ShowModal ¶
func (n *NavigationManager) ShowModal(pageID string, page Page)
ShowModal displays a transient page (like a dialog) over the current view.
func (*NavigationManager) SwitchTo ¶
func (n *NavigationManager) SwitchTo(pageID string)
SwitchTo changes the main visible page to the one specified by pageID. It also manages the navigation history for the GoBack() function.
type Page ¶
type Page interface {
tview.Primitive
GetActionPrompts() []ActionPrompt
GetStatusPrimitive() *tview.TextView
}
Page is the interface that all UI pages must implement.
type PageActivator ¶
type PageActivator interface {
OnPageActivated()
}
PageActivator defines an interface for pages that need to perform an action when they become the active page.
type SearchStateObserver ¶
type SearchStateObserver interface {
// RefreshSearchState is called to update the page with the latest searcher data.
RefreshSearchState()
}
SearchStateObserver defines an interface for pages that need to be updated when the conflict searcher's state changes.