feat(tui): add bubbletea terminal UI #30

Merged
lerko merged 12 commits from feat/tui into main 2026-05-20 01:16:57 +00:00
Owner

Summary

  • Adds nib tui command and make tui target launching a full bubbletea terminal UI
  • Stream view with date-grouped entity list, detail view, and capture input using existing parse grammar
  • Cards view with intent filtering (grab/read/fill), sort cycling (newest/oldest/most used), and pinned-first ordering
  • Search via ?query #tag in capture bar — client-side substring + tag AND matching
  • Absorb flow (m key) with source picker for merging entities
  • Interactive run mode for checklists (space toggles steps, persists on exit)
  • Interactive fill mode for templates (tab between slots, enter copies resolved to clipboard)
  • Promote picker with card type selection and auto-detection from body content
  • Card detail rendering: checklist steps, template slots, decision fields, link URLs
  • Status bar, help overlay (?), tag filter (#), delete confirmation, todo toggle, pin, copy, edit via $EDITOR
  • Extracts generateCardData to shared internal/carddata package (DRY across cmd + tui)
  • Adds CompletedAt/ClearCompleted to EntityUpdate for todo toggling

Files

  • 16 new files in internal/tui/ (~2400 lines)
  • 1 new package internal/carddata/ (extracted from cmd)
  • 1 new command cmd/tui.go
  • Modified: Makefile, cmd/promote.go, internal/db/entities.go, go.mod

Test plan

  • go build ./... compiles clean
  • go test ./... all pass
  • make tui launches alt-screen TUI
  • Stream: j/k navigate, enter views detail, a captures, d deletes with confirm
  • Cards: 2 switches, tab cycles intent, s sorts, pinned at top
  • Search: a then ?query #tag filters, esc clears
  • Absorb: m on fluid entity, pick source, verify merge
  • Run: r on checklist card, space toggles, esc persists steps
  • Fill: f on template card, tab between slots, enter copies resolved
  • Promote: p shows type picker with auto-detection
  • nib promote <id> snippet CLI still works (shared carddata)
## Summary - Adds `nib tui` command and `make tui` target launching a full bubbletea terminal UI - Stream view with date-grouped entity list, detail view, and capture input using existing parse grammar - Cards view with intent filtering (grab/read/fill), sort cycling (newest/oldest/most used), and pinned-first ordering - Search via `?query #tag` in capture bar — client-side substring + tag AND matching - Absorb flow (`m` key) with source picker for merging entities - Interactive run mode for checklists (space toggles steps, persists on exit) - Interactive fill mode for templates (tab between slots, enter copies resolved to clipboard) - Promote picker with card type selection and auto-detection from body content - Card detail rendering: checklist steps, template slots, decision fields, link URLs - Status bar, help overlay (`?`), tag filter (`#`), delete confirmation, todo toggle, pin, copy, edit via $EDITOR - Extracts `generateCardData` to shared `internal/carddata` package (DRY across cmd + tui) - Adds `CompletedAt`/`ClearCompleted` to `EntityUpdate` for todo toggling ## Files - 16 new files in `internal/tui/` (~2400 lines) - 1 new package `internal/carddata/` (extracted from cmd) - 1 new command `cmd/tui.go` - Modified: `Makefile`, `cmd/promote.go`, `internal/db/entities.go`, `go.mod` ## Test plan - [x] `go build ./...` compiles clean - [x] `go test ./...` all pass - [x] `make tui` launches alt-screen TUI - [x] Stream: j/k navigate, enter views detail, `a` captures, `d` deletes with confirm - [x] Cards: `2` switches, `tab` cycles intent, `s` sorts, pinned at top - [x] Search: `a` then `?query #tag` filters, esc clears - [x] Absorb: `m` on fluid entity, pick source, verify merge - [x] Run: `r` on checklist card, space toggles, esc persists steps - [x] Fill: `f` on template card, tab between slots, enter copies resolved - [x] Promote: `p` shows type picker with auto-detection - [x] `nib promote <id> snippet` CLI still works (shared carddata)
lerko added 5 commits 2026-05-18 01:59:57 +00:00
Adds `nib tui` command and `make tui` target. Scrollable entity list
with j/k navigation, enter for detail view, `a` to capture new entries
using the existing parse grammar, and `d` to delete.
Status bar with entity count and context-sensitive key hints. Help
overlay via ? key. Tag filter via # with cursor-navigable tag list.
Todo toggle (x), pin (!), promote (p), demote (D), copy (c), edit (e)
via $EDITOR. Delete confirmation with 3s timeout. Date-grouped list
with completed todo and pinned indicators. Esc clears active tag filter.

Adds CompletedAt/ClearCompleted to EntityUpdate for todo toggling.
Stream/cards toggle with 1/2 keys. Cards view with intent filtering
(tab cycles grab/read/fill/all), sort cycling (s key), pinned-first
ordering, and affordance badges. Promote picker (p key) with card type
selection and auto-detection from body content. Detail view renders
card_data per type: checklist steps, template slots, decision fields,
link URLs.

Extracts generateCardData to internal/carddata for reuse across cmd
and tui packages.
Search uses existing parse grammar ?prefix — type `?query #tag` in
capture bar to filter entities client-side. Substring match on
body+title+description with AND tag filtering. Esc clears search.

Absorb via m key on fluid entities — opens source picker showing all
other entities, enter merges source into target. Uses existing
store.Absorb() backend.
Run mode (r key on checklist cards): cursor navigates steps, space
toggles done/undone, r resets all, esc saves changes to DB and exits.
Persists step state — improvement over web which discards on exit.

Fill mode (f key on template cards): tab/shift-tab navigates slots,
type to fill values, enter resolves template and copies to clipboard
with use count increment. Esc cancels without copying.

Both modes are sub-states of detail view, keeping architecture simple.
Author
Owner
  • need to update relevant documentation
  • audit for security hardening
- need to update relevant documentation - audit for security hardening
lerko added the Feature label 2026-05-18 02:32:36 +00:00
lerko added 1 commit 2026-05-18 03:25:02 +00:00
Split EDITOR env var on whitespace so multi-word values like
"code --wait" work correctly. Add allow-list switch for sort column
and order direction at the query boundary to prevent future callers
from passing unsanitized values into SQL.
lerko added 1 commit 2026-05-19 22:30:24 +00:00
- Add 'reminder' to glyph CHECK constraint (was accepted by parser but
  rejected by DB)
- Default serve bind to 127.0.0.1, add --host flag for LAN access
- Validate card_data as JSON in Store.Create/Update/Promote
- Return pagination envelope {data,total,limit,offset} from list endpoint
- Append absorb breadcrumb to source entity before soft-delete
- Add Levenshtein fuzzy match to catch command typos before routing to add
- Replace DDL string-matching migrations with versioned schema_version table
- Update web UI and API tests for envelope response format
lerko added 2 commits 2026-05-19 23:59:46 +00:00
Three layout improvements for better space utilization:

- Compact date headers: date labels render as left gutter column instead
  of standalone lines, saving one line per date group in stream view
- Input drawer: capture bar expands to 4-line drawer with border, hints,
  and live preview of parsed entity/search query
- Split-pane detail: wide terminals (>=100 cols) show list and detail
  side-by-side with h/l focus switching, falling back to full-screen
  detail on narrow terminals
Reviewed-on: #31
lerko added 1 commit 2026-05-20 00:56:30 +00:00
lerko added 1 commit 2026-05-20 01:01:28 +00:00
lerko added 1 commit 2026-05-20 01:15:02 +00:00
Cover search filtering, intent matching, card affordances, checklist
parsing, template slot discovery/resolve, date grouping, and truncation.
lerko merged commit 618335513b into main 2026-05-20 01:16:57 +00:00
lerko deleted branch feat/tui 2026-05-20 01:16:58 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lerko/nib-v1#30