Documentation
¶
Overview ¶
Tiling window manager for terminal cards with workspaces, floating dialogs, a command palette and spring motion
Index ¶
- Constants
- func HiddenText(above, below int) string
- 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 Tracking(value string) tea.MouseMode
- type ActionMsg
- type Addressed
- type Animator
- type Answerer
- 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 Kinded
- 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) 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) Blurred() bool
- func (m *Model) Close(c Card) tea.Cmd
- func (m *Model) CloseFocused() tea.Cmd
- func (m *Model) CloseWorkspace() tea.Cmd
- func (m *Model) Commands() []Command
- func (m *Model) Composed() ([]uv.Line, uint64)
- 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) 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) FocusReported() bool
- func (m *Model) Focused() Card
- 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) LeaderWait() time.Duration
- func (m *Model) Leading() bool
- func (m *Model) Mirror(on bool)
- func (m *Model) Move(d Dir) tea.Cmd
- func (m *Model) NewWorkspace() tea.Cmd
- func (m *Model) Open(ws *Workspace, c Card) 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) Pointer() (x, y int, at time.Time, ok bool)
- func (m *Model) Ratio() float64
- func (m *Model) Redraw()
- 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) 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) Selected() (string, time.Time)
- 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) SetLeaderWait(wait time.Duration)
- func (m *Model) SetMainCount(delta int) tea.Cmd
- func (m *Model) SetMotion(scale float64)
- func (m *Model) SetMouse(value string)
- func (m *Model) SetReadout(read func() (string, Level))
- 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) 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) Toast(text string, level Level, ttl time.Duration) tea.Cmd
- func (m *Model) ToastRegion() (Box, bool)
- func (m *Model) ToggleFloat() tea.Cmd
- func (m *Model) ToggleLayout() tea.Cmd
- func (m *Model) ToggleZoom() tea.Cmd
- func (m *Model) Touch(c Card) 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) WorkspaceOf(c Card) *Workspace
- func (m *Model) Workspaces() []*Workspace
- type Notice
- type Option
- type Ordered
- type Painter
- type Palette
- func (p *Palette) Animate(dt float64) bool
- func (p *Palette) Contexts() []string
- func (p *Palette) Glyph() string
- 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) Measure(w int)
- func (p *Palette) Query() string
- func (p *Palette) Rows() int
- 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
- func (p *Palette) Wants() int
- type Passer
- type Positioned
- type Raw
- 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) Answers(action string) 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 Urgency
- type Waker
- type WheelPasser
- type Workspace
- type WorkspaceLayout
Constants ¶
const ( // Every move: hover, clicks, drags and the wheel MouseAll = "all" // Clicks, drags and the wheel, no hover MouseClicks = "clicks" // Nothing: the terminal keeps the mouse, its selection and its taps to itself MouseOff = "off" )
How much of the mouse the app follows, as the setting of the mouse names it
const ( GroupRecent = "Recent" GroupWindows = "Windows" GroupTabs = "Tabs" GroupLayout = "Layout" GroupSpaces = "Spaces" )
Headings the palette lists the manager's own commands under, and the one over the commands used last. What the focused window answers is listed under its kind, such as Chat
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 ¶
This section is empty.
Functions ¶
func HiddenText ¶
Words for the rows a scrolled picker or table hides above and below, in the language of the window
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
Types ¶
type Addressed ¶
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 Answerer ¶
Card that says which actions of its contexts it has a use for, so the palette lists those and no others
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
// What it does in a few words, shown beside the title: the description of the key action of its id when empty
Detail string
// Heading the palette lists it under, the commands of one heading together in the order they come
Group string
// Reports whether the command applies right now, always when nil
When func() bool
// Listed under every other command, where the way out of the application belongs
Last 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 ¶
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
// Word on the button, the label of the action when empty
Label string
}
A button on the bottom edge of the focused card. Enter presses the first one, tab moves to the next, a click presses any
type Hinter ¶
type Hinter interface {
Hints() []Hint
}
Card with buttons: the things to do with what it shows now, the one enter does first
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
// Heading the row is listed under while nothing is typed, the rows of one heading coming together. Typed text finds the row by the
// heading too. No headings show when no row names one
Group string
// Second listing of a row, as under a heading of the rows used last: left out once text is typed, and out of the count
Again bool
Run func() tea.Cmd
}
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 Kinded ¶
type Kinded interface {
Kind() string
}
Card that names its kind, such as Chat or Terminal, for the commands the palette lists for it
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 {
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 arrangement new workspaces take, the workspace on the stage, the commands run lately and every open workspace as it stands. The style and the motion are settings of the app, which keep them
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 on screen is still moving, the cards of the workspaces off the stage moving on without counting
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) Blurred ¶
Whether the terminal said it lost the focus of the desktop, the person looking at another window
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) Composed ¶
Cells of the frame as last composed, laid out as the screen shows them, and the count of the frames composed so far, which moves each time the cells may have changed: the kit finds the pictures the terminal places by position in them
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) 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) FocusReported ¶
Whether the terminal has said anything of its focus yet, which a terminal that reports focus does as it gains or loses it
func (*Model) JoinTab ¶
Moves the focused window into the tile beside it as its shown tab, the tile becoming a tab group
func (*Model) Layout ¶
Layout as it stands, the arrangement new workspaces take following the workspace on the stage
func (*Model) LeaderWait ¶
How long the keys after the leader wait before they close by themselves, zero for until a key
func (*Model) Mirror ¶
Lets the frame be drawn right to left while the window's language is written so, or keeps it left to right whatever the language, for a terminal that mirrors what it is sent itself
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) 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, each under its heading: the commands used last, the app's, what the focused window answers under its kind, then the manager's own. A command the app lists last ends the rows of its heading
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) Pointer ¶
Cell of the screen the terminal last reported the pointer at and when, false while the terminal is not asked to report its every move, or reported none yet
func (*Model) Redraw ¶
func (m *Model) Redraw()
Draws the screen again on the next render with the cards as they are drawn, for what the window manager draws around them that changed outside any message to it, such as the readout in its corner
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 arrangement new workspaces take and the commands run lately of a saved layout, the workspaces open now taking the arrangement too
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 and lays them out as saved: a card resolve makes takes the state it kept before it starts, a tab group is made again around the tabs resolve makes of it, and a key resolve makes nothing for, or one open already elsewhere, is skipped. The cards the workspace holds already keep their place before the saved ones
func (*Model) Selected ¶
Text currently swept with the time now, else the text the last sweep copied with when it ended; 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 comet that runs round the frame of the focused card on or off, which shows while motion is on and the theme is not plain
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) SetLeaderWait ¶
Has the keys after the leader close by themselves once they waited this long, a wait of zero or less keeping them until a key
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) SetMouse ¶
Sets the mouse tracking the next frame asks the terminal for, by the setting's value
func (*Model) SetReadout ¶
Sets the readout painted over the bottom right corner of every frame, such as the frame rate, nil for none
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 what the program does to the terminal by the Program Status Protocol, nil clearing it: each report replaces the one before whole, so a report that stays the same is no change
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) Touch ¶
Draws the card, or the card holding it, again on the next render and no other: for what it shows that changed outside any message to it, such as what work done for it alone brought. No card is drawn again for one no longer on screen anywhere
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. Handed the screen as last drawn while the message before it changed nothing that shows
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) WorkspaceOf ¶
Workspace holding the card, nil when it is not open
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
type Ordered ¶
type Ordered interface {
KeepsOrder() bool
}
A card whose content keeps the order it is drawn in when the window is drawn right to left, such as a terminal whose program lays out its own screen: the card moves to the mirrored place, what is inside it stays as the program drew it
type Painter ¶
Card that paints its content into cells itself, the buffer sized to its content and cleared beforehand
type Palette ¶
type Palette struct {
Placeholder string
// contains filtered or unexported fields
}
Fuzzy picker of the commands typed into from the bar field with its matches hanging below
func NewPalette ¶
Builds a palette over the items
func (*Palette) Animate ¶
Glides the highlight toward the selected row, jumping there when motion is off. It is drawn on whole rows, so it rests once it shows the row it glides to
func (*Palette) Input ¶
Query in w columns scrolled to keep the caret in view, the placeholder while empty, with the caret column
func (*Palette) Rows ¶
Rows the sheet under the field wants, the matches and the detail of the lit row where the rows leave theirs out, none while there is no row
func (*Palette) Status ¶
Count of the rows scrolled out of the sheet above and below, empty while every match shows
type Passer ¶
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 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) Awake ¶
Keeps the frame clock running while the tab in front needs it, the tabs behind it showing nothing and moving on whenever the clock runs
func (*Tabs) Contexts ¶
Contexts of the active tab, then the tab strip's own unless the tab takes every key raw
func (*Tabs) Grabs ¶
Hands a press below the strip to the card shown, which may take hold of the pointer
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 ¶
type Tracker interface {
Tracks() bool
}
Card handed every pointer motion over its content, in content coordinates
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
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"`
// Tab groups by the key of the frame they share, the keys of their tabs in order
Groups map[string][]string `json:"groups,omitempty"`
// State the cards keep between runs, by key, the tabs of the groups among them
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 key of a card passed through rename, keys it returns empty for left out along with their tree leaves, focus, zoom and saved state. The key of a tab group is the manager's own and stays, its tabs renamed and the tab it showed with them; a group none of whose tabs is left is left out