Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New builds the version list. It starts empty and loading; the page switch issues GetBackups, whose result fills it via BackupListMsg.
It starts focused because the page opens on the list: it is the panel with the cursor, and the preview has nothing to scroll until that cursor picks a row.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Backups page's left panel: a merged, newest-first list of stored versions of the compose file and the .env.
It owns the cursor and nothing else. The bytes behind the selected row belong to backuppreviewpanel, which learns about the selection through cmds.SetSelectedBackupMsg rather than by being handed a pointer - the two panels are siblings under AppModel, the same as Home's list and details.
The rows live in a bubbles list, the same as the groups and services lists, which is where the cursor, the pagination and the filter come from. This panel hand-rolled all three until it was brought in line; see docs/plans/backups-rework.md.
func (Model) FilterState ¶
func (m Model) FilterState() list.FilterState
FilterState exposes how much of the keyboard the list has taken, so AppModel can snapshot it into the help overlay's context.
func (Model) KeepsEsc ¶
KeepsEsc reports whether the list needs esc for itself. Same rule as the groups list - see groupslist.Model.KeepsEsc. It is the only thing esc does on this page: there is no selection to clear here, so with no filter standing the key is inert and the footer does not offer it.
func (Model) ListEmpty ¶
ListEmpty reports whether there are any stored versions at all, so the footer and the help overlay can drop the filter key on an empty store. AppModel derives Home's and Services' emptiness from the loaded config; the backup store is only known here, so this panel has to answer for itself.
func (Model) OwnsKeyboard ¶
OwnsKeyboard reports whether the list is taking every keystroke for itself, which it does while a filter is being typed. Same rule as the groups list - see groupslist.Model.OwnsKeyboard.