tui

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tui holds the tabs of `doit tui`, each a gotermboard board.

Index

Constants

View Source
const NowTab = "now"

NowTab is the tab of today's rows on the desk nudge panel.

Variables

This section is empty.

Functions

func DisplayFile

func DisplayFile() string

DisplayFile is where the live program keeps each tab's display and the tab last moved to.

func Print

func Print(ctx context.Context, out io.Writer, in Inputs, view string, asJSON bool, pal gotermstyle.Palette) error

Print reads the tab view names once, the first where it names none, and prints its frame, or its snapshot where asJSON is set. It builds no other tab.

func Program

func Program(in Inputs, pal gotermstyle.Palette, view string) (*gotermboard.Tabs, error)

Program is the live program of every tab, keeping its display in DisplayFile. It opens on the tab that view names. With no view, it opens where the last run was left.

func TabNames

func TabNames() []string

TabNames is every tab's name, in the order Tab cycles them.

Types

type DeskPanel

type DeskPanel struct{ Desk *desknudge.Desk }

DeskPanel is this desk's panel. Show reads it as `doit desk-nudge panel show` does, from the files the watch writes, and Pick hands a key to the watch as `doit desk-nudge panel pick` does.

func (DeskPanel) Pick

func (p DeskPanel) Pick(ctx context.Context, key string) (desknudge.Panel, error)

Pick sets no bound of its own, and takes the one AskPick sets.

func (DeskPanel) Show

func (p DeskPanel) Show() desknudge.Panel

type Inputs

type Inputs struct {
	// Panel is the desk nudge panel, which the now tab reads and picks through.
	Panel Panel
}

Inputs is what the tabs' boards are built from.

type NowBoard

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

NowBoard is the now tab: the suggestion, the answers while a nudge is ready, and every row of today that something completes, each completed by a click or a key.

func NewNowBoard

func NewNowBoard(p Panel) *NowBoard

func (*NowBoard) Actions

func (b *NowBoard) Actions() []gotermboard.Action

Actions puts each of a ready nudge's answers on a number, in the order the panel lists them.

func (*NowBoard) Frame

func (b *NowBoard) Frame(now time.Time, _ string) gotermboard.Frame

Frame draws the suggestion first, then each completion row under the group the panel names for it, in the order the panel lists them.

func (*NowBoard) Groupings

func (b *NowBoard) Groupings() []string

func (*NowBoard) Receive

func (b *NowBoard) Receive(m *gotermboard.Model, msg tea.Msg) tea.Cmd

func (*NowBoard) Snapshot

func (b *NowBoard) Snapshot(time.Time) desknudge.Panel

Snapshot is the tab's panel document, as `doit desk-nudge panel show --json` prints it.

func (*NowBoard) Sources

func (b *NowBoard) Sources() []gotermboard.Refresher

func (*NowBoard) UnderWay

func (b *NowBoard) UnderWay() string

type Panel

type Panel interface {
	Show() desknudge.Panel
	Pick(ctx context.Context, key string) (desknudge.Panel, error)
}

Panel is how the now tab reaches the desk nudge panel, which holds every rule about what a row is and what a pick does.

Jump to

Keyboard shortcuts

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