dynamo-browse/internal/dynamo-browse/ui/teamodels/itemdisplay/model.go
Leon Mika 79692302af
Issue 23: Added progress indicators and cancellation (#34)
- Wrapped all table operations in a new foreground job context, which mediates foreground tasks.
- Added cancellation support and partial results for table read operations.
- Added the "mark" command, which can mark, unmark & toggle marked items
- Added support for alias arguments.
- Removed the "unmark" command, and replaced it as an alias to the "marked" command
- Fixed seg faults raised when there is no table shown in the result set.
2022-10-10 10:15:25 +11:00

38 lines
731 B
Go

package itemdisplay
import (
tea "github.com/charmbracelet/bubbletea"
"github.com/lmika/audax/internal/dynamo-browse/ui/teamodels/layout"
"github.com/lmika/audax/internal/dynamo-browse/ui/teamodels/utils"
)
type Model struct {
baseMode tea.Model
}
func New(baseMode tea.Model) *Model {
return &Model{
baseMode: baseMode,
}
}
func (m *Model) Init() tea.Cmd {
return nil
}
func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cc utils.CmdCollector
m.baseMode = cc.Collect(m.baseMode.Update(msg)).(tea.Model)
return m, cc.Cmd()
}
func (m *Model) View() string {
return m.baseMode.View()
}
func (m *Model) Resize(w, h int) layout.ResizingModel {
m.baseMode = layout.Resize(m.baseMode, w, h)
return m
}