feat: aggregate journals across node subtrees

This commit is contained in:
2026-06-05 12:37:25 +08:00
parent 23f517dee3
commit 10b287de7b
14 changed files with 265 additions and 22 deletions
+7 -6
View File
@@ -9,13 +9,14 @@ const (
// SuggestionDetail is a lightweight event summary for suggestion display.
type SuggestionDetail struct {
ID string `json:"id"`
EventType string `json:"eventType"`
ID string `json:"id"`
EventType string `json:"eventType"`
TargetType string `json:"targetType"`
TargetID string `json:"targetId"`
Title string `json:"title"`
CreatedAt string `json:"createdAt"`
NodeID string `json:"nodeId"`
TargetID string `json:"targetId"`
Title string `json:"title"`
CreatedAt string `json:"createdAt"`
NodeID string `json:"nodeId"`
NodePath string `json:"nodePath,omitempty"`
}
// Suggestion represents a suggested worklog entry derived from today's activity.
@@ -0,0 +1,12 @@
package storage
// migration016 — dismissed worklog suggestion events.
const migration016 = `
CREATE TABLE IF NOT EXISTS worklog_dismissed_events (
event_id TEXT PRIMARY KEY REFERENCES activity_events(id),
node_id TEXT NOT NULL REFERENCES nodes(id),
created_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_worklog_dismissed_node ON worklog_dismissed_events(node_id);
`
+1
View File
@@ -72,6 +72,7 @@ var migrationFiles = map[int]string{
13: migration013,
14: migration014,
15: migration015,
16: migration016,
}
func (db *DB) runInitialSchema() error {