mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-01-05 03:01:13 -06:00
Add comprehensive Activity Feed Widget to dashboard providing team visibility and audit trail functionality. The widget displays recent user activities with advanced filtering, pagination, and auto-refresh capabilities. Features: - Dashboard widget showing last 10 activities with infinite scroll - Filter by entity type (projects, tasks, time entries, templates, users, etc.) - Real-time auto-refresh every 30 seconds - Visual indicators for active filters (checkmark + dot) - Load more pagination with "has_next" detection - Refresh button with spinning animation feedback API Endpoints: - GET /api/activities - Retrieve activities with filtering & pagination - GET /api/activities/stats - Activity statistics and analytics - Support for user_id, entity_type, action, and date range filters Activity Logging Integration: - Projects: create, update, delete, archive, unarchive - Tasks: create, update, delete - Time Entries: start timer, stop timer - All operations log user, IP address, and user agent for security UI/UX Improvements: - Vanilla JS implementation (removed Alpine.js dependency) - Dark mode support with proper color schemes - Responsive dropdown with scrollable content - Action-specific icons (Font Awesome) - Relative timestamps with timeago filter - Error handling with user-friendly messages Testing & Documentation: - Comprehensive test suite (model, API, integration, widget) - Feature documentation in docs/features/activity_feed.md - Implementation summary and integration guide - Console logging for debugging Bug Fixes: - Fixed "Load More" button not appending results - Fixed refresh clearing list without reloading - Fixed filter dropdown using Alpine.js (now vanilla JS) - Fixed entity_type filter sending 'all' to API - Added missing entity types (time_entry_template, user) Technical Details: - Activity model with optimized indexes for performance - Promise-based async loading with proper error handling - Credentials included in fetch for authentication - Filter state management with visual feedback - Graceful degradation on API failures Impact: - Team visibility into real-time activities - Comprehensive audit trail for compliance - Better accountability and transparency - Improved troubleshooting capabilities