mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
Enhance timeline editor left sidebar with collapsible content summary
- Add comprehensive linked content summary section with collapsible content type groups - Replace basic Timeline Stats with detailed content breakdown showing counts and items - Remove Import Events button to streamline Quick Actions - Implement Alpine.js methods for managing collapsible sections - Show up to 10 items per content type with "X more" indicators - Add Timeline Stats section below content summary with event count, word count, and total linked pages - Links open in new tabs for easy navigation - Maintain clean, organized left sidebar layout with consistent styling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
523d90a232
commit
f2bfcbc7d2
@ -79,6 +79,7 @@ class TimelinesController < ApplicationController
|
||||
|
||||
# Get content already linked to other events in this timeline
|
||||
@timeline_linked_content = {}
|
||||
@timeline_content_summary = {}
|
||||
timeline_entity_ids = @timeline.timeline_events
|
||||
.joins(:timeline_event_entities)
|
||||
.pluck('timeline_event_entities.entity_type', 'timeline_event_entities.entity_id')
|
||||
@ -89,9 +90,22 @@ class TimelinesController < ApplicationController
|
||||
content_class = content_class_from_name(entity_type)
|
||||
next unless content_class
|
||||
|
||||
# Original data for link modal
|
||||
@timeline_linked_content[entity_type] = content_class.where(id: entity_ids)
|
||||
.where(user: current_user)
|
||||
.limit(20)
|
||||
|
||||
# Enhanced data for content summary sidebar
|
||||
all_content = content_class.where(id: entity_ids)
|
||||
.where(user: current_user)
|
||||
.order(:name)
|
||||
|
||||
@timeline_content_summary[entity_type] = {
|
||||
count: all_content.count,
|
||||
items: all_content.limit(10), # Show first 10, with expansion option
|
||||
total_items: all_content.count,
|
||||
content_class: content_class
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user