From 2234f9d7e46550b3c369d2f0af61cc93964d4efe Mon Sep 17 00:00:00 2001 From: tiff Date: Thu, 1 May 2025 13:02:23 -0400 Subject: [PATCH] update --- goto-do/cmd/root.go | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/goto-do/cmd/root.go b/goto-do/cmd/root.go index 13f53fd..5da4d38 100644 --- a/goto-do/cmd/root.go +++ b/goto-do/cmd/root.go @@ -5,16 +5,39 @@ package cmd import ( "fmt" + "os" + "os/signal" + "github.com/charmbracelet/bubbles/table" tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" + "context" + "database/sql" + "flag" + "log" + "time" + ) + +var baseStyle = lipglodd.NewStyle(). + BorderStyle(lipgloss.NormalBorder()). + BorderForeground(lipgloss.Color("240")) + + + +// Think of this `struct` as a JavaScript object or Python dictionary type model struct { + // methods? Probably not todos []string // items on the to-do list - cursor int // which to-do list item our cursor is pointing at + cursor int // which to-do list item our cursor is pointing at +// so it looks like Go doesn't have `_self` or `this`? selected map[int]struct{} // which to-do items are selected + table table.Model } +func (m model) Init() tea.Cmd { return nil } + func initialModel() model { return model{ // Our to-do list is a grocery list