tui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 17 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 is the terminal editor behind `mnemos edit`: three panes over one OKF document — its link-graph neighborhood, its frontmatter fields, and its body — with the index kept in sync on save.

The panes are one flat Model rather than nested tea.Models. They are tightly coupled (unsaved metadata gates navigation, the $EDITOR shell-out suspends the whole program), so keeping the save/dirty/history logic in one Update is simpler than routing messages between a parent and three children.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is the editor state for one document at a time.

func NewEditModel

func NewEditModel(ctx context.Context, svc *memory.Service, uri string) (Model, error)

NewEditModel loads uri and builds the editor over it. It fails when the document cannot be opened, so `mnemos edit` reports a bad uri on the terminal it was invoked from rather than inside an alternate screen.

func (Model) Init

func (Model) Init() tea.Cmd

Init implements tea.Model. The document is already loaded, so there is no startup command.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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