Documentation
¶
Overview ¶
Package workbench is the local-data showcase: every row component on one screen, cooperating, so a change that breaks an older feature shows up where you can see it.
┌ deployments ───────────────────┐┌ cluster ──────────┐ │ filterable, sortable, markable ││ searchable, │ │ table ││ markable tree │ └────────────────────────────────┘└───────────────────┘ ┌ pods ─────────┐┌ detail ───────────┐┌ operations ───┐ │ markable list ││ filterable ││ grouped menu │ │ ││ inspector ││ │ └───────────────┘└───────────────────┘└───────────────┘
What it exercises:
- focus.Group over five panes: tab / shift+tab cycle, a click focuses, keys go to the focused pane only and the mouse to all of them (rule 6). The operations menu sits in the Group, so it leaves tab to it and jumps its sections on [ / ].
- Master-detail: the pods list follows the table's cursor, and the detail inspector follows whichever of table, tree or pods last had focus. Enter (or a double click) on the table moves focus to its pods; on a pod, to the detail (rule 16).
- Marking (rule 32): x, X, A, D and the ✓ gutter in the table, the tree and the pods list. Counts sit on each border, so a mark filtered or folded out of sight is still visible as a number.
- The action menu ("a" or right-click) offers verbs for the focused pane's selection, filed read / write / danger. Describe is not Multi, so a second mark dims it; Delete confirms first and is guarded. A marked tree branch cascades to its pods for Restart but not for Describe.
- Feedback by weight: the operations menu runs statusbar notices, the confirm modal and the alert modal.
- Mouse: header clicks sort, ▸/▾ glyphs toggle, the wheel scrolls the pane under it without taking focus, scrollbars drag.
- SetTheme carries every pane's cursor, filter, marks and expansion across a palette or surface swap, including a modal that is up (rule 4).
Index ¶
- func New(t theme.Theme) screen.Screen
- type Screen
- func (s *Screen) Actions() action.Set
- func (s *Screen) Help() []key.Binding
- func (s *Screen) HelpSections() []help.Section
- func (s *Screen) Init() tea.Cmd
- func (s *Screen) IsCapturingKeys() bool
- func (s *Screen) Layout() layout.Node
- func (s *Screen) OnEnter(any) tea.Cmd
- func (s *Screen) SetTheme(t theme.Theme)
- func (s *Screen) Title() string
- func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
func (*Screen) Actions ¶
Actions satisfies action.Provider: the verbs for whatever the focused pane has selected, rebuilt on every call so they always describe the selection as it is now. Panes with nothing to act on offer nothing, and the shell leaves the actions key inert there.
Every verb reads Selection(), which is the marked keys or the cursor's key when nothing is marked. The arity difference lives in Multi, and the menu enforces it: mark a second row and Describe dims itself with a reason.
func (*Screen) HelpSections ¶
HelpSections is the Group's, which names each pane's groups after it, or the modal's alone while one is up, since nothing else takes input then.