Documentation
¶
Overview ¶
Package packages implements the package search and dependency management views.
Example (NormalizeQuery) ¶
fmt.Println(normalizeQuery("Requests-HTML_v2.0"))
Output: requestshtmlv20
Index ¶
- func FetchDescription(index int, name string) tea.Cmd
- func IsAsyncMsg(msg interface{}) bool
- func OpenManagerModalCmd() tea.Cmd
- func RenderPackageDetails(result *Result, width int, loading bool, query string, err error) string
- func RenderResults(results []Result, width int, selectedIndex int) string
- func Search(query string) tea.Cmd
- func TruncateText(text string, max int) string
- func WrapText(text string, width int) string
- type DescriptionLoadedMsg
- type DoneMsg
- type Result
- type ViewModel
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchDescription ¶
FetchDescription returns a Bubble Tea command that loads package metadata.
func IsAsyncMsg ¶
func IsAsyncMsg(msg interface{}) bool
IsAsyncMsg returns true if msg is one of the async messages produced by requirements commands. Used by the top-level model to forward these messages to the requirements sub-model even when another screen is active.
func OpenManagerModalCmd ¶
OpenManagerModalCmd opens the package manager selector modal.
func RenderPackageDetails ¶
RenderPackageDetails renders the package details pane content.
func RenderResults ¶
RenderResults renders the package search result list pane.
func TruncateText ¶
TruncateText truncates text to max runes and appends an ellipsis when needed.
Types ¶
type DescriptionLoadedMsg ¶
DescriptionLoadedMsg carries package metadata loaded asynchronously.
type Result ¶
Result contains package information retrieved from PyPI.
func SelectedSearchResult ¶
SelectedSearchResult returns the currently selected result or nil.
type ViewModel ¶
type ViewModel struct {
Width int
Height int
PackageManager packagemanager.PackageManager
Interpreter string
InterpreterKind string
Packages []packagemanager.Dependency
Selected int
Scroll int
ListSearchInput textinput.Model
ListSearchMode bool
ListFilter string
LoadingList bool
BusyAction bool
ModalOpen bool
InstallInput textinput.Model
Suggestions []packagemanager.Dependency
SuggestionSelected int
SuggestionScroll int
ModalLoadingSuggestions bool
ModalLastQuery string
ModalSearchSeq int
ModalErrorText string
ModalLoading bool
ModalFocusedPane int
ModalSuggestionMeta *Result
ModalSuggestionMetaLoading bool
ModalSuggestionMetaName string
ModalSuggestionMetaScroll int
InstallMeta *Result
InstallMetaLoading bool
InstallMetaErr string
ManagerModalOpen bool
ManagerOptions []managerOption
ManagerSelected int
ManagerScroll int
VersionModalOpen bool
VersionsList []string
VersionSelected int
VersionScroll int
VersionLoading bool
VersionPackageName string
VersionErrorText string
VersionFromMain bool
Loader spinner.Model
ActionModalOpen bool
ActionModalLoading bool
ActionModalTitle string
ActionModalText string
ActionModalKind logKind
HelpModalOpen bool
SearchMode bool
SearchQuery string
LogText string
LogKind logKind
SelectedMeta *Result
SelectedMetaLoading bool
SelectedMetaErr string
DetailsScroll int
FocusedPane int // 0 = list, 1 = details
// contains filtered or unexported fields
}
ViewModel stores state and behavior for the dependencies management screen.
func NewViewModel ¶
func NewViewModel() ViewModel
NewViewModel creates a ViewModel with default inputs and detected manager.