Documentation
¶
Index ¶
Constants ¶
const SearchPageSize = 10
SearchPageSize mirrors the CLI picker's displayPageSize (cmd/lmm/install.go).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataProvider ¶
type DataProvider interface {
// Overview returns the dashboard summary and installed-mod rows from a
// single underlying fetch.
Overview(ctx context.Context) (Summary, []ModItem, error)
Profiles(ctx context.Context) ([]ProfileItem, error)
// Sources lists the game's configured real source IDs, sorted. The TUI
// prepends the all-sources sentinel ("") ahead of these (see
// newSearchModel); the CLI instead defaults to an aggregate search
// across all of them when --source is omitted (see doSearch in
// cmd/lmm/search.go).
Sources() []string
// SourceInfos lists every source registered with the service (built-in
// and user-defined), sorted by ID, for the read-only Sources screen. See
// SourceInfo's doc comment for how this differs from Sources.
SourceInfos() []SourceInfo
// Search queries one source, or every one of the game's configured
// sources when source is "" (the documented all-sources sentinel).
Search(ctx context.Context, source, query string, page int) (SearchPage, error)
}
DataProvider is the narrow, read-only boundary between the TUI and app data. Implementations must be safe to call from a Bubble Tea command goroutine.
func NewCoreProvider ¶
NewCoreProvider returns a DataProvider backed by the real app service for one game/profile pair.
func NewPrototypeProvider ¶
func NewPrototypeProvider() DataProvider
NewPrototypeProvider returns the side-effect-free demo DataProvider used by --prototype mode and tests.
type KeyMap ¶
type KeyMap struct {
Quit key.Binding
Help key.Binding
NextScreen key.Binding
PrevScreen key.Binding
Up key.Binding
Down key.Binding
Search key.Binding
SearchScreen key.Binding
Dashboard key.Binding
InstalledMods key.Binding
Profiles key.Binding
Sources key.Binding
Select key.Binding
Submit key.Binding
Blur key.Binding
NextPage key.Binding
PrevPage key.Binding
CycleSource key.Binding
}
KeyMap documents the TUI keyboard contract.
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
DefaultKeyMap returns the shared key bindings shown in help and used by tests.
type ModItem ¶
type ModItem struct {
Name string
Author string
Version string
Source string
Status string
Summary string
Downloads int64
Endorsements int64
HasEndorsements bool
}
ModItem is one renderable mod row.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root Bubble Tea model for the lmm TUI.
func NewPrototypeModel ¶
NewPrototypeModel creates a side-effect-free TUI model backed by fake data.
func (Model) CurrentScreen ¶
CurrentScreen exposes the selected screen for tests.
func (Model) HelpVisible ¶
HelpVisible exposes help overlay state for tests.
func (Model) SelectedIndex ¶
SelectedIndex exposes the selected row for tests.
type Options ¶
type Options struct {
Theme string
Provider DataProvider
// Ctx seeds Model.ctx; see that field for why the context is stored
// rather than threaded as a parameter.
Ctx context.Context
}
Options configures the TUI app.
type ProfileItem ¶
ProfileItem is one renderable profile row.
type SearchPage ¶ added in v1.5.0
type SearchPage struct {
Results []ModItem
Query string
Source string
Page int // 0-based
PageSize int
TotalCount int // 0 if the source doesn't report totals
// Warnings holds per-source failures in all-sources mode, already
// formatted for display (e.g. "<sourceID>: <err>"). Empty for
// single-source searches.
Warnings []string
}
SearchPage is one page of search results for one source/query.
type SourceInfo ¶ added in v1.10.0
type SourceInfo struct {
ID string
Name string
Type string // "built-in", "directory", "manifest", or "api"
Auth string // "yes", "no", or "n/a" (source has no auth capability)
Capabilities string // compact list, e.g. "search,updates"
}
SourceInfo is one renderable source-registry row, mirroring the columns of `lmm source list` (cmd/lmm/source.go) minus its Error column: the Sources screen only lists sources that are actually REGISTERED with the service. Source-definition load failures (a malformed YAML file, an ID collision) never produce a registered source, so they have no row here and remain a CLI-only diagnostic (`lmm source list` / `lmm source validate`).