views

package
v0.0.0-...-60f5ded Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 15 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 views is Physa's views in a Rex layer: the ideas in a repo, an idea's page with its pursuit, and adding an idea, each a bubbletea model drawn with rexuikit's components in Physa's look.

The views read and act only through the engine's API (Physa's vision §10), behind Source so they can be tested without an engine. Their words are Physa's glossary words, and no screen shows an internal identifier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Add

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

Add is the add-an-idea view: one field for the idea, then what the engine made of it. The idea belongs to the person who adds it.

func NewAdd

func NewAdd(src Source, profile colorprofile.Profile) *Add

NewAdd returns the add-an-idea view over src.

func (*Add) Init

func (m *Add) Init() tea.Cmd

func (*Add) NaturalSize

func (m *Add) NaturalSize() (cols, rows int)

NaturalSize is the size a layer should open at.

func (*Add) Update

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

func (*Add) View

func (m *Add) View() tea.View

type Engine

type Engine struct {
	Dial func(context.Context) (*client.Client, error)
	Repo string
	// contains filtered or unexported fields
}

Engine is a Source over the machine's engine, for one repo. The engine names the person who adds an idea, as the CLI does. It dials on the first call, after the view has painted, so starting the engine never delays the first frame.

func (*Engine) Add

func (e *Engine) Add(ctx context.Context, text string) (client.IdeaOut, error)

func (*Engine) Close

func (e *Engine) Close() error

Close closes the connection, if there is one.

func (*Engine) Idea

func (e *Engine) Idea(ctx context.Context, slug string) (client.IdeaOut, error)

func (*Engine) Ideas

func (e *Engine) Ideas(ctx context.Context) ([]client.IdeaOut, error)

func (*Engine) Pursuit

func (e *Engine) Pursuit(ctx context.Context, slug string) (client.PursuitOut, error)

type Ideas

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

Ideas is the ideas view: the repo's ideas, newest first, filterable by typing; enter opens an idea's page and esc on the page comes back.

func NewIdeas

func NewIdeas(src Source, profile colorprofile.Profile) *Ideas

NewIdeas returns the ideas view over src.

func (*Ideas) Init

func (m *Ideas) Init() tea.Cmd

func (*Ideas) Update

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

func (*Ideas) View

func (m *Ideas) View() tea.View

type Source

type Source interface {
	Ideas(ctx context.Context) ([]client.IdeaOut, error)
	Idea(ctx context.Context, slug string) (client.IdeaOut, error)
	Pursuit(ctx context.Context, slug string) (client.PursuitOut, error)
	Add(ctx context.Context, text string) (client.IdeaOut, error)
}

Source is what the views need from the engine.

Jump to

Keyboard shortcuts

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