From 6a33e78d015a5ced77bf0bd9177bc27cfc903a10 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 10 May 2023 16:45:23 +0200 Subject: [PATCH] chore: more todos --- gshmm.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gshmm.go b/gshmm.go index d125d33..a836d7c 100644 --- a/gshmm.go +++ b/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())