forked from varia/go-sh-manymanuals
chore: more todos
This commit is contained in:
parent
1715eecaf0
commit
6a33e78d01
6
gshmm.go
6
gshmm.go
@ -56,6 +56,7 @@ type model struct {
|
|||||||
dataSheetViewport viewport.Model
|
dataSheetViewport viewport.Model
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: cache this somewhere, it's called several times... in the model?
|
||||||
func (m model) dataSheetNames() []string {
|
func (m model) dataSheetNames() []string {
|
||||||
var names []string
|
var names []string
|
||||||
for _, datasheet := range m.datasheets {
|
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
|
// TODO: implement cursor for scrolling up/down filtered
|
||||||
// results so we can view the PDF contents as desired
|
// 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]
|
lastDatasheet := m.dataSheetsView[len(m.dataSheetsView)-1]
|
||||||
viewportText := m.datasheetFromName(lastDatasheet)
|
viewportText := m.datasheetFromName(lastDatasheet)
|
||||||
m.dataSheetViewport.SetContent(viewportText)
|
m.dataSheetViewport.SetContent(viewportText)
|
||||||
@ -182,7 +183,10 @@ func (m model) View() string {
|
|||||||
|
|
||||||
// TODO: paginate / trim view to last 10 or something?
|
// TODO: paginate / trim view to last 10 or something?
|
||||||
sheets := strings.Join(m.dataSheetsView, "\n")
|
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())
|
panes := lipgloss.JoinHorizontal(lipgloss.Left, sheets, m.dataSheetViewport.View())
|
||||||
|
|
||||||
body.WriteString(panes)
|
body.WriteString(panes)
|
||||||
|
|
||||||
body.WriteString("\n" + m.filterInput.View())
|
body.WriteString("\n" + m.filterInput.View())
|
||||||
|
Loading…
Reference in New Issue
Block a user