Class: ClaudeMemory::Dashboard::Timeline
- Inherits:
-
Object
- Object
- ClaudeMemory::Dashboard::Timeline
- Defined in:
- lib/claude_memory/dashboard/timeline.rb
Overview
Daily activity rollup for the dashboard timeline view. Aggregates three event sources (fact creation, content ingestion, activity events) into per-day buckets covering the last 30 days. Returns the empty shape ([]) when no project store is available so the dashboard can render before the first ingest.
Constant Summary collapse
- LOOKBACK_DAYS =
30
Instance Method Summary collapse
- #days ⇒ Object
-
#initialize(manager) ⇒ Timeline
constructor
A new instance of Timeline.
Constructor Details
#initialize(manager) ⇒ Timeline
Returns a new instance of Timeline.
13 14 15 |
# File 'lib/claude_memory/dashboard/timeline.rb', line 13 def initialize(manager) @manager = manager end |
Instance Method Details
#days ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/claude_memory/dashboard/timeline.rb', line 17 def days store = @manager.default_store(prefer: :project) return {days: []} unless store cutoff = (Time.now - LOOKBACK_DAYS * 86_400).utc.iso8601 {days: build_days(store, cutoff)} end |