Skip to content

Conversation

@jezweb
Copy link
Contributor

@jezweb jezweb commented Nov 4, 2025

Summary

Adds a new Timeline visualization tool to BetterChat, allowing AI agents to display chronological events with status indicators.

Features

  • ✨ Vertical timeline with connecting line
  • 🎨 Status indicators: Complete (green), In Progress (blue), Pending (gray)
  • ⏱️ Relative timestamp formatting (e.g., "2 hours ago")
  • 🎯 Optional Lucide icon support for events
  • πŸŒ“ Dark/light theme support with CSS variables
  • πŸ“± Responsive design with Tailwind
  • 🎬 Smooth Framer Motion stagger animations
  • πŸ” JSON view popup for debugging
  • 🧰 Follows existing visualization tool patterns

Use Cases

  • Project milestones and progress tracking
  • Event chronologies and timelines
  • Process steps with status indicators
  • Audit trails and history logs
  • Any time-based sequential data

Screenshots

Dark Mode

Timeline Dark Mode

Light Mode

Timeline Light Mode

Creating Timeline

Creating Timeline

Real-world Example

Rise of AI Timeline

JSON View

JSON View

Implementation Details

Files Created (2)

  • src/lib/ai/tools/visualization/create-timeline.ts - Tool definition with Zod schema
  • src/components/tool-invocation/timeline.tsx - React component with animations

Files Modified (4)

  • src/lib/ai/tools/index.ts - Added CreateTimeline enum
  • src/lib/ai/tools/tool-kit.ts - Registered timeline tool
  • src/components/message-parts.tsx - Added Timeline rendering
  • src/components/default-tool-icon.tsx - Added LayoutList icon

Technical Stack

  • Framework: React + Next.js
  • Animations: Framer Motion (stagger effect with 100ms delay)
  • Styling: Tailwind v4 + shadcn/ui components
  • Validation: Zod schema
  • Icons: Lucide React (LayoutList for menu, custom icons for events)
  • Timestamps: date-fns (relative time formatting)

Testing

  • βœ… TypeScript compilation succeeds
  • βœ… Build succeeds without errors
  • βœ… Dev server runs successfully
  • βœ… Component renders with animations
  • βœ… Dark/light themes work correctly
  • βœ… Status colors are visually distinct
  • βœ… Follows existing codebase patterns

Example Usage

AI agents can now use the timeline tool:

User: "Show me a timeline of the Rise of AI"
AI: [Uses createTimeline tool with events and statuses]

Notes

  • No new dependencies added (all existing libraries)
  • Follows exact same pattern as bar-chart, line-chart, pie-chart
  • Compatible with existing MCP servers and workflows
  • Auto-discovery by AI through tool registration

πŸ€– Generated with Claude Code

Jez and others added 2 commits November 4, 2025 21:48
Implements new Timeline tool for displaying chronological events with status indicators.

Features:
- Vertical timeline with connecting line
- Status indicators: Complete (green), In Progress (blue), Pending (gray)
- Relative timestamp formatting with date-fns
- Optional Lucide icon support
- Framer Motion stagger animations
- Dark/light theme support
- Responsive design

Files Added:
- src/lib/ai/tools/visualization/create-timeline.ts - Tool definition
- src/components/tool-invocation/timeline.tsx - React component
- screenshots/ - Example screenshots

Files Modified:
- src/lib/ai/tools/index.ts - Added CreateTimeline enum
- src/lib/ai/tools/tool-kit.ts - Registered tool
- src/components/message-parts.tsx - Added Timeline rendering

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Added LayoutList icon from Lucide React
- Styled with text-blue-500 to match other visualization tools
- Timeline displays with structured list icon in App Tools menu

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vercel
Copy link

vercel bot commented Nov 4, 2025

Someone is attempting to deploy a commit to the cgoinglove's projects Team on Vercel.

A member of the Team first needs to authorize it.

@jezweb
Copy link
Contributor Author

jezweb commented Nov 4, 2025

If this is not good enough to be part of the repo thats ok I won't be offended. I've made it all with claude code and tried to make sure we checked for patterns and ways things were done to follow. I'd like to be able to contribute if possible with other ideas too thank you for considering this submission.

@chenoka05
Copy link

Personally, I really liked it, thank you, I added it to my site.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants