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 ¶
- type Add
- type Engine
- func (e *Engine) Add(ctx context.Context, text string) (client.IdeaOut, error)
- func (e *Engine) Close() error
- func (e *Engine) Idea(ctx context.Context, slug string) (client.IdeaOut, error)
- func (e *Engine) Ideas(ctx context.Context) ([]client.IdeaOut, error)
- func (e *Engine) Pursuit(ctx context.Context, slug string) (client.PursuitOut, error)
- type Ideas
- type Source
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) NaturalSize ¶
NaturalSize is the size a layer should open at.
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.
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.
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.