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:
+27
-8
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user