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.
This commit is contained in:
2026-05-21 12:12:07 -04:00
parent 29bd7d3dc6
commit e22e040688
8 changed files with 485 additions and 38 deletions
+27 -8
View File
@@ -11,10 +11,13 @@ import (
)
type inputResult struct {
entity *db.Entity
query bool
body string
tags []string
entity *db.Entity
query bool
body string
tags []string
dateFrom *string
dateTo *string
cardType *db.CardType
}
type inputModel struct {
@@ -47,11 +50,18 @@ func (i inputModel) submit() *inputResult {
}
if parsed.Query {
return &inputResult{
query: true,
body: parsed.Body,
tags: parsed.FilterTags,
r := &inputResult{
query: true,
body: parsed.Body,
tags: parsed.FilterTags,
dateFrom: parsed.QueryDateFrom,
dateTo: parsed.QueryDateTo,
}
if parsed.QueryCardType != nil {
ct := db.CardType(*parsed.QueryCardType)
r.cardType = &ct
}
return r
}
e := &db.Entity{
@@ -120,6 +130,15 @@ func (i inputModel) previewText() string {
for _, t := range p.FilterTags {
q += " #" + t
}
if p.QueryDateFrom != nil {
q += " from:" + *p.QueryDateFrom
}
if p.QueryDateTo != nil {
q += " to:" + *p.QueryDateTo
}
if p.QueryCardType != nil {
q += " ^" + *p.QueryCardType
}
return "search: " + q
}