Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Track time entries, manage clients and projects, set billing rates, mark work as

## Features

- **Timer tracking** — start/stop timers on tasks, see the live elapsed time in the bottom status bar
- **Timer tracking** — start/stop timers on tasks, see the live elapsed time in the tab bar on every tab
- **Clients & Projects** — full CRUD, clients on their own tab with project management next door
- **Billing rates** — set an hourly rate per client; earnings calculated automatically
- **Invoice & payment tracking** — mark entries as invoiced and/or paid
Expand Down Expand Up @@ -217,6 +217,11 @@ That rewrites the generated files (marked as generated; never edit them by hand)
| `space` | Start / stop selected entry's timer |
| `i` | Toggle invoiced status |
| `p` | Toggle paid status (entry must be invoiced first) |
| `r` | Resume: start the selected entry's task again |
| `t` / `w` / `m` / `a` | Range: today, this week, this month, all time |
| `y` | Range: yesterday |
| `f` | Range: custom dates |
| `enter` | Compact layout (under 120 columns, or under 23 rows): open the selected entry's details |
| `esc` | Cancel / back |

### New / Edit timer form
Expand Down Expand Up @@ -329,16 +334,17 @@ notch/
│ └── db.go # SQLite persistence (modernc.org/sqlite, pure Go)
├── theme/
│ ├── theme.go # Palette type, desktop theme and theme.conf loading, live reload
│ └── tokens_gen.go # Generated: the built-in palette, glyphs and gutter
│ └── tokens_gen.go # Generated: the built-in palette, glyphs and TUI layout sizes
├── status/
│ └── status.go # `notch status` output formatting (text/JSON)
└── ui/
├── app.go # Root Bubble Tea model, tab router, header/footer
├── app.go # Root Bubble Tea model, tab router, tab bar and hotkey line
├── styles.go # Layout helpers (content width and padding)
├── layout_gen.go # Generated: layout constants (max width, chrome rows)
└── views/
├── common.go # Shared types, messages, styles, key maps, helpers
├── timers.go # Timers tab — list, start/stop, edit, invoice/pay
├── timers_view.go # Timers list screen: hero, range chips, day groups, detail pane
├── projects.go # Projects tab — flat project list w/ client picker
├── clients.go # Clients tab — client CRUD with billing rate
└── reports.go # Reports tab — date-filtered summary + cards
Expand Down
34 changes: 28 additions & 6 deletions design/build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,33 @@ func renderPalette(t *Tokens) ([]byte, error) {
fmt.Fprintf(&b, "\t%s = %q\n", goName(tok.Name), v)
}
b.WriteString(")\n\n")
gutter, err := integer(t.Spacing, "tui-gutter")
if err != nil {
return nil, err
for _, c := range []struct{ token, name string }{
{"tui-gutter", "Gutter"},
{"tui-margin", "Margin"},
{"tui-wide", "WideMin"},
{"tui-detail-width", "DetailWidth"},
{"tui-detail-label", "DetailLabel"},
{"tui-detail-note-rows", "DetailNoteRows"},
{"tui-pane-gap", "PaneGap"},
{"tui-col-trail", "ColTrail"},
{"tui-wordmark-gap", "WordmarkGap"},
{"tui-tab-gap", "TabGap"},
{"tui-key-gap", "KeyGap"},
{"tui-col-duration", "ColDuration"},
{"tui-col-gap", "ColGap"},
{"tui-col-status", "ColStatus"},
{"tui-col-earned", "ColEarned"},
{"tui-hero-rows", "HeroRows"},
{"tui-hero-rows-compact", "HeroRowsCompact"},
} {
v, err := integer(t.Spacing, c.token)
if err != nil {
return nil, err
}
b.WriteString(comment("", c.name+" ("+c.token+"). "+usage(t.Spacing, c.token)))
fmt.Fprintf(&b, "const %s = %d\n\n", c.name, v)
}
b.WriteString(comment("", "Gutter (tui-gutter). "+usage(t.Spacing, "tui-gutter")))
fmt.Fprintf(&b, "const Gutter = %d\n", gutter)
return format.Source([]byte(b.String()))
return format.Source([]byte(strings.TrimRight(b.String(), "\n") + "\n"))
}

func renderLayout(t *Tokens) ([]byte, error) {
Expand All @@ -331,6 +351,8 @@ func renderLayout(t *Tokens) ([]byte, error) {
for _, c := range []struct{ token, name string }{
{"tui-max-width", "MaxContentWidth"},
{"tui-chrome-rows", "ChromeRows"},
{"tui-min-width", "MinWidth"},
{"tui-min-height", "MinHeight"},
} {
v, err := integer(t.Spacing, c.token)
if err != nil {
Expand Down
48 changes: 33 additions & 15 deletions design/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{ "name": "primary", "value": "#91B0DE", "usage": "Active tab, selected-row marker, primary buttons (bg text on it), the running timer. Aether's accent." },
{ "name": "accent", "value": "#9DC6E9", "usage": "Field labels, links, code in the landing page. Aether's cyan." },
{ "name": "success", "value": "#99C2ED", "usage": "Paid status, the running pill. Aether's green." },
{ "name": "warning", "value": "#A4CBF7", "usage": "Invoiced status, section titles and day headers. Aether's yellow." },
{ "name": "warning", "value": "#A4CBF7", "usage": "Section titles and invoiced status in Reports, and the unbilled total in the Timers hero. (The Timers list draws invoiced in accent and day headers in primary.) Aether's yellow." },
{ "name": "danger", "value": "#C79EA9", "usage": "Delete actions and confirm borders, field errors. Aether's red; the only warm hue." },
{ "name": "text", "value": "#C2D9E9", "usage": "Body text and values on bg and bg_alt. Aether's light_fg. Tailwind name: ink." },
{ "name": "dim", "value": "#B7D2E5", "usage": "Secondary text: meta lines, inactive tabs. Aether's fg." },
Expand Down Expand Up @@ -59,7 +59,25 @@
"tokens": [
{ "name": "tui-max-width", "value": 150, "usage": "TUI: the widest the centred content column gets, in cells. Wider terminals pad both sides." },
{ "name": "tui-gutter", "value": 2, "usage": "TUI: columns before every list row for the row cursor (glyph-cursor and a space). Report columns leave the same room." },
{ "name": "tui-chrome-rows", "value": 9, "usage": "TUI: rows taken by the top bar, hotkey bar and footer (3 each, measured from their real output). Content gets the rest." },
{ "name": "tui-margin", "value": 2, "usage": "TUI: blank columns on each side of the content column, and before the tab bar's wordmark." },
{ "name": "tui-wide", "value": 120, "usage": "TUI: the narrowest terminal that gets the wide layout: the Timers hero with block digits, the CLIENT › PROJECT column and the entry detail pane. The wide layout also needs 23 rows, so the pane fits its borders, the task and its five keys below the hero and range chips (computed in timers_view.go's wide()); narrower or shorter terminals get the compact layout." },
{ "name": "tui-detail-width", "value": 42, "usage": "TUI: the entry detail pane's width, borders included, beside the Timers list in the wide layout." },
{ "name": "tui-pane-gap", "value": 2, "usage": "TUI: blank columns between the Timers list and the entry detail pane in the wide layout." },
{ "name": "tui-col-trail", "value": 1, "usage": "TUI: the blank column after the Timers list's last column, day subtotals and total." },
{ "name": "tui-wordmark-gap", "value": 4, "usage": "TUI: blank columns between the wordmark and the first tab in the tab bar." },
{ "name": "tui-tab-gap", "value": 2, "usage": "TUI: blank columns between tabs, and after the wordmark's mark when a narrow tab bar shortens it." },
{ "name": "tui-key-gap", "value": 3, "usage": "TUI: blank columns between keys on the hotkey line." },
{ "name": "tui-col-duration", "value": 10, "usage": "TUI: the Timers list's DURATION column, right-aligned, in cells." },
{ "name": "tui-col-gap", "value": 2, "usage": "TUI: the gap between the Timers list's DURATION and STATUS columns." },
{ "name": "tui-col-status", "value": 12, "usage": "TUI: the Timers list's STATUS column in the wide layout, room for its longest value (◐ invoiced). The compact layout gives STATUS 5/12 of the flexible width, never less than this." },
{ "name": "tui-col-earned", "value": 10, "usage": "TUI: the Timers list's EARNED column, right-aligned, in cells." },
{ "name": "tui-detail-label", "value": 10, "usage": "TUI: the label column in the entry detail pane (Task, Client, Duration…)." },
{ "name": "tui-detail-note-rows", "value": 3, "usage": "TUI: the most rows an entry's notes take in the detail pane; longer notes end in an ellipsis." },
{ "name": "tui-hero-rows", "value": 6, "usage": "TUI: rows the wide Timers hero takes, borders included: four rows for the label, task, place and meta line beside three rows of block digits." },
{ "name": "tui-hero-rows-compact", "value": 4, "usage": "TUI: rows the compact Timers hero takes, borders included: the task and elapsed time, then the place and today's total." },
{ "name": "tui-min-width", "value": 64, "usage": "TUI: the narrowest terminal notch draws, in cells, measured from the views: the widest fixed line is the Projects tab's at 57 cells, 61 with the two margins; the compact Timers range chips need 48. Narrower terminals get a centred \"Terminal too small\" message." },
{ "name": "tui-min-height", "value": 22, "usage": "TUI: the shortest terminal notch draws, in rows: the chrome (4), the body's top and bottom padding (2), the compact Timers screen's fixed rows (14) and two list rows (a day header and the selected entry). A wide terminal this short gets the compact layout, since the wide one needs 23 rows (see tui-wide). Shorter terminals get a centred \"Terminal too small\" message." },
{ "name": "tui-chrome-rows", "value": 4, "usage": "TUI: rows taken by the chrome: the tab bar and its rule at the top, and a rule and the hotkey and status line at the bottom (measured from their real output). Content gets the rest." },
{ "name": "panel-padding", "value": "14px", "usage": "Bar panel: inner padding, from aliasOS's KeyboardPanel." }
]
},
Expand Down Expand Up @@ -97,10 +115,10 @@
{ "name": "glyph-wordmark", "value": "◷", "usage": "The mark before the notch wordmark." },
{ "name": "glyph-cursor", "value": "▌", "usage": "The selected row's cursor in the TUI gutter, in primary." },
{ "name": "glyph-live", "value": "●", "usage": "The dot in the footer: in the running pill, and in subtle when idle." },
{ "name": "glyph-unbilled", "value": "○", "usage": "Status: not invoiced yet. Redesign (ALI-2615): not drawn yet." },
{ "name": "glyph-invoiced", "value": "◐", "usage": "Status: invoiced, not paid. Redesign (ALI-2615): not drawn yet." },
{ "name": "glyph-paid", "value": "●", "usage": "Status: paid. Redesign (ALI-2615): not drawn yet." },
{ "name": "glyph-running", "value": "▶", "usage": "Status: the timer is running. Redesign (ALI-2615): not drawn yet." }
{ "name": "glyph-unbilled", "value": "○", "usage": "Status: not invoiced yet, in subtle." },
{ "name": "glyph-invoiced", "value": "◐", "usage": "Status: invoiced, not paid, in accent." },
{ "name": "glyph-paid", "value": "●", "usage": "Status: paid, in success." },
{ "name": "glyph-running", "value": "▶", "usage": "Status: the timer is running, in success; also marks the running timer in the compact hero." }
]
},
"contrast": {
Expand All @@ -111,22 +129,22 @@
{ "fg": "dim", "bg": "bg_alt", "min": 4.5, "usage": "Secondary text on the selected row." },
{ "fg": "subtle", "bg": "bg", "min": 4.5, "usage": "Hints and key labels." },
{ "fg": "subtle", "bg": "bg_alt", "min": 4.5, "usage": "Hints in fields and on the selected row." },
{ "fg": "primary", "bg": "bg", "min": 4.5, "usage": "Active tab and the running timer." },
{ "fg": "accent", "bg": "bg", "min": 4.5, "usage": "Field labels and links." },
{ "fg": "success", "bg": "bg", "min": 4.5, "usage": "Paid status." },
{ "fg": "warning", "bg": "bg", "min": 4.5, "usage": "Section titles and invoiced status." },
{ "fg": "primary", "bg": "bg", "min": 4.5, "usage": "Day headers in the Timers list and the active tab's underline." },
{ "fg": "accent", "bg": "bg", "min": 4.5, "usage": "Field labels, links, and invoiced status (◐) in the Timers list." },
{ "fg": "success", "bg": "bg", "min": 4.5, "usage": "Paid and running status, the hero's elapsed time and status messages." },
{ "fg": "warning", "bg": "bg", "min": 4.5, "usage": "Section titles and invoiced status in Reports, and the Timers hero's unbilled total." },
{ "fg": "danger", "bg": "bg", "min": 4.5, "usage": "Errors and delete actions." },
{ "fg": "danger", "bg": "bg_alt", "min": 4.5, "usage": "Field errors inside modals." },
{ "fg": "highlight", "bg": "bg", "min": 4.5, "usage": "Wordmark and elapsed time." },
{ "fg": "bg", "bg": "primary", "min": 4.5, "usage": "Primary button label." },
{ "fg": "bg", "bg": "primary", "min": 4.5, "usage": "Primary button label and the active range chip." },
{ "fg": "bg", "bg": "success", "min": 4.5, "usage": "Running pill label." },
{ "fg": "bg", "bg": "accent", "min": 4.5, "usage": "Accent chip label." },
{ "fg": "border", "bg": "bg", "min": 3, "usage": "Rules and box borders." },
{ "fg": "primary", "bg": "bg_alt", "min": 4.5, "usage": "Selected row marker and the primary label in modals." },
{ "fg": "accent", "bg": "bg_alt", "min": 4.5, "usage": "Field labels inside modals." },
{ "fg": "success", "bg": "bg_alt", "min": 4.5, "usage": "Paid status on the selected row." },
{ "fg": "warning", "bg": "bg_alt", "min": 4.5, "usage": "Invoiced status on the selected row." },
{ "fg": "highlight", "bg": "bg_alt", "min": 4.5, "usage": "Elapsed time on the selected row and in the panel." },
{ "fg": "accent", "bg": "bg_alt", "min": 4.5, "usage": "Field labels inside modals, and invoiced status on the Timers list's selected row." },
{ "fg": "success", "bg": "bg_alt", "min": 4.5, "usage": "Paid and running status on the selected row." },
{ "fg": "warning", "bg": "bg_alt", "min": 4.5, "usage": "Invoiced status on the selected row in Reports." },
{ "fg": "highlight", "bg": "bg_alt", "min": 4.5, "usage": "The wordmark in the tab bar, and elapsed time in the panel." },
{ "fg": "dim", "bg": "surface", "min": 4.5, "usage": "Landing page secondary text in cards." },
{ "fg": "highlight", "bg": "surface", "min": 4.5, "usage": "Landing page emphasis and the mark in cards." },
{ "fg": "danger", "bg": "surface", "min": 4.5, "usage": "Landing page feature icons in danger." },
Expand Down
83 changes: 78 additions & 5 deletions internal/theme/tokens_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading