tui

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderDescription added in v1.12.0

func RenderDescription(textile string, width int) string

RenderDescription converts textile markup to styled terminal output.

func RunBrowser

func RunBrowser(issues []models.Issue, serverURL string) error

RunBrowser starts the interactive issue browser.

func RunSearchBrowser

func RunSearchBrowser(initialResults []models.SearchResult, initialQuery string, serverURL string, searchFn SearchFunc) error

RunSearchBrowser starts the interactive search result browser.

func RunSelector

func RunSelector(title string, items []SelectItem) (string, error)

RunSelector presents a selection list and returns the chosen value.

func TextileToMarkdown added in v1.12.0

func TextileToMarkdown(input string) string

TextileToMarkdown converts common Redmine textile markup to markdown.

Types

type BrowserModel

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

BrowserModel is the bubbletea model for the issue browser.

func NewBrowserModel

func NewBrowserModel(issues []models.Issue, serverURL string) BrowserModel

NewBrowserModel creates a new browser model.

func (BrowserModel) Init

func (m BrowserModel) Init() tea.Cmd

Init implements tea.Model.

func (BrowserModel) Update

func (m BrowserModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (BrowserModel) View

func (m BrowserModel) View() string

View implements tea.Model.

type DetailPane added in v1.12.0

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

DetailPane is a scrollable detail pane with selectable fields.

func NewDetailPane added in v1.12.0

func NewDetailPane(serverURL string) DetailPane

NewDetailPane creates a new detail pane.

func (*DetailPane) SetIssueContent added in v1.12.0

func (d *DetailPane) SetIssueContent(issue *models.Issue)

SetIssueContent builds and sets the content for an issue.

func (*DetailPane) SetSearchContent added in v1.12.0

func (d *DetailPane) SetSearchContent(result *models.SearchResult)

SetSearchContent builds and sets the content for a search result.

func (*DetailPane) SetSize added in v1.12.0

func (d *DetailPane) SetSize(width, height int)

SetSize updates the pane dimensions and re-renders the description.

func (*DetailPane) Update added in v1.12.0

func (d *DetailPane) Update(msg tea.Msg, keys KeyMap) tea.Cmd

Update handles key events for field navigation, scrolling, and clipboard.

func (*DetailPane) ViewFocused added in v1.12.0

func (d *DetailPane) ViewFocused(focused bool) string

ViewFocused renders the detail pane. Pass focused=true to highlight the border.

type IssueFormData

type IssueFormData struct {
	Subject     string
	Description string
	TrackerID   string
	PriorityID  string
	AssigneeID  string
}

IssueFormData holds data collected from the issue creation form.

func RunIssueForm

func RunIssueForm(trackers, priorities, assignees []SelectItem) (*IssueFormData, error)

RunIssueForm runs an interactive form for creating an issue.

type KeyMap

type KeyMap struct {
	Up          key.Binding
	Down        key.Binding
	Enter       key.Binding
	Back        key.Binding
	Filter      key.Binding
	Quit        key.Binding
	Help        key.Binding
	CopyID      key.Binding
	CopyURL     key.Binding
	ToggleFocus key.Binding
	PageUp      key.Binding
	PageDown    key.Binding
	OpenBrowser key.Binding
}

KeyMap defines key bindings for the TUI.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings.

type SearchBrowserModel

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

SearchBrowserModel is the bubbletea model for the search result browser.

func NewSearchBrowserModel

func NewSearchBrowserModel(initialResults []models.SearchResult, initialQuery string, serverURL string, searchFn SearchFunc) SearchBrowserModel

NewSearchBrowserModel creates a new search browser model.

func (SearchBrowserModel) Init

func (m SearchBrowserModel) Init() tea.Cmd

Init implements tea.Model.

func (SearchBrowserModel) Update

func (m SearchBrowserModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (SearchBrowserModel) View

func (m SearchBrowserModel) View() string

View implements tea.Model.

type SearchFunc added in v1.12.0

type SearchFunc func(query string) ([]models.SearchResult, error)

SearchFunc performs a search and returns results.

type SelectItem

type SelectItem struct {
	Label string
	Value string
}

SelectItem represents an item for selection.

type TimeEntryFormData

type TimeEntryFormData struct {
	Hours    string
	Comment  string
	Activity string
	Date     string
}

TimeEntryFormData holds data collected from the time entry form.

func RunTimeEntryForm

func RunTimeEntryForm(activities []SelectItem) (*TimeEntryFormData, error)

RunTimeEntryForm runs an interactive form for logging time.

Jump to

Keyboard shortcuts

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