put-item: a few fixes
- Added Goreleaser configuration - Changed some key bindings for the table list - Started working on full display of items
This commit is contained in:
parent
e5a7b82a63
commit
8d984119cc
4 changed files with 151 additions and 0 deletions
37
internal/dynamo-browse/ui/teamodels/itemdisplay/model.go
Normal file
37
internal/dynamo-browse/ui/teamodels/itemdisplay/model.go
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
package itemdisplay
|
||||
|
||||
import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/layout"
|
||||
"github.com/lmika/awstools/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))
|
||||
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
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package tableselect
|
||||
|
||||
import (
|
||||
"github.com/charmbracelet/bubbles/key"
|
||||
"github.com/charmbracelet/bubbles/list"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
|
|
@ -32,6 +33,22 @@ func newListController(tableNames []string, w, h int) listController {
|
|||
Padding(0, 0, 0, 1)
|
||||
|
||||
list := list.New(items, delegate, w, h)
|
||||
list.KeyMap.CursorUp = key.NewBinding(
|
||||
key.WithKeys("up", "i"),
|
||||
key.WithHelp("↑/i", "up"),
|
||||
)
|
||||
list.KeyMap.CursorDown = key.NewBinding(
|
||||
key.WithKeys("down", "k"),
|
||||
key.WithHelp("↓/k", "down"),
|
||||
)
|
||||
list.KeyMap.PrevPage = key.NewBinding(
|
||||
key.WithKeys("left", "j", "pgup", "b", "u"),
|
||||
key.WithHelp("←/j/pgup", "prev page"),
|
||||
)
|
||||
list.KeyMap.NextPage = key.NewBinding(
|
||||
key.WithKeys("right", "l", "pgdown", "f", "d"),
|
||||
key.WithHelp("→/l/pgdn", "next page"),
|
||||
)
|
||||
list.SetShowTitle(false)
|
||||
|
||||
return listController{list: list}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue