diff --git a/pkg/gui/context/migrations_context.go b/pkg/gui/context/migrations_context.go index 9e065b1..eea09a8 100644 --- a/pkg/gui/context/migrations_context.go +++ b/pkg/gui/context/migrations_context.go @@ -42,6 +42,7 @@ type MigrationsContext struct { } var _ types.Context = &MigrationsContext{} +var _ types.IListContext = &MigrationsContext{} type MigrationsContextOpts struct { Gui *gocui.Gui @@ -276,6 +277,16 @@ func (m *MigrationsContext) SelectPrev() { } } +// GetSelectedIdx returns the index of the currently selected item. +func (m *MigrationsContext) GetSelectedIdx() int { + return m.selected +} + +// GetItemCount returns the number of items in the current tab. +func (m *MigrationsContext) GetItemCount() int { + return len(m.items) +} + // --------------------------------------------------------------------------- // Scroll overrides (list-aware: also update selection) // ---------------------------------------------------------------------------