tui

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Title    = "NW – Next Watch"
	Subtitle = "A TUI utility for selecting films to watch from Letterboxd (powered by TMDB)."
	License  = `` /* 776-byte string literal not displayed */

)
View Source
const SplashText = " NW Loading...  "

Variables

View Source
var (
	About = strings.Join([]string{
		lipgloss.NewStyle().Bold(true).Render(fmt.Sprintf("%s (%s)", Title, app.Version)),
		lipgloss.NewStyle().Italic(true).Render(Subtitle),
		popupTextStyle.Render(License),
	}, "\n")
)
View Source
var NoRebind = []string{}

Functions

func AskQuestion

func AskQuestion(question, placeholder string) string

func GoBack

func GoBack() tea.Msg

func MakeSplashScreen

func MakeSplashScreen() (tea.Model, tea.Cmd)

func NWDeleteFilm

func NWDeleteFilm() tea.Msg

func NewFilmDetailsCmd added in v0.2.1

func NewFilmDetailsCmd(film *app.Film) tea.Cmd

func RunApplicationTUI

func RunApplicationTUI(username string) error

func UpdateScreen

func UpdateScreen() tea.Msg

Types

type AddListsScreen

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

func MakeAddListScreen

func MakeAddListScreen(a *ApplicationTUI) *AddListsScreen

func (*AddListsScreen) Init

func (al *AddListsScreen) Init() tea.Cmd

func (*AddListsScreen) Update

func (al *AddListsScreen) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*AddListsScreen) View

func (al *AddListsScreen) View() string

type ApplicationTUI

type ApplicationTUI struct {
	*app.Application
	// contains filtered or unexported fields
}

Main model struct that drives NW TUI

func (*ApplicationTUI) AskYesNo

func (a *ApplicationTUI) AskYesNo(question string, callback func(bool) tea.Msg)

func (*ApplicationTUI) Init

func (a *ApplicationTUI) Init() tea.Cmd

func (*ApplicationTUI) Popup

func (a *ApplicationTUI) Popup(text string)

func (*ApplicationTUI) TooSmall added in v0.1.8

func (a *ApplicationTUI) TooSmall() bool

func (*ApplicationTUI) Update

func (a *ApplicationTUI) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ApplicationTUI) UpdateRouter

func (a *ApplicationTUI) UpdateRouter(msg tea.Msg) []tea.Cmd

Handle update routing with overlays

func (*ApplicationTUI) View

func (a *ApplicationTUI) View() string

type FilmAction

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

type FilmDetailsModel

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

func MakeFilmDetailsModel

func MakeFilmDetailsModel(f *app.Film, a *ApplicationTUI) *FilmDetailsModel

func MakeFilmDetailsModelFromResults

func MakeFilmDetailsModelFromResults(f tmdb.MovieResult, a *ApplicationTUI) *FilmDetailsModel

func (*FilmDetailsModel) Focus

func (fd *FilmDetailsModel) Focus()

func (*FilmDetailsModel) Init

func (fd *FilmDetailsModel) Init() tea.Cmd

func (*FilmDetailsModel) Unfocus

func (fd *FilmDetailsModel) Unfocus()

func (*FilmDetailsModel) Update

func (fd *FilmDetailsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*FilmDetailsModel) View

func (fd *FilmDetailsModel) View() string

type FilmResultItem

type FilmResultItem tmdb.MovieResult

func (FilmResultItem) FilterValue

func (fi FilmResultItem) FilterValue() string

func (FilmResultItem) String

func (fi FilmResultItem) String() string

type GoBackMsg

type GoBackMsg struct{}

type JoinModel

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

Bubbletea model joining two other models; it passes all updates to both

func (*JoinModel) Init

func (jm *JoinModel) Init() tea.Cmd

func (*JoinModel) Update

func (jm *JoinModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*JoinModel) View

func (jm *JoinModel) View() string

type ListSelector

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

Model for viewing and selecting film lists. It is used for both view and searching through lists.

func MakeListSelector

func MakeListSelector(a *ApplicationTUI, title string, items []list.Item, delegate list.ItemDelegate) *ListSelector

func MakeViewListPane

func MakeViewListPane(a *ApplicationTUI) *ListSelector

func (*ListSelector) Focus

func (ls *ListSelector) Focus() tea.Cmd

func (*ListSelector) Init

func (ls *ListSelector) Init() tea.Cmd

func (*ListSelector) Unfocus

func (ls *ListSelector) Unfocus()

func (*ListSelector) Update

func (ls *ListSelector) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ListSelector) View

func (ls *ListSelector) View() string

type MainScreen

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

func MakeMainScreen

func MakeMainScreen(a *ApplicationTUI) *MainScreen

func (*MainScreen) Init

func (ms *MainScreen) Init() tea.Cmd

func (*MainScreen) NewFilmDetails

func (ms *MainScreen) NewFilmDetails(film app.Film)

func (*MainScreen) Update

func (ms *MainScreen) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*MainScreen) View

func (ms *MainScreen) View() string

type MainScreenPanes added in v0.2.0

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

Panes on the Main Screen which focus can be toggled between

func (*MainScreenPanes) Init added in v0.2.0

func (p *MainScreenPanes) Init() tea.Cmd

func (*MainScreenPanes) Update added in v0.2.0

func (p *MainScreenPanes) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*MainScreenPanes) View added in v0.2.0

func (p *MainScreenPanes) View() string

type Message

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

type NWModel

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

func MakeNWModel

func MakeNWModel(a *ApplicationTUI) *NWModel

func (*NWModel) Focus

func (nw *NWModel) Focus() tea.Cmd

func (*NWModel) Init

func (nw *NWModel) Init() tea.Cmd

func (*NWModel) Unfocus

func (nw *NWModel) Unfocus()

func (*NWModel) Update

func (nw *NWModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*NWModel) View

func (nw *NWModel) View() string

type NewFilmDetailsMsg

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

type PopupModel

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

func (*PopupModel) Init

func (pm *PopupModel) Init() tea.Cmd

func (*PopupModel) Update

func (pm *PopupModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*PopupModel) View

func (pm *PopupModel) View() string

type Question

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

func (*Question) Init

func (q *Question) Init() tea.Cmd

func (*Question) Update

func (q *Question) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Question) View

func (q *Question) View() string

type ResizeLockModel

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

func (*ResizeLockModel) Init

func (fl *ResizeLockModel) Init() tea.Cmd

func (*ResizeLockModel) Update

func (fl *ResizeLockModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ResizeLockModel) View

func (fl *ResizeLockModel) View() string

type ScreenStack

type ScreenStack []tea.Model

type SearchFilms

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

func MakeSearchFilms

func MakeSearchFilms(a *ApplicationTUI) *SearchFilms

func (*SearchFilms) Init

func (sf *SearchFilms) Init() tea.Cmd

func (*SearchFilms) Update

func (sf *SearchFilms) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*SearchFilms) View

func (sf *SearchFilms) View() string

type SearchModel

type SearchModel struct {
	ListSelector
	// contains filtered or unexported fields
}

Model with text search input and list of results below

func MakeSearchListPane

func MakeSearchListPane(a *ApplicationTUI) *SearchModel

func MakeSearchModel

func MakeSearchModel(
	a *ApplicationTUI,
	items []list.Item,
	searchText string,
	delegate list.ItemDelegate,
	defaultMode mode,
	inputAction func(string) tea.Cmd,
	queryAction func(string, list.Item) tea.Cmd,
) *SearchModel

func (*SearchModel) Focus

func (sm *SearchModel) Focus()

func (*SearchModel) Init

func (sm *SearchModel) Init() tea.Cmd

func (*SearchModel) Unfocus

func (sm *SearchModel) Unfocus()

func (*SearchModel) Update

func (sm *SearchModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*SearchModel) View

func (sm *SearchModel) View() string

type SplashScreenModel

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

func (*SplashScreenModel) Init

func (ss *SplashScreenModel) Init() tea.Cmd

func (*SplashScreenModel) SetError

func (ss *SplashScreenModel) SetError(err error)

func (*SplashScreenModel) Update

func (ss *SplashScreenModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*SplashScreenModel) View

func (ss *SplashScreenModel) View() string

type StatusBarModel

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

func MakeStatusBar

func MakeStatusBar(a *ApplicationTUI) *StatusBarModel

func (*StatusBarModel) Init

func (sb *StatusBarModel) Init() tea.Cmd

func (*StatusBarModel) Update

func (sb *StatusBarModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*StatusBarModel) View

func (sb *StatusBarModel) View() string

type UpdateScreenMsg

type UpdateScreenMsg struct{}

type UpdateSearchFilterMsg

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

type UpdateSearchItemsMsg

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

type YesNoPrompt

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

Model for yes no question pop-up

func (*YesNoPrompt) Init

func (p *YesNoPrompt) Init() tea.Cmd

func (*YesNoPrompt) Update

func (p *YesNoPrompt) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*YesNoPrompt) View

func (p *YesNoPrompt) View() string

type YesNoResponseMsg

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

Response to prompt: Yes [true] No [false]

Jump to

Keyboard shortcuts

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