Browse Source

chore: more todos

main
decentral1se 2 years ago
parent
commit
6a33e78d01
No known key found for this signature in database GPG Key ID: 3789458B3D0C410
  1. 6
      gshmm.go

6
gshmm.go

@ -56,6 +56,7 @@ type model struct {
dataSheetViewport viewport.Model
}
// TODO: cache this somewhere, it's called several times... in the model?
func (m model) dataSheetNames() []string {
var names []string
for _, datasheet := range m.datasheets {
@ -153,7 +154,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// TODO: implement cursor for scrolling up/down filtered
// results so we can view the PDF contents as desired
// it's currently just the last one (closed to input)
// it's currently just the last one (closest to input)
lastDatasheet := m.dataSheetsView[len(m.dataSheetsView)-1]
viewportText := m.datasheetFromName(lastDatasheet)
m.dataSheetViewport.SetContent(viewportText)
@ -182,7 +183,10 @@ func (m model) View() string {
// TODO: paginate / trim view to last 10 or something?
sheets := strings.Join(m.dataSheetsView, "\n")
// TODO: style further with lipgloss, e.g. borders, margins, etc.
panes := lipgloss.JoinHorizontal(lipgloss.Left, sheets, m.dataSheetViewport.View())
body.WriteString(panes)
body.WriteString("\n" + m.filterInput.View())

Loading…
Cancel
Save