Merge branch 'mai/knuth/phase-5a-extract' (fix(mcp): expand empty kinds)
This commit is contained in:
10
mcp/tools.go
10
mcp/tools.go
@@ -249,12 +249,18 @@ func timelineTool(st *store.Store, agg *aggregate.Aggregator) ToolHandler {
|
||||
order = "asc"
|
||||
}
|
||||
kinds := resolveTimelineKinds(args.Kinds)
|
||||
// Effective kinds is what we use for the timeline_exclude filter +
|
||||
// the timelineView.kinds report. Empty input means "all four".
|
||||
effectiveKinds := kinds
|
||||
if len(effectiveKinds) == 0 {
|
||||
effectiveKinds = []string{aggregate.KindTodo, aggregate.KindEvent, aggregate.KindDoc, aggregate.KindCreation}
|
||||
}
|
||||
items, err := resolveTimelineItems(ctx, st, args)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !args.IncludeExcluded {
|
||||
items = filterByTimelineExclude(items, kinds)
|
||||
items = filterByTimelineExclude(items, effectiveKinds)
|
||||
}
|
||||
hasCalDAVRefType := containsString(args.Has, aggregate.RefTypeCalDAV)
|
||||
hasGitRefType := containsString(args.Has, aggregate.RefTypeGiteaRepo)
|
||||
@@ -288,7 +294,7 @@ func timelineTool(st *store.Store, agg *aggregate.Aggregator) ToolHandler {
|
||||
for _, d := range days {
|
||||
totalRows += len(d.Rows)
|
||||
}
|
||||
return buildTimelineView(days, from, to, order, kinds, totalRows, now), nil
|
||||
return buildTimelineView(days, from, to, order, effectiveKinds, totalRows, now), nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user