Documentation
¶
Overview ¶
Package ui hosts the bubbletea application that powers `tmh` (no args).
The model is a thin router: each screen is a sub-model with its own Update/View. Heavy work lives in internal/actions; the UI never calls tmux directly outside of polling tmux.Runner via the same actions.
Package ui hosts the bubbletea application and its screens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Runner tmux.Runner
State *appstate.DB
ConfigPath string
Profile string
LoadConfig func() (*config.Config, error)
}
Deps wires the side-effect surface the UI needs. Tests pass a MockRunner here; production passes CLIRunner + the real config path.
type Keys ¶
type Keys struct {
Up, Down, Left, Right key.Binding
PgUp, PgDown key.Binding
Top, Bottom key.Binding
Enter, Esc, Quit key.Binding
Tab key.Binding
Attach, NewSession, Kill, Sync, Reload key.Binding
ConfigEditor, Diff, Snapshot, Undo key.Binding
Palette, Help, Theme, Search key.Binding
Refresh, Settings, History key.Binding
// Marks / last-location (4.1 + 4.2)
PrevLoc key.Binding // ” — pop last location
MarkSet key.Binding // m — begin set-mark two-step
MarkJump key.Binding // ' — begin jump-to-mark two-step
}
Keys defines every binding the TUI listens for. Centralised here so the help overlay can render them and so they can be overridden in the future from ~/.config/tmh/keys.yml.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root bubbletea model.
func (*Model) Init ¶
Init triggers the first data load + polling tick + async history load + first pane-refresh tick.
type PaletteAction ¶
type PaletteAction struct {
Title string
Subtitle string
Run func() tea.Cmd
NeedsParam bool
ParamPrompt string // shown as placeholder in param mode
ParamRun func(string) tea.Cmd
}
PaletteAction is one row in the command palette. If NeedsParam is true, pressing Enter on this action switches the palette into a parameter-input mode. ParamRun is called with the collected input. Otherwise Run is called directly.
type UISettings ¶
type UISettings struct {
Title string
Language string
Theme string
Tmux string
Hint string
// Category names for the master-detail layout.
CatAppearance string
CatDisplay string
CatHistory string
CatMarks string
CatTmux string
CatBehaviour string
CatKeybindings string
// Navigation hints.
HintCategories string
HintFields string
HintDirty string
HintDiscard string
// Action feedback.
Saved string
TmuxConfWritten string
}
type UIStrings ¶
type UIStrings struct {
Loading string
NoSessions string
NothingSelected string
AttachHint string
Modal UIModal
Keymap UIKeymap
Settings UISettings
Diff UIDiff
Palette UIPalette
Toast UIToast
}
UIStrings holds all translated UI-level strings. Built once per language via LoadStrings() and stored on Model; sub-models receive a copy at construction time. When the active language changes, Model.strings is rebuilt and propagated to long-lived children (dashboard) via SetStrings.
Parametric messages (with {{.name}} placeholders) live under the Tf* method helpers, which defer to i18n.Tf so call-sites can pass template data directly.
func LoadStrings ¶
func LoadStrings() UIStrings
LoadStrings pulls every plain translation from i18n.T into a typed bundle. Call after i18n.Init() (re)sets the active language.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package errrender turns internal sentinel errors into localized, user-facing strings.
|
Package errrender turns internal sentinel errors into localized, user-facing strings. |
|
Package pane provides an in-memory cache of pane runtime data fetched via a single batch `tmux list-panes -a` call.
|
Package pane provides an in-memory cache of pane runtime data fetched via a single batch `tmux list-panes -a` call. |
|
Package picker renders a small interactive fuzzy-filter list of tmh session candidates (declared + live ad-hoc + discovered) so that bare `tmh` invocations behave like sesh — type-to-filter + Enter-to-attach — without forcing users through the full TUI dashboard.
|
Package picker renders a small interactive fuzzy-filter list of tmh session candidates (declared + live ad-hoc + discovered) so that bare `tmh` invocations behave like sesh — type-to-filter + Enter-to-attach — without forcing users through the full TUI dashboard. |
|
Package refresh provides a cadenced pane-command batch fetcher for the tmh TUI.
|
Package refresh provides a cadenced pane-command batch fetcher for the tmh TUI. |
|
Package theme defines lipgloss styles for the tmh TUI.
|
Package theme defines lipgloss styles for the tmh TUI. |
|
Package toast defines toast notification kinds and helpers for the tmh TUI.
|
Package toast defines toast notification kinds and helpers for the tmh TUI. |