From d6dfc913fcca4f25e8d5454a03aa559811fba9ab Mon Sep 17 00:00:00 2001 From: T Date: Tue, 2 Sep 2025 11:55:31 -0600 Subject: brief notes about the TUI for claude --- CLAUDE.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 5026b06..8d10148 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,6 +15,7 @@ Punchcard is a CLI time tracking tool for freelancers and consultants, built in ### Commands Structure - `punch in` - Starts timer (inserts row with start_time, NULL end_time) - `punch out` - Stops active timer (updates end_time), exits non-zero if no active timer +- `punch tui` - Interactive terminal UI with real-time timer updates and history browsing - `punch invoice` - Generates invoice PDF via Typst - `punch timesheet` - Generates timesheet PDF via Typst @@ -39,6 +40,7 @@ CREATE TABLE time_entries ( - **CLI Framework**: github.com/spf13/cobra - **Database**: SQLite3 - **Query Builder**: github.com/sqlc-dev/sqlc +- **TUI Framework**: github.com/charmbracelet/bubbletea with lipgloss styling - **PDF Generation**: Typst (external dependency) ## File Structure @@ -52,7 +54,8 @@ punchcard/ │ ├── database/ # Database connection and migrations │ ├── models/ # Data models │ ├── queries/ # sqlc generated queries -│ └── reports/ # Typst template handling +│ ├── reports/ # Typst template handling +│ └── tui/ # Terminal UI implementation ├── templates/ # Typst templates for PDF generation ├── go.mod ├── go.sum @@ -72,6 +75,12 @@ punchcard/ - Provide helpful error messages - Exit codes: 0 = success, 1 = general error, 2 = no active timer +### TUI Design +- Three-panel layout: timer (top-left), clients/projects (bottom-left), history (right) +- Real-time updates with bubbletea tick messages +- Filterable history with client/project drill-down +- Modal dialogs for editing entries and generating reports + ### PDF Generation - Use Typst templates in `templates/` directory - Invoke `typst compile` subprocess for PDF generation -- cgit v1.2.3