feat: add title and description fields to capture grammar
Implement | prefix for titles and // separator for descriptions across the full stack: parser, schema, API, CLI, and web frontend. - Parser: line-aware extraction for |title, |title // desc, // leading desc, body // inline desc. URL-safe (skips :// lines). Modifiers (#tag, @time, ^card) extracted from all segments. - Schema: ALTER TABLE migration adds title, description columns - DB: Entity/EntityUpdate structs, all CRUD queries updated - API: title/description on create/update/response, body validation relaxed (title-only entries valid) - CLI: shows title as scan label when present - Web: parseInput mirrors Go parser, list shows title, detail pane renders title + description with double-click inline editing - Tests: 10 new cases (grammar, entity, API) — 71 total, all pass
This commit is contained in:
+12
-6
@@ -32,9 +32,11 @@ func runAdd(_ *cobra.Command, args []string) error {
|
||||
defer store.Close()
|
||||
|
||||
e := &db.Entity{
|
||||
Body: parsed.Body,
|
||||
Glyph: db.Glyph(parsed.Glyph),
|
||||
Tags: parsed.Tags,
|
||||
Body: parsed.Body,
|
||||
Title: parsed.Title,
|
||||
Description: parsed.Description,
|
||||
Glyph: db.Glyph(parsed.Glyph),
|
||||
Tags: parsed.Tags,
|
||||
}
|
||||
if parsed.TimeAnchor != nil {
|
||||
e.TimeAnchor = parsed.TimeAnchor
|
||||
@@ -53,12 +55,16 @@ func runAdd(_ *cobra.Command, args []string) error {
|
||||
|
||||
var parts []string
|
||||
parts = append(parts, glyph)
|
||||
parts = append(parts, " "+e.Body)
|
||||
if e.Title != nil {
|
||||
parts = append(parts, " "+*e.Title)
|
||||
} else {
|
||||
parts = append(parts, " "+e.Body)
|
||||
}
|
||||
if e.TimeAnchor != nil {
|
||||
parts = append(parts, " @"+*e.TimeAnchor)
|
||||
parts = append(parts, " @"+*e.TimeAnchor)
|
||||
}
|
||||
for _, tag := range e.Tags {
|
||||
parts = append(parts, " #"+tag)
|
||||
parts = append(parts, " #"+tag)
|
||||
}
|
||||
parts = append(parts, " ["+shortID+"]")
|
||||
if e.CardType != nil {
|
||||
|
||||
Reference in New Issue
Block a user