Documentation
¶
Overview ¶
Tiling window manager for terminal cards with workspaces, floating dialogs, a command palette and spring motion
Index ¶
- Constants
- Variables
- func Notify(text string, level Level) tea.Cmd
- func RequestAttention(from Card, u Urgency) tea.Cmd
- func RequestClose(from Card) tea.Cmd
- func RequestDismissOf(from Card) tea.Cmd
- func RequestOverlay(card Card) tea.Cmd
- type ActionMsg
- type Addressed
- type Animator
- type Backer
- type Box
- type Card
- type Closable
- type ClosedMsg
- type Command
- type Contexter
- type Cursorer
- type Dir
- type Fitter
- type FloatLayout
- type Floater
- type FocusMsg
- type Footer
- type FooterLine
- type FooterSpan
- type Glypher
- type Grabber
- type Guarded
- type Hint
- type Hinter
- type Holder
- type Intent
- type Item
- type Keyed
- type Lane
- type Layout
- type Level
- type Mode
- type Model
- func (m *Model) Active() *Workspace
- func (m *Model) ActiveIndex() int
- func (m *Model) AddWorkspace(id string, cards ...Card) (*Workspace, tea.Cmd)
- func (m *Model) Advance(dt float64) bool
- func (m *Model) As(owner any, fn func() tea.Cmd) tea.Cmd
- func (m *Model) Attach(card, sheet Card) tea.Cmd
- func (m *Model) Attached(sheet Card) bool
- func (m *Model) Attention(c Card, u Urgency) tea.Cmd
- func (m *Model) Capturing() bool
- func (m *Model) Cascade() bool
- func (m *Model) Close(c Card) tea.Cmd
- func (m *Model) CloseFocused() tea.Cmd
- func (m *Model) CloseKey(key string) tea.Cmd
- func (m *Model) CloseWorkspace() tea.Cmd
- func (m *Model) Commands() []Command
- func (m *Model) Cycle(k int) tea.Cmd
- func (m *Model) CycleTab(d int) tea.Cmd
- func (m *Model) Detach(sheet Card) tea.Cmd
- func (m *Model) Dismiss() tea.Cmd
- func (m *Model) DismissCard(c Card) tea.Cmd
- func (m *Model) Find(key string) (Card, *Workspace)
- func (m *Model) Fire(id string) tea.Cmd
- func (m *Model) Fits(ws *Workspace, c Card) bool
- func (m *Model) FlipSplit() tea.Cmd
- func (m *Model) Focus(c Card) tea.Cmd
- func (m *Model) FocusAttention() tea.Cmd
- func (m *Model) FocusDir(d Dir) tea.Cmd
- func (m *Model) Focused() Card
- func (m *Model) FrameOf(c Card) (Box, bool)
- func (m *Model) Has(key string) bool
- func (m *Model) IndexOf(ws *Workspace) int
- func (m *Model) Init() tea.Cmd
- func (m *Model) JoinTab() tea.Cmd
- func (m *Model) Keys() *keys.Map
- func (m *Model) Layout() Layout
- func (m *Model) Motion() float64
- func (m *Model) Move(d Dir) tea.Cmd
- func (m *Model) NewWorkspace() tea.Cmd
- func (m *Model) OnToast(fn func(text string, level Level))
- func (m *Model) Open(ws *Workspace, c Card) tea.Cmd
- func (m *Model) OpenAside(ws *Workspace, c Card, origin Box) tea.Cmd
- func (m *Model) OpenFrom(ws *Workspace, c Card, origin Box) tea.Cmd
- func (m *Model) OpenHere(c Card) tea.Cmd
- func (m *Model) OpenPalette() tea.Cmd
- func (m *Model) OpenTab(c Card) tea.Cmd
- func (m *Model) Overlay() Card
- func (m *Model) OwnerOf(c Card) any
- func (m *Model) Ratio() float64
- func (m *Model) RemoveWorkspace(i int) tea.Cmd
- func (m *Model) Repaint()
- func (m *Model) ResetLayout() tea.Cmd
- func (m *Model) Resize(delta float64) tea.Cmd
- func (m *Model) Resting() bool
- func (m *Model) Restore(l Layout)
- func (m *Model) RestoreWorkspace(ws *Workspace, l WorkspaceLayout, resolve func(key string) Card) tea.Cmd
- func (m *Model) Run(id string) tea.Cmd
- func (m *Model) ScreenFrameOf(c Card) (Box, bool)
- func (m *Model) Selected() string
- func (m *Model) SetBar(fn func() Status)
- func (m *Model) SetCascade(on bool)
- func (m *Model) SetCommandSource(source func() []Command)
- func (m *Model) SetEmptyHints(ids ...string)
- func (m *Model) SetKeys(km *keys.Map)
- func (m *Model) SetLayout(mode Mode) tea.Cmd
- func (m *Model) SetMainCount(delta int) tea.Cmd
- func (m *Model) SetMotion(scale float64)
- func (m *Model) SetProgress(pb *tea.ProgressBar)
- func (m *Model) SetRatio(r float64) tea.Cmd
- func (m *Model) SetRoute(route func(owner any, cmd tea.Cmd) tea.Cmd)
- func (m *Model) SetSize(w, h int)
- func (m *Model) SetStatus(ps *tea.ProgramStatus)
- func (m *Model) SetTheme(t theme.Theme)
- func (m *Model) SetWindowTitle(title string)
- func (m *Model) Sheet(card Card) Card
- func (m *Model) ShowOverlay(c Card) tea.Cmd
- func (m *Model) ShowsOverlay(c Card) bool
- func (m *Model) Size() (int, int)
- func (m *Model) SplitTab() tea.Cmd
- func (m *Model) SwapMaster() tea.Cmd
- func (m *Model) Switch(i int) tea.Cmd
- func (m *Model) Theme() theme.Theme
- func (m *Model) Toast(text string, level Level, ttl time.Duration) tea.Cmd
- func (m *Model) ToastRegion() (Box, bool)
- func (m *Model) Toasts() []string
- func (m *Model) ToggleFloat() tea.Cmd
- func (m *Model) ToggleLayout() tea.Cmd
- func (m *Model) ToggleZoom() tea.Cmd
- func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *Model) UrgencyOf(c Card) Urgency
- func (m *Model) View() tea.View
- func (m *Model) Wake() tea.Cmd
- func (m *Model) WorkspaceByID(id string) *Workspace
- func (m *Model) WorkspaceOf(c Card) *Workspace
- func (m *Model) Workspaces() []*Workspace
- type Note
- type Notice
- type Option
- type Painter
- type Palette
- func (p *Palette) Animate(dt float64) bool
- func (p *Palette) Ask(text string, yes func() tea.Cmd)
- func (p *Palette) Asking() bool
- func (p *Palette) Back() bool
- func (p *Palette) Contexts() []string
- func (p *Palette) Glyph() string
- func (p *Palette) Hints() []Hint
- func (p *Palette) Init() tea.Cmd
- func (p *Palette) Input(w int, bg color.Color) (string, int)
- func (p *Palette) Key() string
- func (p *Palette) Lit() (Item, bool)
- func (p *Palette) Matches() []Item
- func (p *Palette) Query() string
- func (p *Palette) Rows() int
- func (p *Palette) Select(id string) bool
- func (p *Palette) SetItems(items []Item)
- func (p *Palette) SetQuery(text string)
- func (p *Palette) Status() string
- func (p *Palette) Tally() string
- func (p *Palette) Title() string
- func (p *Palette) Update(msg tea.Msg) (Card, tea.Cmd)
- func (p *Palette) View(w, h int) string
- type Passer
- type Positioned
- type Raw
- type Reporter
- type Segment
- type SegmentStyle
- type Selectable
- type SelfClosing
- type SheetHolder
- type Signal
- type Sized
- type SplitLayout
- type Stateful
- type Status
- type Statuser
- type Sticky
- type SweepScroller
- type Tabs
- func (g *Tabs) Active() (Card, int)
- func (g *Tabs) Animate(dt float64) bool
- func (g *Tabs) Awake() bool
- func (g *Tabs) Cards() []Card
- func (g *Tabs) Contexts() []string
- func (g *Tabs) Cursor() *tea.Cursor
- func (g *Tabs) Footer(room int) FooterLine
- func (g *Tabs) Glyph() string
- func (g *Tabs) Grabs(x, y int) bool
- func (g *Tabs) Hints() []Hint
- func (g *Tabs) Holds(c Card) bool
- func (g *Tabs) Init() tea.Cmd
- func (g *Tabs) Key() string
- func (g *Tabs) Len() int
- func (g *Tabs) MinSize() (int, int)
- func (g *Tabs) Passes(k tea.KeyPressMsg) bool
- func (g *Tabs) Raw() bool
- func (g *Tabs) Select(i int) tea.Cmd
- func (g *Tabs) Selectable() bool
- func (g *Tabs) SetState(raw json.RawMessage) error
- func (g *Tabs) SetTheme(t theme.Theme)
- func (g *Tabs) State() any
- func (g *Tabs) Status() string
- func (g *Tabs) Title() string
- func (g *Tabs) Tracks() bool
- func (g *Tabs) Update(msg tea.Msg) (Card, tea.Cmd)
- func (g *Tabs) View(w, h int) string
- type TapMsg
- type TileLayout
- type Tracker
- type Transparent
- type Urgency
- type Waker
- type WheelPasser
- type Workspace
- func (w *Workspace) Cards() []Card
- func (w *Workspace) Empty() bool
- func (w *Workspace) Focused() Card
- func (w *Workspace) MainCount() int
- func (w *Workspace) Master() Card
- func (w *Workspace) Mode() Mode
- func (w *Workspace) Ratio() float64
- func (w *Workspace) Urgent() bool
- func (w *Workspace) Zoomed() Card
- type WorkspaceLayout
Constants ¶
const DefaultToastTTL = 4 * time.Second
Default life of a toast
const SheetArmDelay = 600 * time.Millisecond
Quiet time after a sheet or a guarded overlay comes into view before keys and clicks reach it
Variables ¶
var HiddenText = func(above, below int) string { var parts []string if above > 0 { parts = append(parts, lang.T(txt.KitWmMoreAbove, above)) } if below > 0 { parts = append(parts, lang.T(txt.KitWmMoreBelow, below)) } return strings.Join(parts, " · ") }
Words for the rows a scrolled picker or table hides above and below, replaced by an app that speaks its own language
Functions ¶
func RequestAttention ¶
Asks the manager to glow the card with the urgency until it is focused, Calm clearing it
func RequestDismissOf ¶
Asks the manager to drop the overlay while it is still the card asking
func RequestOverlay ¶
Asks the manager to show a card above everything with first claim on input
Types ¶
type Addressed ¶ added in v1.0.10
type Addressed interface {
Addressee() Card
}
Message meant for one card alone, delivered to it instead of every card, even once it has closed
type Animator ¶
Card that moves on its own, given scaled seconds or zero to jump to rest, answering whether its view changed
type Backer ¶
type Backer interface {
Back() bool
}
Overlay with a step of its own behind the close key: Back takes the key for that step and reports true, false letting the overlay close
type Card ¶
type Card interface {
Title() string
Init() tea.Cmd
Update(tea.Msg) (Card, tea.Cmd)
View(width, height int) string
}
Panel the manager places, frames and feeds messages
type Closable ¶
type Closable interface {
Closable() bool
}
Card the close command leaves alone when it answers false
type ClosedMsg ¶
type ClosedMsg struct{}
Sent to a card once it is closed, before its frame has left the stage
type Command ¶
type Command struct {
ID string
Title string
// Title at the moment it is shown, for a title that follows the language of the application
Text func() string
// Reports whether the command applies right now, always when nil
When func() bool
Run func() tea.Cmd
}
Action the palette lists and the keymap fires, the manager's own or one the app registers
type Contexter ¶
type Contexter interface {
Contexts() []string
}
Card that names the keymap contexts in force while it holds the input, most specific first
type Fitter ¶
Card that sizes itself to the room it is given, the content columns and rows it takes within w by h
type FloatLayout ¶
Float by key with the box it rests in
type Floater ¶
type Floater interface {
Floating() bool
}
Card that opens as a floating dialog over the tiles
type FocusMsg ¶
type FocusMsg struct {
Focused bool
}
Sent to a card when it gains or loses the input focus
type Footer ¶
type Footer interface {
}
Card that paints a line of its own into its bottom edge, its status, given the columns the two parts may take together
type FooterLine ¶
type FooterLine struct {
Status a card paints into its bottom edge, a part at the left end and one at the right end with the border running between them
type FooterSpan ¶
type FooterSpan struct {
Columns of a footer part, counted from its first cell, that fire an action when clicked
type Grabber ¶ added in v1.0.11
Card with controls a press takes hold of, such as a scrollbar, the drag then following the pointer instead of sweeping text
type Guarded ¶
type Guarded interface {
Guarded() bool
}
Overlay that, like a sheet, holds its answer keys back for a moment after it appears and while a burst of typing goes on
type Hint ¶
type Hint struct {
Action string
// Second action shown with the first as a pair such as j/k
Pair string
// Word shown instead of the action label when set
Label string
// Every chord of the action the terminal can send, slash separated, instead of the first
All bool
}
One action a card answers, painted in the bottom edge of the focused card with its bound key
type Hinter ¶
type Hinter interface {
Hints() []Hint
}
Card that names the actions it answers while focused
type Intent ¶
type Intent struct {
From Card
// contains filtered or unexported fields
}
Request a card makes of the manager, delivered as a message it handles on its own
type Item ¶
type Item struct {
ID string
Title string
Detail string
Keys string
Run func() tea.Cmd
// Leaves the palette open when picked, for a row that changes what the palette shows
Stay bool
}
One row the palette offers
type Keyed ¶
type Keyed interface {
Key() string
}
Card with a stable identity, so opening it twice focuses the one already open
type Lane ¶
type Lane struct {
Name string
Signal Signal
// Text after the signal mark, such as the tool running and how long the run has taken
Detail string
}
Live state of one workspace as its chip shows it
type Layout ¶
type Layout struct {
Theme string `json:"theme,omitempty"`
Motion *float64 `json:"motion,omitempty"`
Ratio float64 `json:"ratio,omitempty"`
Mode string `json:"mode,omitempty"`
Main int `json:"main,omitempty"`
// Index of the workspace on the stage
Active int `json:"active,omitempty"`
// Command ids run lately, newest first
Recent []string `json:"recent,omitempty"`
Workspaces []WorkspaceLayout `json:"workspaces,omitempty"`
}
What the manager keeps between runs, the defaults new workspaces take and every open workspace as it stands
type Mode ¶
type Mode int
Arrangement of the tiles of a workspace, a master beside a stack or a spiral of splits
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Window manager that tiles cards per workspace, floats dialogs, animates every move and routes input
func New ¶
Builds a manager with the Blackwall theme, one cell gaps, a two column stage margin and 60 over 30 frames
func (*Model) ActiveIndex ¶
Index of the workspace shown on the stage
func (*Model) AddWorkspace ¶
Adds a workspace tiling the cards in order with the first focused, showing it when it is the first workspace
func (*Model) Advance ¶
Advances every animation by dt seconds and reports whether anything is still moving
func (*Model) Attach ¶
Shows the sheet inside the frame of the card that asked for it, queued behind the sheets that card already holds, the card glowing while it is not focused. A card that is not open shows the sheet as an overlay
func (*Model) Attention ¶
Lights the frame of the card with an urgency until it is focused, Calm turning it off
func (*Model) CloseFocused ¶
Closes the focused card when it allows closing
func (*Model) CloseWorkspace ¶
Closes the workspace on the stage through the app's workspace.close command, else directly
func (*Model) Cycle ¶
Moves focus k steps through the tiles and floats of the stage, wrapping at both ends
func (*Model) Detach ¶
Takes the sheet out of the card it sits in, the next one waiting there coming into view
func (*Model) Dismiss ¶
Drops the overlay and hands input back to the overlay it covered, else to the focused card, the sheet fading out behind the veil
func (*Model) DismissCard ¶
Closes the card wherever it waits, on top, held beneath another overlay or as a sheet in a card's frame
func (*Model) Fits ¶ added in v1.0.12
Reports whether the card could be tiled in the workspace with every tile at or above its least size
func (*Model) FlipSplit ¶
Flips the cut that holds the focused tile between side by side and stacked
func (*Model) FocusAttention ¶
Focuses the card a sheet waits in, the sheets in view first and the oldest first, then a card that glows for attention, skipping the focused card
func (*Model) FocusDir ¶
Moves focus to the nearest tile in the direction, floats first stepping back to the tiles
func (*Model) FrameOf ¶
Box the frame of the card is painted in on its stage right now, false when it is not open
func (*Model) JoinTab ¶
Moves the focused window into the tile beside it as its shown tab, the tile becoming a tab group
func (*Model) Move ¶
Trades the focused tile with its neighbor in the direction, or nudges a float by a few cells
func (*Model) NewWorkspace ¶
Opens a workspace the way the app's workspace.new command does, nudging when none is registered
func (*Model) Open ¶
Opens the card in the workspace, tiled or floating as it asks, or focuses the one with its key already open
func (*Model) OpenAside ¶
Opens the card in a hidden workspace without switching to it, the card waiting there as its focus
func (*Model) OpenFrom ¶
Opens the card the way Open does, growing it out of the origin box when one is given
func (*Model) OpenPalette ¶
Opens the palette over titled ready commands and the focused card actions, recent first
func (*Model) OpenTab ¶
Opens a card as a new shown tab of the focused tile, on its own when no tile has the focus
func (*Model) RemoveWorkspace ¶
Drops workspace i and its cards, showing a neighbor when it was on the stage
func (*Model) Repaint ¶
func (m *Model) Repaint()
Draws every card again on the next render, for state they show that changed outside them
func (*Model) ResetLayout ¶
Returns the master share, every split and every stack weight to their defaults
func (*Model) Resize ¶
Changes the master share of the stage by delta, or the split the focused tile was cut off by
func (*Model) Restore ¶
Applies the defaults, motion and recent commands of a saved layout where options did not fix them
func (*Model) RestoreWorkspace ¶
func (m *Model) RestoreWorkspace(ws *Workspace, l WorkspaceLayout, resolve func(key string) Card) tea.Cmd
Opens the cards of a saved workspace through resolve and lays them out as saved, skipping unresolved keys
func (*Model) ScreenFrameOf ¶
Box the frame of the card covers on the screen, the bar rows above the stage counted, false when it is not open
func (*Model) Selected ¶
Text currently swept, else the text the last sweep copied, empty when nothing was swept
func (*Model) SetBar ¶
Supplies what the bar shows each frame, the lane of every workspace, the waiting item and the dials
func (*Model) SetCascade ¶
Turns the flowing energy comet on the focused card's border on or off
func (*Model) SetCommandSource ¶
Sets where the commands the app contributes come from, asked each time they are listed or run and taking precedence over the built in ones
func (*Model) SetEmptyHints ¶
Actions an empty stage invites with, each shown with its key and label while bound
func (*Model) SetMainCount ¶
Changes how many tiles the main area of the master arrangement holds
func (*Model) SetMotion ¶
Scales every animation, zero snapping layouts, decodes and the focus ring into place
func (*Model) SetProgress ¶
func (m *Model) SetProgress(pb *tea.ProgressBar)
Shows a progress bar in the terminal, nil clearing it
func (*Model) SetRoute ¶
Passes what an owned card returns for every message it takes through route, a nil command included, so an app with several owners hears which of them took a message and gets each answer back to the right one
func (*Model) SetSize ¶
Resizes the stage, snapping placed cards to their new boxes, which keep their drawing while more sizes may follow
func (*Model) SetStatus ¶
func (m *Model) SetStatus(ps *tea.ProgramStatus)
Reports the program state to the terminal, nil clearing it
func (*Model) SetWindowTitle ¶
Sets the terminal window title
func (*Model) ShowOverlay ¶
Shows a card above everything with first claim on input, replacing any overlay up, a sticky one held beneath until this one closes
func (*Model) ShowsOverlay ¶
Whether the card is the overlay on top or one held beneath it
func (*Model) SplitTab ¶
Takes the shown tab of the focused group out into a tile of its own, a group left with one tab dissolving
func (*Model) SwapMaster ¶
Trades the focused tile with the master, or the master with the first stack tile
func (*Model) ToastRegion ¶
Screen box the toasts take now, the right half of the rows they stack in, false while none shows
func (*Model) ToggleFloat ¶
Floats the focused tile or tiles the focused float
func (*Model) ToggleLayout ¶
Switches the workspace on the stage between the master and dwindle arrangements
func (*Model) ToggleZoom ¶
Fills the stage with the focused card or gives the stage back
func (*Model) Update ¶
Routes frames to the animation, keys to the focused card, and the mouse to the card under it
func (*Model) View ¶
Composites the bar, the stage, the veil, the overlay and the toasts into a full screen view with mouse tracking
func (*Model) Wake ¶
Starts the frame clock again when it stopped, for an app whose card began to move without any input reaching the window manager
func (*Model) WorkspaceByID ¶
Workspace bound to the id, nil when none is
func (*Model) WorkspaceOf ¶
Workspace holding the card, nil when it is not open
type Note ¶
type Note struct {
Text string
Style SegmentStyle
}
Line under the rows of a palette, such as where a pick is saved or a warning about the lit row
type Notice ¶
type Notice struct {
Text string
Signal Signal
// Items queued behind this one
More int
Action string
}
Item waiting on the person, shown in the field until its action serves it
type Option ¶
type Option func(*Model)
Configures the manager at construction
func WithMotion ¶
Scales every animation, one for full springs and zero for layouts that snap into place
type Painter ¶ added in v1.0.10
Card that paints its content into cells itself, the buffer sized to its content and cleared beforehand
type Palette ¶
type Palette struct {
Placeholder string
// Called with the text when enter is pressed on a palette without items
OnText func(text string) tea.Cmd
// Called once when the palette loses its place as the overlay
OnClose func() tea.Cmd
// Keeps the items it accepts for the typed text in their own order, the fuzzy match when nil
Filter func(query string, it Item) bool
// Keeps a prompt open after enter, its owner closing it or putting rows in its place
Hold bool
// Shows the text typed into a prompt as dots
Masked bool
// Keymap context of the actions the palette answers besides its own, empty for none
Context string
// Actions of Context by id
Actions map[string]func() tea.Cmd
// Hints of the actions of Context, shown ahead of the palette's own
Extra []Hint
// Lines under the rows, read on every view
Notes func() []Note
// Step behind the close key, reporting whether it took the key
OnBack func() bool
// Ignores typing, picks and actions while its owner waits for an answer
Busy bool
// contains filtered or unexported fields
}
Fuzzy picker typed into from the bar field with its matches hanging below, a line of text without items
func NewPalette ¶
Builds a palette over the items
func (*Palette) Animate ¶
Glides the highlight toward the selected row, jumping there when motion is off
func (*Palette) Ask ¶
Asks a yes or no question in the field, the rows making way for the notes until it is answered
func (*Palette) Back ¶
Close key while a question is asked or a step lies behind the palette: the question withdrawn, else the step taken
func (*Palette) Contexts ¶
Keymap contexts in force, the yes and no keys while a question is asked and the palette's own context ahead of the picker keys, the field keys last
func (*Palette) Hints ¶
Actions the palette answers, the yes and no of a question, else those of its own context ahead of the picker keys
func (*Palette) Input ¶
Query in w columns scrolled to keep the caret in view, the placeholder while empty and the question while one is asked, with the caret column
func (*Palette) Rows ¶
Rows the sheet under the field wants, the matches and the notes under them, none for a prompt that lives in the field alone
func (*Palette) Select ¶
Moves the selection to the row with the id, reporting whether the typed text leaves it listed
func (*Palette) SetItems ¶
Replaces the rows in place and filters them by the typed text, the selection back on the first, a palette without rows taking a line of text
type Passer ¶ added in v1.0.10
type Passer interface {
Passes(tea.KeyPressMsg) bool
}
Raw card that still lets some keys fire the actions of other contexts, such as the window keys of a terminal
type Positioned ¶
type Positioned interface {
Origin(x, y int)
}
Card told the screen cell its content starts at before it paints, for images placed by screen position
type Raw ¶
type Raw interface {
Raw() bool
}
Card that takes every key as typed while it answers true, only the actions of its own contexts firing
type Reporter ¶ added in v1.0.14
type Reporter interface {
// Chip of the workspace while the card is its lead, an empty name leaving the chip bare
Lane() Lane
// First item waiting on the person inside the card, false while nothing waits
Waiting() (text string, signal Signal, at time.Time, ok bool)
}
Card standing on the bar for the sessions it holds, naming its chip and what waits in it
type Segment ¶
type Segment struct {
Text string
Style SegmentStyle
Action string
}
Control at the right of the bar that fires its action when clicked
type SegmentStyle ¶
type SegmentStyle int
Color role of a dial
const ( Plain SegmentStyle = iota Dim Cool Warm Hot Good Bad )
type Selectable ¶
type Selectable interface {
Selectable() bool
}
Card whose content may be swept with the mouse to copy text
type SelfClosing ¶
type SelfClosing interface {
ClosesItself() bool
}
Overlay or sheet that carries out its close key itself, a question declining and staying until its asker drops it
type SheetHolder ¶
Card that gives the sheets it holds a part of its content, such as the rows above its prompt, in content coordinates
type Signal ¶
type Signal int
What a workspace or a waiting item reports, later signals needing the person more
type Sized ¶
type Sized interface {
MinSize() (w, h int)
}
Card that declares the content size it opens at when floating and the least it is useful at when tiled
type SplitLayout ¶
type SplitLayout struct {
Key string `json:"key,omitempty"`
Vertical bool `json:"vertical,omitempty"`
Ratio float64 `json:"ratio,omitempty"`
A *SplitLayout `json:"a,omitempty"`
B *SplitLayout `json:"b,omitempty"`
}
Node of the dwindle tree, a tile key at a leaf or a cut between two subtrees
type Stateful ¶
type Stateful interface {
State() any
SetState(json.RawMessage) error
}
Card that keeps state between runs, handed back on the next start what it reported
type Status ¶
type Status struct {
Lanes map[*Workspace]Lane
Notice Notice
// Least important first, dropped from the left when the bar runs out of room
Dials []Segment
}
Everything the app shows on the bar for one frame
type Statuser ¶
type Statuser interface {
Status() string
}
Card with a short trailer for its bottom edge
type Sticky ¶
type Sticky interface {
Sticky() bool
}
Overlay that only its answer or an explicit dismissal closes, held beneath the palette or a later overlay instead of dropped
type SweepScroller ¶
type SweepScroller interface {
// Window rows the scrolling text fills, the first and one past the last
SweepArea() (top, bottom int)
// Scrolls the text by rows, negative toward its start, returning the rows it moved
SweepScroll(rows int) int
// Plain text of window rows counted from the first row of the window, rows outside the window included
SweepRows(from, to int) []string
}
Card whose text scrolls under a sweep held past its edge, so one sweep can cover more than a window of it
type Tabs ¶
type Tabs struct {
// contains filtered or unexported fields
}
Several cards sharing one frame behind a tab strip, the active one receiving input and filling the rest
func (*Tabs) Contexts ¶
Contexts of the active tab, then the tab strip's own unless the tab takes every key raw
func (*Tabs) Grabs ¶ added in v1.0.11
Hands a press below the strip to the card shown, which may take hold of the pointer
func (*Tabs) Hints ¶
Actions of the active tab, then the tab switching one that reaches the manager even past a raw tab
func (*Tabs) Passes ¶
func (g *Tabs) Passes(k tea.KeyPressMsg) bool
Lets the keys the active tab passes reach the manager while it takes keys raw
func (*Tabs) Selectable ¶
func (*Tabs) SetState ¶
func (g *Tabs) SetState(raw json.RawMessage) error
Shows the tab a saved state names, keeping the current one when no card has its key
type TapMsg ¶
Sent to a card whose text can be swept when a left press and its release fall on one cell of its content with no sweep between, in content coordinates with the modifier keys held and the hyperlink painted on the cell
type TileLayout ¶
Tile by key with its share of the stack it sits in
type Tracker ¶ added in v1.0.10
type Tracker interface {
Tracks() bool
}
Card handed every pointer motion over its content, in content coordinates
type Transparent ¶
type Transparent interface {
Holes() []Box
}
Card with boxes of content cells that must keep no background, so an image the terminal placed under them shows
type Urgency ¶
type Urgency int
How urgently a card wants attention, driving the color its frame glows with
type Waker ¶
type Waker interface {
Awake() bool
}
Card that needs the frame clock running even while the screen rests, such as one refreshing on an interval
type WheelPasser ¶
type WheelPasser interface {
PassesWheel() bool
}
Overlay that leaves the wheel turned outside its frame to the card under the pointer, so what it asks about can be read behind it
type Workspace ¶
type Workspace struct {
ID string
// contains filtered or unexported fields
}
Group of cards bound to one session, tiled in master and stack order with dialogs floating above
func (*Workspace) Empty ¶ added in v1.0.12
Reports whether the workspace holds no card that is not on its way out
type WorkspaceLayout ¶
type WorkspaceLayout struct {
ID string `json:"id"`
Mode string `json:"mode,omitempty"`
Ratio float64 `json:"ratio,omitempty"`
Main int `json:"main,omitempty"`
Tiles []TileLayout `json:"tiles,omitempty"`
Floats []FloatLayout `json:"floats,omitempty"`
Tree *SplitLayout `json:"tree,omitempty"`
Focus string `json:"focus,omitempty"`
Zoom string `json:"zoom,omitempty"`
// State the cards keep between runs, by key
Cards map[string]json.RawMessage `json:"cards,omitempty"`
}
One workspace as it stands, its tiles in stage order
func (WorkspaceLayout) Rekeyed ¶
func (l WorkspaceLayout) Rekeyed(id string, rename func(key string) string) WorkspaceLayout
Workspace with every card key passed through rename, keys it returns empty for left out along with their tree leaves, focus, zoom and saved state