Documentation
¶
Overview ¶
Package common holds UI building blocks shared across panes: theming (colors, styles, icons), widgets (dialogs, file picker, toasts), text selection, and the low-level PTY/tmux plumbing used by the center and sidebar terminals.
Package common re-exports the internal/ui/theme symbols so existing common.* references keep working after theme was split into its own package. New code should import internal/ui/theme directly.
Index ¶
- Constants
- Variables
- func CopyToClipboard(text string) error
- func CopyToClipboardWithLog(text, label string)
- func DragSelect(v *vterm.VTerm, sel *SelectionState, scrollState *SelectionScrollState, ...) (needTick bool, gen, seq uint64)
- func ExtendSelection(v *vterm.VTerm, sel *SelectionState, endX, endAbsLine int)
- func KeyToBytes(msg tea.KeyPressMsg) []byte
- func MergeByID[T any, K comparable](existing, incoming []T, incomingActive int, id func(T) K, isNil func(T) bool) ([]T, int)
- func OSC52ClipboardText(payload []byte) (string, bool)
- func RebindTabMaps[T any, K comparable](tabsByWorkspace map[string][]T, activeByWorkspace map[string]int, ...) []T
- func RenderHelpItem(styles Styles, key, desc string) string
- func ReportError(context string, err error, toastMessage string) tea.Cmd
- func SafeBatch(cmds ...tea.Cmd) tea.Cmd
- func SafeCmd(cmd tea.Cmd) tea.Cmd
- func SafeTick(d time.Duration, fn func(time.Time) tea.Msg) tea.Cmd
- func ScrollDeltaForHeight(height, factor int) int
- func SelectionScrollTickStep(v *vterm.VTerm, sel *SelectionState, scrollState *SelectionScrollState, ...)
- func SortLRUTabCandidates[P any](candidates []LRUTabCandidate[P])
- func WrapHelpItems(items []string, width int) []string
- type CriticalExternalMsg
- type Dialog
- func (d *Dialog) Cursor() *tea.Cursor
- func (d *Dialog) Hide()
- func (d *Dialog) SetDefaultOption(index int)
- func (d *Dialog) SetInputTransform(fn InputTransformFunc) *Dialog
- func (d *Dialog) SetInputValidate(fn InputValidateFunc) *Dialog
- func (d *Dialog) SetInputValue(s string)
- func (d *Dialog) SetShowKeymapHints(show bool)
- func (d *Dialog) SetSize(width, height int)
- func (d *Dialog) SetWarning(text string)
- func (d *Dialog) Show()
- func (d *Dialog) Update(msg tea.Msg) (*Dialog, tea.Cmd)
- func (d *Dialog) View() string
- func (d *Dialog) Visible() bool
- type DialogResult
- type DialogType
- type EnvDialog
- func (d *EnvDialog) Cursor() *tea.Cursor
- func (d *EnvDialog) Env() map[string]string
- func (d *EnvDialog) Hide()
- func (d *EnvDialog) SetSize(w, _ int)
- func (d *EnvDialog) Show()
- func (d *EnvDialog) Update(msg tea.Msg) (*EnvDialog, tea.Cmd)
- func (d *EnvDialog) View() string
- func (d *EnvDialog) Visible() bool
- type EnvDialogResult
- type FilePicker
- func (fp *FilePicker) Cursor() *tea.Cursor
- func (fp *FilePicker) Hide()
- func (fp *FilePicker) SetPrimaryActionLabel(label string)
- func (fp *FilePicker) SetShowKeymapHints(show bool)
- func (fp *FilePicker) SetSize(width, height int)
- func (fp *FilePicker) SetStyles(styles Styles)
- func (fp *FilePicker) SetTitle(title string)
- func (fp *FilePicker) Show()
- func (fp *FilePicker) Update(msg tea.Msg) (*FilePicker, tea.Cmd)
- func (fp *FilePicker) View() string
- func (fp *FilePicker) Visible() bool
- type HitRegion
- type InputTransformFunc
- type InputValidateFunc
- type LRUTabCandidate
- type SelectionScrollState
- type SelectionState
- type SettingsDialog
- func (s *SettingsDialog) AssistantCommands() map[string]string
- func (s *SettingsDialog) Cursor() *tea.Cursor
- func (s *SettingsDialog) Hide()
- func (s *SettingsDialog) SelectedTheme() ThemeID
- func (s *SettingsDialog) SetAssistants(names []string, commands map[string]string)
- func (s *SettingsDialog) SetSelectedTheme(theme ThemeID)
- func (s *SettingsDialog) SetSession(session int)
- func (s *SettingsDialog) SetSize(w, h int)
- func (s *SettingsDialog) SetUpdateHint(hint string)
- func (s *SettingsDialog) SetUpdateInfo(current, latest string, available bool)
- func (s *SettingsDialog) Show()
- func (s *SettingsDialog) TmuxConfigPath() string
- func (s *SettingsDialog) TmuxServer() string
- func (s *SettingsDialog) TmuxSyncInterval() string
- func (s *SettingsDialog) Update(msg tea.Msg) (*SettingsDialog, tea.Cmd)
- func (s *SettingsDialog) View() string
- func (s *SettingsDialog) Visible() bool
- type SettingsResult
- type Styles
- type TabSet
- func (s *TabSet[T]) ActiveIdx(wsID string) int
- func (s *TabSet[T]) DeleteWorkspace(wsID string)
- func (s *TabSet[T]) NextIdx(wsID string) (int, bool)
- func (s *TabSet[T]) PrevIdx(wsID string) (int, bool)
- func (s *TabSet[T]) SelectIdx(wsID string, idx int) bool
- func (s *TabSet[T]) SetActiveIdx(wsID string, idx int)
- func (s *TabSet[T]) Tabs(wsID string) []T
- type Theme
- type ThemeColors
- type ThemeID
- type ThemePreview
- type Toast
- type ToastDismissed
- type ToastModel
- func (m *ToastModel) Dismiss()
- func (m *ToastModel) SetStyles(styles Styles)
- func (m *ToastModel) Show(message string, toastType ToastType, duration time.Duration) tea.Cmd
- func (m *ToastModel) ShowError(message string) tea.Cmd
- func (m *ToastModel) ShowInfo(message string) tea.Cmd
- func (m *ToastModel) ShowSuccess(message string) tea.Cmd
- func (m *ToastModel) ShowWarning(message string) tea.Cmd
- func (m *ToastModel) Update(msg tea.Msg) (*ToastModel, tea.Cmd)
- func (m *ToastModel) View() string
- func (m *ToastModel) Visible() bool
- type ToastType
Constants ¶
const ( OSC52ClipboardEnv = "AMUX_ENABLE_OSC52_CLIPBOARD" OSC52ClipboardMaxBytes = 64 * 1024 )
const ( ThemeTokyoNight = theme.ThemeTokyoNight ThemeDracula = theme.ThemeDracula ThemeNord = theme.ThemeNord ThemeCatppuccin = theme.ThemeCatppuccin ThemeGruvbox = theme.ThemeGruvbox ThemeSolarized = theme.ThemeSolarized ThemeMonokai = theme.ThemeMonokai ThemeRosePine = theme.ThemeRosePine ThemeOneDark = theme.ThemeOneDark ThemeKanagawa = theme.ThemeKanagawa ThemeEverforest = theme.ThemeEverforest ThemeAyuDark = theme.ThemeAyuDark ThemeGitHubDark = theme.ThemeGitHubDark ThemeSolarizedLight = theme.ThemeSolarizedLight ThemeGitHubLight = theme.ThemeGitHubLight ThemeCatppuccinLatte = theme.ThemeCatppuccinLatte ThemeOneLight = theme.ThemeOneLight ThemeGruvboxLight = theme.ThemeGruvboxLight ThemeRosePineDawn = theme.ThemeRosePineDawn )
const AgentPickerDialogID = "agent-picker"
AgentPickerDialogID is the dialog ID assigned to the agent selection dialog produced by NewAgentPicker. The app layer matches on it to route confirm results, and dialog rendering branches on it for the picker's custom layout.
const SelectionScrollTickInterval = 100 * time.Millisecond
SelectionScrollTickInterval is the interval between auto-scroll ticks during mouse-drag selection past viewport edges.
const TabBarHeight = 1
TabBarHeight is the height, in rows, of the compact pane tab strip. Both the center and sidebar terminal panes render their tab strip as a single borderless line, and both use this when converting between screen and content coordinates.
Variables ¶
var ( AgentColor = theme.AgentColor AvailableThemes = theme.AvailableThemes ColorBackground = theme.ColorBackground ColorBorder = theme.ColorBorder ColorBorderFocused = theme.ColorBorderFocused ColorError = theme.ColorError ColorForeground = theme.ColorForeground ColorInfo = theme.ColorInfo ColorMuted = theme.ColorMuted ColorPrimary = theme.ColorPrimary ColorSecondary = theme.ColorSecondary ColorSelection = theme.ColorSelection ColorSuccess = theme.ColorSuccess ColorSurface0 = theme.ColorSurface0 ColorSurface1 = theme.ColorSurface1 ColorSurface2 = theme.ColorSurface2 ColorWarning = theme.ColorWarning DefaultStyles = theme.DefaultStyles GetCurrentTheme = theme.GetCurrentTheme GetTheme = theme.GetTheme HexColor = theme.HexColor SetCurrentTheme = theme.SetCurrentTheme SpinnerFrame = theme.SpinnerFrame Icons = theme.Icons ColorClaude = theme.ColorClaude ColorCodex = theme.ColorCodex ColorGemini = theme.ColorGemini ColorAmp = theme.ColorAmp ColorOpencode = theme.ColorOpencode ColorDroid = theme.ColorDroid ColorCline = theme.ColorCline ColorCursor = theme.ColorCursor ColorPi = theme.ColorPi )
Functions ¶
func CopyToClipboard ¶
CopyToClipboard writes text to the system clipboard with a macOS pbcopy fallback.
func CopyToClipboardWithLog ¶ added in v0.0.20
func CopyToClipboardWithLog(text, label string)
CopyToClipboardWithLog copies text to the clipboard (a no-op for empty text), logging success or failure with label for context. It shells out to pbcopy on macOS, so callers MUST NOT hold a tab/terminal mutex while calling it — capture the text under the lock, release it, then call this.
func DragSelect ¶ added in v0.0.20
func DragSelect( v *vterm.VTerm, sel *SelectionState, scrollState *SelectionScrollState, termX, termY, termWidth, termHeight int, lastTermX *int, scroll func(delta int), screenYToAbs func(screenY int) int, ) (needTick bool, gen, seq uint64)
DragSelect advances an in-progress drag selection toward the pointer at (termX, termY) and reports whether an auto-scroll tick loop should be (re)started. The caller must hold the owning tab/terminal mutex and must have already confirmed sel.Active and a non-nil v.
termX is clamped to [0, termWidth); the unclamped termY drives the scroll direction (scrollState.SetDirection) before being clamped to the viewport. When the pointer is above or below the viewport, scroll is invoked with +1 (up into history) or -1 (down toward live) and termY is pinned to the matching edge. The clamped termY is mapped to an absolute line via screenYToAbs and the selection endpoint is extended there. The clamped termX is written to *lastTermX so tick-driven edge extension can reuse it.
The two closures absorb the only per-pane divergence: scroll performs the pane's viewport move (center's chat-history-aware scroll vs the sidebar's raw ScrollView+note), and screenYToAbs maps a screen row to an absolute line. The returned (needTick, gen, seq) come straight from scrollState.NeedsTick(); the caller owns scheduling the actual tick command.
func ExtendSelection ¶ added in v0.0.20
func ExtendSelection(v *vterm.VTerm, sel *SelectionState, endX, endAbsLine int)
ExtendSelection moves the far endpoint of an in-progress selection to (endX, endAbsLine). The anchor is read from the live vterm selection, falling back to sel's stored start when the vterm has no selection yet, then written back to sel so the two stay in sync. This block is order-sensitive; callers must hold the owning tab/terminal mutex. It performs no I/O.
func KeyToBytes ¶
func KeyToBytes(msg tea.KeyPressMsg) []byte
KeyToBytes converts a key press message to bytes for the terminal.
func MergeByID ¶ added in v0.0.20
func MergeByID[T any, K comparable](existing, incoming []T, incomingActive int, id func(T) K, isNil func(T) bool) ([]T, int)
MergeByID merges incoming into existing, de-duplicating by id while preserving order (existing first, then new incoming items). It returns the merged slice and the index that incoming[incomingActive] maps to in the result (-1 if the active item was nil or out of range). isNil filters out nil/zero entries.
func OSC52ClipboardText ¶ added in v0.0.20
OSC52ClipboardText returns text that is allowed to be copied from an OSC 52 terminal sequence. OSC 52 is disabled by default because terminal output is an untrusted boundary; enable with AMUX_ENABLE_OSC52_CLIPBOARD=1.
func RebindTabMaps ¶ added in v0.0.20
func RebindTabMaps[T any, K comparable]( tabsByWorkspace map[string][]T, activeByWorkspace map[string]int, oldID, newID string, id func(T) K, isNil func(T) bool, ) []T
RebindTabMaps migrates a workspace's tab slice and active-tab index from oldID to newID across the two per-workspace maps: it merges any tabs already present under newID (via MergeByID), writes the result under newID, deletes oldID from both maps, and clamps the surviving active index. It returns the merged slice.
Callers keep their own surrounding logic (the "seen but empty" special case, workspace-pointer fixups, PTY restarts) and delegate only this reconciliation, which was byte-identical between the center and sidebar panes — so a clamp fix now happens once instead of being mirrored.
func RenderHelpItem ¶
RenderHelpItem renders a single help item for inline help bars.
func ReportError ¶ added in v0.0.12
ReportError logs, emits an Error message, and shows a toast.
func ScrollDeltaForHeight ¶ added in v0.0.3
ScrollDeltaForHeight calculates proportional scroll delta. Returns max(1, height/factor) to ensure minimum 1 line scroll.
func SelectionScrollTickStep ¶ added in v0.0.20
func SelectionScrollTickStep( v *vterm.VTerm, sel *SelectionState, scrollState *SelectionScrollState, termHeight int, lastTermX int, scroll func(delta int), screenYToAbs func(screenY int) int, )
SelectionScrollTickStep performs one auto-scroll tick of a drag selection: it scrolls the viewport one line in scrollState.ScrollDir and extends the selection endpoint to the now-exposed viewport edge. The caller must hold the owning tab/terminal mutex and must have already validated the tick via scrollState.HandleTick (which confirms the generation, tick sequence, direction, and active state) plus sel.Active and a non-nil v.
The edge row is the top of the viewport when scrolling up into history and the bottom (termHeight-1) when scrolling down toward live; screenYToAbs maps it to an absolute line. lastTermX supplies the horizontal endpoint. scroll and screenYToAbs carry the same per-pane meaning as in DragSelect. The caller owns scheduling the next tick command.
func SortLRUTabCandidates ¶ added in v0.0.20
func SortLRUTabCandidates[P any](candidates []LRUTabCandidate[P])
SortLRUTabCandidates orders candidates least-recently-active first. The zero time naturally sorts before every real timestamp, so tabs with unknown recency are evicted first. Ties break by workspace ID, then tab index, keeping eviction deterministic.
func WrapHelpItems ¶
WrapHelpItems wraps pre-rendered help items into multiple lines constrained by width.
Types ¶
type CriticalExternalMsg ¶ added in v0.0.17
type CriticalExternalMsg interface {
MarkCriticalExternalMsg()
}
CriticalExternalMsg marks messages that must bypass the normal lossy external message queue and go through the critical path instead.
Critical messages are non-evicting: when the critical queue is full they drop themselves rather than evicting a queued non-critical message. (An evicting tier used to exist, but no real message ever needed it, so the distinction was removed.)
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog is a modal dialog component
func NewAgentPicker ¶
NewAgentPicker creates a new agent selection dialog with fuzzy filtering
func NewConfirmDialog ¶
NewConfirmDialog creates a new confirmation dialog
func NewInputDialog ¶
NewInputDialog creates a new input dialog
func (*Dialog) SetDefaultOption ¶ added in v0.0.20
SetDefaultOption sets the option selected whenever the dialog is shown.
func (*Dialog) SetInputTransform ¶
func (d *Dialog) SetInputTransform(fn InputTransformFunc) *Dialog
SetInputTransform sets a transform function that will be applied to input text
func (*Dialog) SetInputValidate ¶
func (d *Dialog) SetInputValidate(fn InputValidateFunc) *Dialog
SetInputValidate sets a validation function that runs on each keystroke
func (*Dialog) SetInputValue ¶ added in v0.0.20
SetInputValue prefills the input field's current value so a dialog opened for editing (e.g. rename) renders the existing value ready to edit. It affects input dialogs only. Call it after Show(), which resets the input to empty.
func (*Dialog) SetShowKeymapHints ¶
SetShowKeymapHints controls whether helper text is rendered.
func (*Dialog) SetWarning ¶ added in v0.0.20
SetWarning sets optional informational warning text rendered below the message on a confirm dialog. Passing "" clears it. This is purely advisory (e.g. surfacing in-repo script indirection at trust time); an empty warning must never be read or presented as a safety guarantee.
type DialogResult ¶
DialogResult is sent when a dialog is completed
type DialogType ¶
type DialogType int
DialogType identifies the type of dialog
const ( DialogNone DialogType = iota DialogInput DialogConfirm DialogSelect )
type EnvDialog ¶ added in v0.0.20
type EnvDialog struct {
// contains filtered or unexported fields
}
EnvDialog is a modal dialog that edits a single workspace's environment-variable map. It mirrors SettingsDialog's Assistants section (handleAssistantFieldKey in settings_assistants.go): rows render as "key: value", Up/Down move a row cursor, printable runes edit the focused row's value, Backspace deletes the last rune of the focused value, and Ctrl+D removes the focused pair outright.
This widget is domain-agnostic on purpose (internal/ui/common imports neither internal/data nor internal/process elsewhere): it just edits whatever map[string]string it is given. Excluding reserved keys (process.IsReservedScriptEnvKey) is the caller's job -- see internal/app's handleShowWorkspaceEnvDialog, which filters ws.Env before calling NewEnvDialog and filters again defensively before persisting.
First-cut scope (plan 058's Design decision): only EDITING an existing pair's value and REMOVING a pair are supported. Adding a brand-new key needs a second input target inside a row (a name field, with its own validation) -- a materially different widget than every other multi-row editor in this package -- so "add" is deferred to a follow-up, the same escape hatch plan 031 used for "add a new assistant".
func NewEnvDialog ¶ added in v0.0.20
NewEnvDialog seeds the dialog from env, which is copied so later edits in the dialog cannot alias the caller's map (mirroring SetAssistants).
func (*EnvDialog) Env ¶ added in v0.0.20
Env returns the (possibly edited) map for read-back on close: a copy so the caller cannot mutate the dialog's internal state through the returned map. Removed pairs are simply absent (deleteFocusedPair drops them from both keys and values), so there is no separate "removed" set to reconcile.
func (*EnvDialog) Update ¶ added in v0.0.20
Update handles input. Like SettingsDialog, Esc always cancels. While a row is focused, only Up/Down/Ctrl+D/Backspace are structural; every other printable rune (including j/k and space) is typed into the focused row's value -- there is no "leave the field" key distinct from Enter here, since (unlike Settings) this dialog has only one section to route around.
type EnvDialogResult ¶ added in v0.0.20
type EnvDialogResult struct {
Canceled bool
}
EnvDialogResult is sent when the workspace environment-variable dialog closes. Canceled is true when the user dismissed via Esc, in which case the caller must discard every edit (no mutation, no persist) -- the same cancel contract SettingsResult uses.
type FilePicker ¶
type FilePicker struct {
// contains filtered or unexported fields
}
FilePicker is a file/directory picker dialog
func NewFilePicker ¶
func NewFilePicker(id, startPath string, directoriesOnly bool) *FilePicker
NewFilePicker creates a new file picker starting at the given path
func (*FilePicker) Cursor ¶
func (fp *FilePicker) Cursor() *tea.Cursor
Cursor returns the cursor position relative to the file picker view.
func (*FilePicker) SetPrimaryActionLabel ¶ added in v0.0.2
func (fp *FilePicker) SetPrimaryActionLabel(label string)
SetPrimaryActionLabel updates the primary action label.
func (*FilePicker) SetShowKeymapHints ¶
func (fp *FilePicker) SetShowKeymapHints(show bool)
SetShowKeymapHints controls whether helper text is rendered.
func (*FilePicker) SetSize ¶
func (fp *FilePicker) SetSize(width, height int)
SetSize sets the picker size
func (*FilePicker) SetStyles ¶
func (fp *FilePicker) SetStyles(styles Styles)
SetStyles updates the file picker styles (for theme changes).
func (*FilePicker) SetTitle ¶ added in v0.0.2
func (fp *FilePicker) SetTitle(title string)
SetTitle updates the dialog title.
func (*FilePicker) Update ¶
func (fp *FilePicker) Update(msg tea.Msg) (*FilePicker, tea.Cmd)
Update handles messages
func (*FilePicker) Visible ¶
func (fp *FilePicker) Visible() bool
Visible returns whether the picker is visible
type InputTransformFunc ¶
InputTransformFunc transforms input text before it's added to the input field
type InputValidateFunc ¶
InputValidateFunc validates input and returns an error message (empty = valid)
type LRUTabCandidate ¶ added in v0.0.20
LRUTabCandidate is one auto-detach candidate for attached-PTY limit enforcement, shared by the center agent-tab and sidebar terminal-tab limiters so both panes evict in the same order.
type SelectionScrollState ¶ added in v0.0.10
type SelectionScrollState struct {
// Gen is a generation counter used to invalidate stale tick loops.
Gen uint64
// TickSeq is the next tick sequence expected for Gen. Duplicate requests for
// the same sequence are harmless: the first tick advances TickSeq and later
// copies are ignored without stopping the loop.
TickSeq uint64
// ScrollDir is +1 (scroll up into history) or -1 (scroll down toward
// live output) or 0 (no auto-scroll).
ScrollDir int
// Active is true when a tick loop is currently running.
Active bool
}
SelectionScrollState is the shared state machine for tick-based auto-scrolling during mouse-drag text selection. Both the sidebar terminal and the center pane embed this struct.
func (*SelectionScrollState) HandleTick ¶ added in v0.0.10
func (s *SelectionScrollState) HandleTick(gen, seq uint64) bool
HandleTick checks whether an incoming tick with the given generation is still valid. Returns true if the tick loop should continue (caller should scroll and schedule the next tick). Stale generations or duplicate sequences are ignored without stopping the current generation; explicit stop conditions (direction cleared or inactive state) end the loop.
func (*SelectionScrollState) NeedsTick ¶ added in v0.0.10
func (s *SelectionScrollState) NeedsTick() (bool, uint64, uint64)
NeedsTick reports whether the caller should schedule an auto-scroll tick and, if so, returns the current generation and next expected tick sequence. Motions while a loop is already active re-request the same generation/sequence instead of invalidating the live timer. If a request was dropped, the next motion can replace it; if both copies arrive, HandleTick accepts whichever one arrives first and rejects the duplicate by sequence number.
func (*SelectionScrollState) Reset ¶ added in v0.0.10
func (s *SelectionScrollState) Reset()
Reset clears the scroll state and bumps the generation counter to invalidate any in-flight tick. Call on mouse release, selection clear, or any event that should stop auto-scrolling.
func (*SelectionScrollState) SetDirection ¶ added in v0.0.10
func (s *SelectionScrollState) SetDirection(termY, termHeight int)
SetDirection updates ScrollDir based on the unclamped terminal Y coordinate. Call this before clamping termY to [0, termHeight).
type SelectionState ¶ added in v0.0.14
type SelectionState struct {
Active bool // Selection in progress (mouse button down)?
StartX int // Start column (terminal coordinates)
StartLine int // Start row (absolute line number, 0 = first scrollback line)
EndX int // End column
EndLine int // End row (absolute line number)
}
SelectionState tracks mouse selection state for copy/paste.
type SettingsDialog ¶
type SettingsDialog struct {
// contains filtered or unexported fields
}
SettingsDialog is a modal dialog for application settings.
func NewSettingsDialog ¶
func NewSettingsDialog(currentTheme ThemeID, tmuxServer, tmuxConfig, tmuxSync string) *SettingsDialog
NewSettingsDialog creates a new settings dialog with current values.
func (*SettingsDialog) AssistantCommands ¶ added in v0.0.20
func (s *SettingsDialog) AssistantCommands() map[string]string
AssistantCommands returns the (possibly edited) assistant command map so the caller can persist changes to config when the dialog closes.
func (*SettingsDialog) Cursor ¶
func (s *SettingsDialog) Cursor() *tea.Cursor
func (*SettingsDialog) Hide ¶
func (s *SettingsDialog) Hide()
func (*SettingsDialog) SelectedTheme ¶ added in v0.0.16
func (s *SettingsDialog) SelectedTheme() ThemeID
func (*SettingsDialog) SetAssistants ¶ added in v0.0.20
func (s *SettingsDialog) SetAssistants(names []string, commands map[string]string)
SetAssistants sets the assistant roster the Assistants section lists: names in display order plus their current commands. Like SetUpdateInfo, this is populated after construction since the roster is late-bound app state (the caller reads it from config), not part of the dialog's core theme setup. Commands is copied so later edits to the dialog's in-memory copy cannot alias the caller's map.
func (*SettingsDialog) SetSelectedTheme ¶ added in v0.0.16
func (s *SettingsDialog) SetSelectedTheme(theme ThemeID)
func (*SettingsDialog) SetSession ¶ added in v0.0.16
func (s *SettingsDialog) SetSession(session int)
func (*SettingsDialog) SetSize ¶
func (s *SettingsDialog) SetSize(w, h int)
func (*SettingsDialog) SetUpdateHint ¶ added in v0.0.11
func (s *SettingsDialog) SetUpdateHint(hint string)
SetUpdateHint sets a hint shown under the current version.
func (*SettingsDialog) SetUpdateInfo ¶ added in v0.0.3
func (s *SettingsDialog) SetUpdateInfo(current, latest string, available bool)
SetUpdateInfo sets version information for the updates section.
func (*SettingsDialog) Show ¶
func (s *SettingsDialog) Show()
func (*SettingsDialog) TmuxConfigPath ¶ added in v0.0.20
func (s *SettingsDialog) TmuxConfigPath() string
func (*SettingsDialog) TmuxServer ¶ added in v0.0.20
func (s *SettingsDialog) TmuxServer() string
TmuxServer, TmuxConfigPath, and TmuxSyncInterval return the current (possibly edited) tmux values so the app can persist them into UISettings on close.
func (*SettingsDialog) TmuxSyncInterval ¶ added in v0.0.20
func (s *SettingsDialog) TmuxSyncInterval() string
func (*SettingsDialog) Update ¶
func (s *SettingsDialog) Update(msg tea.Msg) (*SettingsDialog, tea.Cmd)
Update handles input.
func (*SettingsDialog) View ¶
func (s *SettingsDialog) View() string
func (*SettingsDialog) Visible ¶
func (s *SettingsDialog) Visible() bool
type SettingsResult ¶
type SettingsResult struct {
Canceled bool
}
SettingsResult is sent when the settings dialog is closed. Canceled is true when the user dismissed via Esc (revert any live theme preview) rather than confirming via [Close].
type TabSet ¶ added in v0.0.20
TabSet tracks per-workspace tab lists and the active tab index. It is the shared storage + navigation core behind the center tab strip and the sidebar terminal tabs: both keep a map of workspaceID → tabs plus a map of workspaceID → active index, with circular next/prev selection.
The maps are exported because both consumers iterate and mutate them directly in workspace-rebind and session-discovery paths; TabSet owns the navigation math so it is written once.
func (*TabSet[T]) ActiveIdx ¶ added in v0.0.20
ActiveIdx returns the workspace's active tab index (0 when unset).
func (*TabSet[T]) DeleteWorkspace ¶ added in v0.0.20
DeleteWorkspace drops all tab tracking for a workspace.
func (*TabSet[T]) NextIdx ¶ added in v0.0.20
NextIdx advances the active index circularly. It reports the new index and whether a move happened (false when the workspace has no tabs).
func (*TabSet[T]) PrevIdx ¶ added in v0.0.20
PrevIdx moves the active index back circularly. It reports the new index and whether a move happened (false when the workspace has no tabs).
func (*TabSet[T]) SelectIdx ¶ added in v0.0.20
SelectIdx sets the active index when it is in range, reporting success.
func (*TabSet[T]) SetActiveIdx ¶ added in v0.0.20
SetActiveIdx records the workspace's active tab index.
type ThemeColors ¶
type ThemeColors = theme.ThemeColors
type ThemePreview ¶
ThemePreview is sent when user navigates through themes for live preview.
type ToastDismissed ¶
type ToastDismissed struct{}
ToastDismissed is sent when a toast should be dismissed
type ToastModel ¶
type ToastModel struct {
// contains filtered or unexported fields
}
ToastModel manages toast notifications
func (*ToastModel) SetStyles ¶
func (m *ToastModel) SetStyles(styles Styles)
SetStyles updates the toast styles (for theme changes).
func (*ToastModel) ShowError ¶
func (m *ToastModel) ShowError(message string) tea.Cmd
ShowError shows an error toast
func (*ToastModel) ShowInfo ¶
func (m *ToastModel) ShowInfo(message string) tea.Cmd
ShowInfo shows an info toast
func (*ToastModel) ShowSuccess ¶
func (m *ToastModel) ShowSuccess(message string) tea.Cmd
ShowSuccess shows a success toast
func (*ToastModel) ShowWarning ¶
func (m *ToastModel) ShowWarning(message string) tea.Cmd
ShowWarning shows a warning toast
func (*ToastModel) Update ¶
func (m *ToastModel) Update(msg tea.Msg) (*ToastModel, tea.Cmd)
Update handles messages
func (*ToastModel) Visible ¶
func (m *ToastModel) Visible() bool
Visible returns whether the toast is currently visible
Source Files
¶
- agent_picker.go
- clipboard.go
- dialog.go
- dialog_chrome.go
- dialog_render.go
- dialog_update.go
- doc.go
- env_dialog.go
- external_msg.go
- filepicker.go
- filepicker_navigation.go
- filepicker_render.go
- help_items.go
- hit.go
- keys.go
- merge.go
- reporting.go
- safecmd.go
- scroll.go
- selection.go
- selection_scroll.go
- settings.go
- settings_assistants.go
- settings_render.go
- settings_scroll.go
- tab_lru.go
- tabset.go
- theme_reexport.go
- toast.go