input

package
v0.10.8 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package input is the TUI's shared text-entry substrate: thin themed wrappers over bubbles/textinput and textarea, plus the external-editor hop. Every prompt in the dashboard (filter, JQL, action verbs) goes through here, so cursor movement, word-wise editing and bracketed paste behave identically everywhere — replacing the hand-rolled append-only buffers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Edit

func Edit(id, initial string) tea.Cmd

Edit suspends the TUI and opens the external editor on a temp file seeded with initial; the result returns as an EditorFinishedMsg. The editor value runs through the shell so commands with flags ("nvim -f") work.

func EditorCommand

func EditorCommand() string

EditorCommand returns the configured external editor: $JIRA_EDITOR wins, $EDITOR is the fallback, "" means none — multiline fields then use the in-TUI textarea instead. One rule, no per-field knobs.

Types

type Area

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

Area is a multiline input, the in-TUI fallback when no external editor is configured. The zero value is not usable; construct with NewArea.

func NewArea

func NewArea(placeholder string, width, height int) Area

NewArea builds a focused multiline input sized for a modal.

func (*Area) SetValue

func (a *Area) SetValue(s string)

SetValue replaces the content (e.g. reopening a draft).

func (*Area) Update

func (a *Area) Update(msg tea.Msg) tea.Cmd

Update routes a message into the textarea (enter inserts a newline).

func (Area) Value

func (a Area) Value() string

Value returns the current content.

func (Area) View

func (a Area) View() string

View renders the textarea.

type EditorFinishedMsg

type EditorFinishedMsg struct {
	ID   string
	Text string
	Err  error
}

EditorFinishedMsg delivers the text written in the external editor. ID is the opener's routing tag (e.g. "comment:JCT-12") so the consumer knows which flow to resume. Err is set when the editor could not run or the buffer could not be read back.

type Line

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

Line is a single-line input. The zero value is not usable; construct with NewLine.

func NewLine

func NewLine(prompt, placeholder string) Line

NewLine builds a focused single-line input with the given prompt and placeholder.

func (*Line) SetSuggestions

func (l *Line) SetSuggestions(values []string)

SetSuggestions enables ghost-text autocompletion over the given values: typing a prefix shows the rest faint, and the textinput's accept binding (tab / ctrl+e / right at end) completes it.

func (*Line) SetValue

func (l *Line) SetValue(s string)

SetValue replaces the content and moves the cursor to the end (the natural spot when prefilling, e.g. the current summary for an edit).

func (*Line) SetWidth

func (l *Line) SetWidth(w int)

SetWidth bounds the rendered width, clamped to at least one column so a too-narrow pane can never push a negative width into the textinput (which panics on View).

func (Line) Suggestions

func (l Line) Suggestions() []string

Suggestions returns the current completion values.

func (*Line) Update

func (l *Line) Update(msg tea.Msg) tea.Cmd

Update routes a message (keys, paste) into the input.

func (Line) Value

func (l Line) Value() string

Value returns the current content.

func (Line) View

func (l Line) View() string

View renders the input with its cursor.

Jump to

Keyboard shortcuts

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