Help us shape the future of Go! Take the 2026 Go Developer Survey

tui

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package tui provides the default Overmind terminal screen.

Index

Constants

This section is empty.

Variables

View Source
var ErrSetupCancelled = errors.New("setup cancelled")

ErrSetupCancelled means setup exited without submitting valid settings.

Functions

func Run

func Run(
	ctx context.Context,
	listNotes ListNotesFunc,
	reindex ReindexFunc,
	deleteNote DeleteNoteFunc,
	createInbox CreateInboxFunc,
	createPage CreatePageFunc,
	createBookmark CreateBookmarkFunc,
	createJournal CreateJournalFunc,
	getJournal GetJournalFunc,
	updateJournal UpdateJournalFunc,
	createHabit CreateHabitFunc,
	createPerson CreatePersonFunc,
	listGroups ListGroupsFunc,
	newEditClient EditClientFactory,
	newRawEditClient RawEditClientFactory,
) error

Run opens the TUI with application callbacks and restores the terminal on exit. Unfinished raw-edit drafts are retained and their paths are reported afterward.

func RunSetup added in v0.4.0

func RunSetup(ctx context.Context, defaults appconfig.Settings, path string) (appconfig.Settings, error)

RunSetup opens the shared form with editable defaults and returns the submitted settings. The CLI creates the configuration only after this form has completed successfully.

Types

type CreateBookmarkFunc added in v0.4.0

type CreateBookmarkFunc func(context.Context, bookmark.CreateCommand) (bookmark.CreateResult, error)

CreateBookmarkFunc connects form submissions to the bookmark creation use case.

type CreateHabitFunc added in v0.4.0

type CreateHabitFunc func(context.Context, habit.CreateCommand) (habit.CreateResult, error)

CreateHabitFunc connects form submissions to the habit creation use case.

type CreateInboxFunc added in v0.4.0

type CreateInboxFunc func(context.Context, inbox.CreateCommand) (inbox.CreateResult, error)

CreateInboxFunc connects form submissions to the inbox creation use case.

type CreateJournalFunc added in v0.4.0

CreateJournalFunc connects form submissions to the journal creation use case.

type CreatePageFunc added in v0.4.0

type CreatePageFunc func(context.Context, page.CreateCommand) (page.CreateResult, error)

CreatePageFunc connects form submissions to the page creation use case.

type CreatePersonFunc added in v0.4.0

type CreatePersonFunc func(context.Context, person.CreateCommand) (person.CreateResult, error)

CreatePersonFunc connects form submissions to the person creation use case.

type DeleteNoteFunc added in v0.3.0

type DeleteNoteFunc func(context.Context, notes.DeleteCommand) (notes.DeleteResult, error)

DeleteNoteFunc removes the selected source document and its index projection.

type EditClient added in v0.4.0

type EditClient interface {
	// GetHabit loads and verifies the requested habit document.
	GetHabit(context.Context, habit.GetQuery) (habit.GetResult, error)
	// UpdateHabit replaces editable habit values while preserving identity and creation time.
	UpdateHabit(context.Context, habit.UpdateCommand) (habit.UpdateResult, error)
	// GetPerson loads and verifies the requested person document.
	GetPerson(context.Context, person.GetQuery) (person.GetResult, error)
	// UpdatePerson replaces editable person values while preserving identity and creation time.
	UpdatePerson(context.Context, person.UpdateCommand) (person.UpdateResult, error)
	// GetBookmark loads and verifies the requested bookmark document.
	GetBookmark(context.Context, bookmark.GetQuery) (bookmark.GetResult, error)
	// UpdateBookmark replaces editable bookmark values while preserving identity and creation time.
	UpdateBookmark(context.Context, bookmark.UpdateCommand) (bookmark.UpdateResult, error)
	// GetInbox loads and verifies the requested inbox document.
	GetInbox(context.Context, inbox.GetQuery) (inbox.GetResult, error)
	// UpdateInbox replaces editable inbox values while preserving identity and creation time.
	UpdateInbox(context.Context, inbox.UpdateCommand) (inbox.UpdateResult, error)
	// GetPage loads and verifies the requested page document.
	GetPage(context.Context, page.GetQuery) (page.GetResult, error)
	// UpdatePage replaces editable page values while preserving identity and creation time.
	UpdatePage(context.Context, page.UpdateCommand) (page.UpdateResult, error)
	// GetJournal loads and verifies the requested journal document.
	GetJournal(context.Context, journal.GetQuery) (journal.GetResult, error)
	// UpdateJournal replaces editable journal values while preserving identity and creation time.
	UpdateJournal(context.Context, journal.UpdateCommand) (journal.UpdateResult, error)
}

EditClient supplies the typed operations used by the shared edit forms.

type EditClientFactory added in v0.4.0

type EditClientFactory func(context.Context) (EditClient, error)

EditClientFactory resolves the typed client for loading and saving note forms.

type GetJournalFunc added in v0.4.0

type GetJournalFunc func(context.Context, appjournal.GetQuery) (appjournal.GetResult, error)

GetJournalFunc loads the document selected for today's journal.

type ListGroupsFunc added in v0.4.0

ListGroupsFunc provides existing group names for person membership selection.

type ListNotesFunc added in v0.3.0

type ListNotesFunc func(context.Context, notes.ListQuery) (notes.ListResult, error)

ListNotesFunc lets the TUI query notes through a local or remote client.

type RawEditClient added in v0.4.0

type RawEditClient interface {
	// GetRawNote loads managed source without requiring a valid body.
	GetRawNote(context.Context, rawedit.GetQuery) (rawedit.GetResult, error)
	// UpdateRawNote validates and saves source, reporting partial index failures.
	UpdateRawNote(context.Context, rawedit.UpdateCommand) (rawedit.UpdateResult, error)
}

RawEditClient supplies source reads and validated writes; the TUI owns only the external-editor process and its private draft files.

type RawEditClientFactory added in v0.4.0

type RawEditClientFactory func(context.Context) (RawEditClient, error)

RawEditClientFactory resolves the client when a raw-edit operation starts.

type ReindexFunc added in v0.3.0

ReindexFunc rebuilds searchable projections from the vault documents.

type UpdateJournalFunc added in v0.4.0

UpdateJournalFunc persists journal content and tags without changing its date.

Jump to

Keyboard shortcuts

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