components

package
v14.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package dialog contains shared components to build full dialog screens out of.

Index

Constants

View Source
const TestInputKey = "GITTOWN_DIALOG_INPUT"

TestInputKey specifies the name of environment variables containing input for dialogs in end-to-end tests.

View Source
const WindowSize = 9

how many elements to display in the dialog

Variables

This section is empty.

Functions

func FormattedSecret

func FormattedSecret(secret string, aborted bool) string

FormattedToken provides the given API token in a printable format.

func FormattedSelection

func FormattedSelection(selection string, aborted bool) string

FormattedSelection provides the given dialog choice in a printable format.

func FormattedToken

func FormattedToken(token string, aborted bool) string

FormattedToken provides the given API token in a printable format.

func RadioList

func RadioList[S fmt.Stringer](entries list.Entries[S], cursor int, title, help string, inputs TestInput) (selected S, aborted bool, err error)

RadioList lets the user select a new main branch for this repo.

func SendInputs

func SendInputs(inputs TestInput, program *tea.Program)

SendInputs sends the given keystrokes to the given bubbletea program.

func TextDisplay

func TextDisplay(title, text string, inputs TestInput) (bool, error)

func TextField

func TextField(args TextFieldArgs) (string, bool, error)

Types

type TestInput

type TestInput []tea.Msg

TestInput contains the input for a single dialog in an end-to-end test.

func ParseTestInput

func ParseTestInput(envData string) TestInput

ParseTestInput converts the given input data in the environment variable format into the format understood by Git Town's dialogs.

type TestInputs

type TestInputs []TestInput

TestInputs contains the input for all dialogs in an end-to-end test.

func LoadTestInputs

func LoadTestInputs(environmenttVariables []string) TestInputs

LoadTestInputs provides the TestInputs to use in an end-to-end test, taken from the given environment variable snapshot.

func (*TestInputs) Next

func (self *TestInputs) Next() TestInput

Next provides the TestInput for the next dialog in an end-to-end test.

type TextFieldArgs

type TextFieldArgs struct {
	ExistingValue string
	Help          string
	Prompt        string
	TestInput     TestInput
	Title         string
}

Directories

Path Synopsis
Package list provides a generic list implementation to be used inside BubbleTea-based dialog components.
Package list provides a generic list implementation to be used inside BubbleTea-based dialog components.

Jump to

Keyboard shortcuts

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