Commit Graph

127 Commits

Author SHA1 Message Date
lerko d24df8432f Merge pull request 'feat(tui): add tag autocomplete and query composition' (#43) from feat/tag-autocomplete-query-compose into main
CI / test (push) Successful in 2m17s
Reviewed-on: #43
2026-05-21 16:22:00 +00:00
lerko e22e040688 feat(tui): add tag autocomplete and query composition
CI / test (pull_request) Successful in 2m31s
Tag autocomplete shows suggestions when typing #partial in capture bar.
Tab/enter accepts, up/down navigates, esc dismisses.

Query composition extends ? search with date filters (@today, @week,
@month, <7d, >30d), card type filters (^snippet), all composable
with existing text and tag filters.
2026-05-21 12:12:07 -04:00
lerko 29bd7d3dc6 Merge pull request 'fix(ci): act runner compatibility' (#42) from fix/ci-act-runner-compat into main
CI / test (push) Successful in 2m41s
Reviewed-on: #42
2026-05-21 15:11:04 +00:00
lerko a9da5c1765 fix(ci): act runner compatibility
CI / test (pull_request) Successful in 2m28s
- Default shell to sh (act runner image lacks bash)
- Drop -race flag (requires cgo, unavailable in act runner)
2026-05-21 11:07:37 -04:00
lerko b9b3f99be9 Revert "fix(ci): use sh instead of bash for act runner compatibility"
CI / test (push) Failing after 13s
This reverts commit cae651302a.
2026-05-21 11:07:10 -04:00
lerko cae651302a fix(ci): use sh instead of bash for act runner compatibility
CI / test (push) Failing after 1m25s
Gitea act runner image lacks bash, causing all run steps to fail with
exit 127. Default shell to sh which is available in all images.
2026-05-21 10:54:34 -04:00
lerko 8fc686ec6d Merge pull request 'feat(export): add HTML card deck export' (#41) from feat/html-card-export into main
CI / test (push) Failing after 17s
2026-05-21 02:00:38 +00:00
lerko 564039112a feat(export): add HTML card deck export
CI / test (pull_request) Failing after 10s
Self-contained single-file HTML export for cards. Mobile-first,
dark theme, zero dependencies. Each card type gets its own
interactive treatment: snippet tap-to-copy, template slot filling,
checklist with progress bar, decision structured layout, link
tap targets. Filter chips by type, search across all cards.

Usage: nib export -f html -o deck.html
       nib export -f html -t triage -o triage.html
2026-05-20 21:49:19 -04:00
lerko eea59b3f3c Merge pull request 'fix: code hardening from senior dev audit' (#40) from fix/audit-phase1-hardening into main
CI / test (push) Failing after 16s
2026-05-21 01:04:30 +00:00
lerko ceb29fdd7b chore: mark all audit phases complete in TODO
CI / test (pull_request) Failing after 56s
2026-05-20 20:54:57 -04:00
lerko 2152baeb4f feat: add export and backup commands
- nib export: dump all entities to JSON (stdout or --output file)
- nib backup: atomic SQLite backup via VACUUM INTO (WAL-safe)
- Store.Backup() method on db layer
- Tests for both commands
2026-05-20 20:54:44 -04:00
lerko 33f6d99ba7 test(cmd): add tests for add, delete, promote, demote, absorb, ls
Covers happy paths, error cases (not found, already promoted,
already fluid, crystallized target, same-entity absorb), and
empty result sets. Uses NIB_DB env var for test isolation.
2026-05-20 20:52:57 -04:00
lerko d715b053e7 refactor(db): thread context.Context through all Store methods
Enables request-scoped cancellation, timeouts, and graceful shutdown
for all database operations across API handlers, CLI commands, and TUI.
2026-05-20 20:51:51 -04:00
lerko 50b80f4407 ci: add Gitea Actions workflow for test and lint on PR 2026-05-20 20:42:16 -04:00
lerko 8663beeb96 fix: harden API, DB, and web layer from audit findings
- Cap list API limit at 200 to prevent unbounded queries
- Sanitize markdown output with DOMPurify to prevent XSS
- Add v4 migration with indexes on deleted_at and modified_at
- Fix v2 migration swallowed ALTER TABLE errors
- Tighten ~/.nib directory permissions to 0o700
2026-05-20 20:41:53 -04:00
lerko 1ac4196547 Merge pull request 'feat(tui): add 13 preloaded themes matching web design system' (#39) from feat/tui-theme into main
Reviewed-on: #39
2026-05-21 00:27:49 +00:00
lerko a96c1a52f4 feat(tui): add 13 preloaded themes matching web design system
Port all web CSS token themes to TUI via shared vocabulary (accent, dim,
muted, ok, todo, event, remind, danger). Styles rebuild from active
theme on switch. Press T to cycle, persists to ~/.nib/theme. Glamour
markdown renderer respects light/dark per theme.
2026-05-20 20:13:21 -04:00
lerko db1dc135d2 Merge pull request 'fix(web): mobile edit via inline fullscreen' (#38) from fix/mobile-edit into main
Reviewed-on: #38
2026-05-20 23:17:45 +00:00
lerko 7d1e0f895c fix(web): mobile edit via inline fullscreen instead of hidden detail pane
Detail pane is display:none on mobile, so edit mode was unreachable.
Render edit fields directly in the inline expansion with exp-full
takeover. ESC and Cmd+Enter work from within inputs.

Closes #32
2026-05-20 19:14:02 -04:00
lerko 82bc6e7ba1 Merge pull request 'fix(tui): stream layout density and alignment' (#37) from fix/stream-layout-density into main
Reviewed-on: #37
2026-05-20 22:57:58 +00:00
lerko 533e086ffb fix(tui): esc closes detail split when list is focused
Previously esc in split view with list focus fell through to capture
focus. Now closes the detail pane and stays in stream browse mode.
2026-05-20 18:57:15 -04:00
lerko 989aa86679 fix(tui): compute truncation budget from actual overhead, not magic numbers
Tags wrapped past pane edge when detail split narrowed the list.
Truncation used fixed constants that didn't account for real tag width.
Now measures everything-except-body and gives body exactly what remains.
2026-05-20 18:49:38 -04:00
lerko 3eb778f31b fix(tui): clean up stream row density — drop ID, fix newline leak, align margins
ID cluttered rows and caused wrapping on long entries. Body newlines
leaked into stream rendering extra unindented lines. Cursor glyph
shifted selected rows 1 col right of unselected.

Remove ID from all row renderers (detail pane already shows it),
collapse multiline body to first line, cap tags to 2 in stream,
and reserve cursor column on unselected rows for consistent alignment.
2026-05-20 18:12:18 -04:00
lerko 98fdae1e3a Merge pull request 'feat(tui): stumble mode — resurface stale entries card by card' (#36) from feat/stumble into main
Reviewed-on: #36
2026-05-20 20:57:25 +00:00
lerko a567b2ce73 feat(tui): stumble mode — resurface stale entries card by card
Card-by-card walkthrough of entries untouched for 30+ days.
Prevents write-mostly decay by bringing old entries back to attention.

- S from list triggers stumble, loads entries where modified_at < 30d
- Single-card view with markdown body, glyph, tags, age indicator
- Actions: n skip, d dismiss, ! pin, p promote, m absorb, esc exit
- Progress indicator: stumble [3/12]
- After promote/absorb from stumble, returns to deck (not list)
- "All caught up" screen when deck exhausted
- DB: add ModifiedBefore to ListParams, modified_at sort column
2026-05-20 16:40:40 -04:00
lerko 388ae88d4a Merge pull request 'feat(tui): collapsible tag rail with ambient tag awareness' (#35) from feat/tag-rail into main
Reviewed-on: #35
2026-05-20 19:24:42 +00:00
lerko 60705463c1 fix(tui): simplify focus model — tab toggles capture ↔ list only
Tag rail removed from tab cycle to reduce focus confusion.
Rail is now ambient-by-default, focusable via h from list (spatial).

- Tab: capture ↔ list (no rail, no detail in cycle)
- h from list: focus tag rail (when visible)
- l from rail: back to list
- Split detail reachable via l/enter, not tab
- Remove nextFocusFromCapture helper
2026-05-20 15:08:11 -04:00
lerko b5b7f6b6ee feat(tui): collapsible tag rail with ambient tag awareness
Persistent left panel showing tags with counts. Provides ambient
awareness of tag landscape without requiring a modal.

- New tagRailModel in tagrail.go: tag list with cursor, scroll, counts
- Rail visible at >=100 cols width, 18% width (min 16 chars)
- ctrl+b toggles rail visibility
- focusTagRail added to focus cycle: capture → tags → list → detail
- j/k navigates, enter filters/unfilters by tag
- Active filter tag highlighted bold in rail
- Tags refresh after entity create/delete/absorb
- Rail auto-hides on narrow terminals, # modal still works as fallback
- Width allocation accounts for rail in split and non-split layouts
2026-05-20 14:32:32 -04:00
lerko 3f57531995 Merge pull request 'feat(tui): always-visible capture bar with focus cycling' (#34) from feat/capture-first into main
Reviewed-on: #34
2026-05-20 18:25:55 +00:00
lerko a2dac64d1f feat(tui): always-visible capture bar with focus cycling
Replace drawer-based input with permanent capture bar at bottom.
Focus defaults to capture on startup — open nib, start typing.

- Remove stateInput; route via focusCapture/focusList/focusDetail
- Tab cycles: capture → list → detail (split) → capture
- Esc cascades: clear search → clear filter → focus capture
- Capture bar shows blinking cursor when focused, dims when not
- Intent cycling moved from tab to i (tab now cycles focus)
- Parse preview shown inline in status bar while typing
- Content area constant height (no layout thrash from drawer)
2026-05-20 14:11:46 -04:00
lerko 3daa5a2e11 Merge pull request 'feat(tui): layout and interaction polish' (#33) from fix/tui-polish into main
Reviewed-on: #33
2026-05-20 16:33:58 +00:00
lerko c26e2d2022 feat(tui): status debounce, scroll indicator, drawer label, card grouping
Status messages now use a sequence counter so rapid actions don't
cause premature clearing. Detail pane shows scroll position and
supports pgup/pgdown/g/G. Capture drawer border includes inline
label. Cards view groups by intent (pinned/grab/read/fill) with
gutter labels matching the stream view's date grouping pattern.
2026-05-20 11:49:11 -04:00
lerko cb10d1e93d feat(tui): render entity body as markdown via glamour
Detail pane now pipes entity body through charmbracelet/glamour for
styled markdown output — headers, bold, code blocks, lists. Uses
hardcoded dark style to avoid terminal query freeze in alt screen.
2026-05-20 11:27:40 -04:00
lerko e20fae3543 feat(tui): add broot-style tab affordances to header and footer
Header now renders stream/cards as tabs with keybindings inline —
active tab highlighted, inactive shows the key to switch. Footer
shows a capture tab affordance when in list state. Redundant mode
and capture hints removed from the context hint bar.
2026-05-20 11:16:58 -04:00
lerko 4e0ac8402f fix(tui): pin footer to bottom, style hint bar, auto-clear status
Content area now enforces full height so the context help bar stays
pinned to the terminal bottom. Hint keys rendered with bold highlight
color for scannability. Status messages (created, deleted, etc.)
auto-clear after 2 seconds, reverting to the entity count.
2026-05-20 11:01:13 -04:00
lerko e2d0f3e997 fix(tui): add $VISUAL fallback for editor resolution
Check $EDITOR, then $VISUAL, then fall back to vi.
2026-05-20 10:34:09 -04:00
lerko 618335513b Merge pull request 'feat(tui): add bubbletea terminal UI' (#30) from feat/tui into main
Reviewed-on: #30
2026.05.3
2026-05-20 01:16:57 +00:00
lerko 476abbed00 test(tui): add tier 1 unit tests for pure logic functions
Cover search filtering, intent matching, card affordances, checklist
parsing, template slot discovery/resolve, date grouping, and truncation.
2026-05-19 21:10:51 -04:00
lerko 39975a6787 chore(tui): remove dead formatPreviewEntity function 2026-05-19 21:01:26 -04:00
lerko 778fab3edd docs: add terminal UI to README and development guide 2026-05-19 20:56:29 -04:00
lerko a141b2fd4f Merge pull request 'feat(tui): split-pane detail, compact headers, input drawer' (#31) from feat/tui-layout into feat/tui
Reviewed-on: #31
2026-05-19 23:59:44 +00:00
lerko f89ca8acb9 feat(tui): add split-pane detail, compact date headers, and input drawer
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
2026-05-19 19:55:37 -04:00
lerko e09919b679 fix: harden API, DB schema, and CLI safety
- 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
2026-05-19 18:30:17 -04:00
lerko babf1d6620 fix(tui): harden EDITOR handling and SQL sort/order validation
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.
2026-05-17 23:24:58 -04:00
lerko 77222ff1b8 feat(tui): add interactive run mode for checklists and fill mode for templates
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.
2026-05-17 21:53:55 -04:00
lerko 1066c0bc7d feat(tui): add search via capture bar and absorb flow
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.
2026-05-17 21:35:44 -04:00
lerko ce335cabd6 feat(tui): add cards view, mode switching, promote picker, and card detail
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.
2026-05-17 21:14:14 -04:00
lerko c2ea63dd16 feat(tui): add status bar, help overlay, tag filter, and entity actions
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.
2026-05-17 20:33:34 -04:00
lerko 36999cd825 feat(tui): add bubbletea terminal UI with entity list, detail, and capture
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.
2026-05-17 20:07:45 -04:00
lerko d995d1e708 Merge pull request 'feat(serve): add TLS support' (#29) from fix/copy-clipboard into main
Reviewed-on: #29
2026-05-17 21:51:22 +00:00