Implement comprehensive budget monitoring and forecasting feature with:
Database & Models:
- Add BudgetAlert model for tracking project budget alerts
- Create migration 039_add_budget_alerts_table with proper indexes
- Support alert types: 80_percent, 100_percent, over_budget
- Add acknowledgment tracking with user and timestamp
Budget Forecasting Utilities:
- Implement burn rate calculation (daily/weekly/monthly)
- Add completion date estimation based on burn rate
- Create resource allocation analysis per team member
- Build cost trend analysis with configurable granularity
- Add automatic budget alert detection with deduplication
Routes & API:
- Create budget_alerts blueprint with dashboard and detail views
- Add API endpoints for burn rate, completion estimates, and trends
- Implement resource allocation and cost trend API endpoints
- Add alert acknowledgment and manual budget check endpoints
- Fix log_event() calls to use keyword arguments
UI Templates:
- Design modern budget dashboard with Tailwind CSS
- Create detailed project budget analysis page with charts
- Add gradient stat cards with color-coded status indicators
- Implement responsive layouts with full dark mode support
- Add smooth animations and toast notifications
- Integrate Chart.js for cost trend visualization
Project Integration:
- Add Budget Alerts link to Finance navigation menu
- Enhance project view page with budget overview card
- Show budget progress bars with status indicators
- Add Budget Analysis button to project header and dashboard
- Display real-time budget status with color-coded badges
Visual Enhancements:
- Use gradient backgrounds for stat cards (blue/green/yellow/red)
- Add status badges with icons (healthy/warning/critical/over)
- Implement smooth progress bars with embedded percentages
- Support responsive grid layouts for all screen sizes
- Ensure proper type conversion (Decimal to float) in templates
Scheduled Tasks:
- Register budget alert checking job (runs every 6 hours)
- Integrate with existing APScheduler tasks
- Add logging for alert creation and monitoring
This feature provides project managers with real-time budget insights,
predictive analytics, and proactive alerts to prevent budget overruns.
Implement a feature-rich project dashboard that provides visual analytics
and key performance indicators for project tracking and management.
Features:
- Individual project dashboard route (/projects/<id>/dashboard)
- Key metrics cards: Total Hours, Budget Used, Tasks Complete, Team Size
- Budget vs. Actual bar chart with threshold warnings
- Task status distribution doughnut chart
- Team member contributions horizontal bar chart (top 10)
- Time tracking timeline line chart
- Team member details with progress bars
- Recent activity feed (last 10 activities)
- Period filtering (All Time, 7/30/90/365 Days)
- Responsive design with dark mode support
- Navigation button added to project view page
Technical Implementation:
- New route: project_dashboard() in app/routes/projects.py
- Template: app/templates/projects/dashboard.html with Chart.js 4.4.0
- Data aggregation for budget, tasks, team contributions, and timeline
- Optimized database queries with proper filtering
- JavaScript escaping handled with |tojson filters and autoescape control
Testing:
- 20 comprehensive unit tests (test_project_dashboard.py)
- 23 smoke tests (smoke_test_project_dashboard.py)
- Full test coverage for all dashboard functionality
Documentation:
- Complete feature guide (docs/features/PROJECT_DASHBOARD.md)
- Implementation summary (PROJECT_DASHBOARD_IMPLEMENTATION_SUMMARY.md)
- Usage examples and troubleshooting guide
Fixes:
- JavaScript syntax errors from HTML entity escaping
- Proper use of |tojson filter for dynamic values in JavaScript
- Autoescape disabled for script blocks to prevent operator mangling
This dashboard provides project managers and team members with valuable
insights into project health, progress, budget utilization, and resource
allocation at a glance.
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
Complete the Time Entry Templates feature by adding timer integration
and dashboard UI (70% → 100% complete).
Features Added:
- One-click start timer from template via new route
- Template selector in dashboard "Start Timer" modal
- Template pre-fill for manual time entries
- Auto-populate timer forms with template data
- Usage tracking when templates are used
Backend Changes:
- Added template support to /timer/start route
- Added template pre-fill to /timer/manual route
- New route: /timer/start/from-template/<id> for direct timer start
- Load recent templates (top 5) on dashboard
- All changes include proper validation and error handling
Frontend Changes:
- Template list in dashboard start timer modal
- JavaScript function to apply template data to forms
- Template cards show project/task information
- Link to full template management page
- Responsive design for mobile
Testing:
- Added 6 new integration tests for timer features
- Test start timer from template (success and error cases)
- Test manual entry pre-fill from template
- Test active timer validation
- All 32 tests passing with no linting errors
Documentation:
- Complete user guide (docs/TIME_ENTRY_TEMPLATES.md)
- Technical documentation (docs/features/TIME_ENTRY_TEMPLATES.md)
- Implementation summary with usage examples
Use Case: Quickly start timers for recurring activities
- 80% faster timer start for recurring tasks
- Zero retyping of project, task, notes, tags
- Consistent data across similar time entries
- Fix invoice export AttributeError: use `invoice.creator` instead of `invoice.created_by_user`
- Add comprehensive Excel export functionality for payment list
- New utility function `create_payments_list_excel()` with formatted output
- New endpoint `/payments/export/excel` with filter support
- Export includes payment details, gateway fees, and summary statistics
- Respects user permissions (admin/regular user access control)
- Add "Export to Excel" button to payments list page with filter preservation
- Add "Export to Excel" button to invoices list page
- Verify Reports and Project Reports already have working Excel export
Excel export now available for:
- Time entries and reports (/reports/export/excel)
- Project reports (/reports/project/export/excel)
- Invoice list (/invoices/export/excel) - FIXED
- Payment list (/payments/export/excel) - NEW
All exports include:
- Professional formatting with borders and styling
- Proper number formatting for currency fields
- Summary sections with totals and statistics
- Auto-adjusted column widths
- Analytics tracking
Closes feature request for Excel export buttons across UI
- Fix keyboard shortcuts (like 'g r' for Go to Reports) incorrectly triggering
while typing in input fields, textareas, and rich text editors
- Enhance detection for popular rich text editors:
* Toast UI Editor (used in project descriptions)
* TinyMCE, Quill, CodeMirror, Summernote
* All contenteditable elements
- Allow specific global shortcuts even in input fields:
* Ctrl+K / Cmd+K: Open command palette
* Shift+?: Show keyboard shortcuts help
* Ctrl+/: Focus search
- Clear key sequences when user starts typing to prevent partial matches
- Add debug logging for troubleshooting keyboard shortcut issues
- Update JavaScript cache busting version numbers (v=2.0, v=2.2)
Test improvements:
- Add comprehensive test suite for keyboard shortcuts input fix
* Test typing 'gr' in 'program' doesn't trigger navigation
* Test rich text editor detection logic
* Test allowed shortcuts in inputs
- Refactor smoke tests to use admin_authenticated_client fixture
instead of manual login (DRY principle)
- Fix Windows PermissionError in test cleanup for temporary files
- Add SESSION_COOKIE_HTTPONLY to test config for security
- Update test secret key length to meet requirements
- Remove duplicate admin user fixtures
Resolves issue where typing words like 'program' or 'graphics' in forms
would trigger unintended navigation shortcuts.
Major Features:
- Invoice Expenses: Allow linking billable expenses to invoices with automatic total calculations
- Add expenses to invoices via "Generate from Time/Costs" workflow
- Display expenses in invoice view, edit forms, and PDF exports
- Track expense states (approved, invoiced, reimbursed) with automatic unlinking on invoice deletion
- Update PDF generator and CSV exports to include expense line items
- Enhanced PDF Invoice Editor: Complete redesign using Konva.js for visual drag-and-drop layout design
- Add 40+ draggable elements (company info, invoice data, shapes, text, advanced elements)
- Implement comprehensive properties panel for precise element customization (position, fonts, colors, opacity)
- Add canvas toolbar with alignment tools, zoom controls, and layer management
- Support keyboard shortcuts (copy/paste, duplicate, arrow key positioning)
- Save designs as JSON for editing and generate clean HTML/CSS for rendering
- Add real-time preview with live data
- Uploads Persistence: Implement Docker volume persistence for user-uploaded files
- Add app_uploads volume to all Docker Compose configurations
- Ensure company logos and avatars persist across container rebuilds and restarts
- Create migration script for existing installations
- Update directory structure with proper permissions (755 for dirs, 644 for files)
Database & Backend:
- Add invoice_pdf_design_json column to settings table via Alembic migration
- Extend Invoice model with expenses relationship
- Update admin routes for PDF layout designer endpoints
- Enhance invoice routes to handle expense linking/unlinking
Frontend & UI:
- Redesign PDF layout editor template with Konva.js canvas (2484 lines, major overhaul)
- Update invoice edit/view templates to display and manage expenses
- Add expense sections to invoice forms with unlink functionality
- Enhance UI components with keyboard shortcuts support
- Update multiple templates for consistency and accessibility
Testing & Documentation:
- Add comprehensive test suites for invoice expenses, PDF layouts, and uploads persistence
- Create detailed documentation for all new features (5 new docs)
- Include migration guides and troubleshooting sections
Infrastructure:
- Update docker-compose files (main, example, remote, remote-dev, local-test) with uploads volume
- Configure pytest for new test modules
- Add template filters for currency formatting and expense display
This update significantly enhances TimeTracker's invoice management capabilities,
improves the PDF customization experience, and ensures uploaded files persist
reliably across deployments.
Implemented complete invoice deletion feature allowing users to delete
incorrectly generated invoices from both the view and list pages.
Changes:
- Added delete button to invoice view page with modal confirmation
- Added delete buttons to invoice list page with modal confirmation
- Implemented custom Tailwind modal matching project design patterns
- Modal displays invoice number and cascade deletion warning
- Full dark mode support with proper accessibility (ARIA attributes)
- Modal can be closed via Cancel button, clicking outside, or ESC key
Technical details:
- Backend route already existed (/invoices/<id>/delete)
- Cascade deletion automatically removes related items, goods, and payments
- Permission checks: only invoice creator or admins can delete
- Delete route returns to invoice list with success/error messages
Testing:
- Added 12 comprehensive tests covering deletion functionality
- Unit tests for basic deletion and cascade behavior
- Route tests for permissions and success/error cases
- Smoke tests for UI elements and complex deletion scenarios
- All tests passing ✅
The modal implementation follows the established pattern used in
kanban/columns.html, ensuring consistency across the application.
Fixed a critical bug where changes to project descriptions were not
being persisted when editing projects via Work > Projects > Edit Project.
The issue was caused by an incorrect CSS selector pattern in the form
submit handler that syncs the markdown editor content. The selector
`form[action*="projects/edit"]` failed to match URLs like
`/projects/123/edit` because the project ID breaks the substring match.
Changes:
- Updated form selector to use more generic pattern: `form[action*="/edit"]`
- Added explicit null checking with `if (form)` guard
- Enhanced error logging with console.error for debugging
- Improved code formatting and structure
Testing:
- Added integration test: test_edit_project_description
- Added smoke test: test_project_edit_page_has_markdown_editor
- All 166 project-related tests pass successfully
- No regressions introduced
- Changed layout from h-screen to min-h-screen to fix dual scrollbar
- Converted sidebar to fixed positioning with independent scrolling
- Added left margin (lg:ml-64) to main content to offset fixed sidebar
- Implemented accordion behavior for sidebar menu dropdowns
* Only one dropdown (Work/Finance/Admin) can be open at a time
* Added smooth chevron rotation (180°/0°) for visual feedback
- Updated sidebar collapse logic to adjust main content margin dynamically
* Collapsed: lg:ml-16 (64px)
* Expanded: lg:ml-64 (256px)
- Simplified mobile sidebar toggle logic for fixed positioning
- Maintained sidebar background visibility across full height
Fixes:
- Eliminates secondary scrollbar in main content area
- Ensures sidebar background extends to viewport bottom
- Provides cleaner, more intuitive navigation with accordion menus
- Maintains proper content width on all screen sizes
Removed duplicate Bootstrap modal that was causing delete column content to appear on other pages. The Tailwind modal is now properly positioned outside the main content container.
Replace className assignment with classList methods for more reliable
icon state changes when collapsing/expanding filters. Affects both
task list and my tasks pages.
- Add sorted_payments property to Invoice model using proper SQLAlchemy column references
- Update invoice view template to use new property instead of string-based ordering
- Add comprehensive tests for sorted_payments functionality
Resolves error: "Can't resolve label reference for ORDER BY" when accessing invoice.payments.order_by() from Jinja2 templates
Remove old /invoices/<id>/payment route and update templates to use the
Payment model system (payments.create_payment). Add deprecation warning
to Invoice.record_payment() method for backward compatibility.
Benefits: Multiple payments per invoice, status tracking, gateway support,
better audit trails, and full CRUD operations.
All tests pass. Backward compatible with 6-month deprecation period.
- Add delete button to user list with confirmation dialog
- Prevent deletion of last admin and users with time entries
- Include CSRF protection on delete forms
- Add 41 comprehensive tests (unit, model, smoke)
- Document feature with usage guide and best practices
All safety checks implemented and tested.
- Separated logo upload form from main settings form (fixes nested forms)
- Excluded /uploads/ from ServiceWorker cache (fixes logo not showing)
- Added cache busting to logo URLs
- Enhanced UI with prominent logo display and preview
- Added error handling and logging
- Created cache clearing utility at /admin/clear-cache
- Added 18 comprehensive tests
- Created troubleshooting documentation
Fixes: Logo not visible after upload, settings form not saving
The version displayed in the sidebar was showing "vv3.5.0" instead of
"v3.5.0" because the APP_VERSION environment variable (often from Git
tags like "v3.5.0") already contained a "v" prefix, and the template
was adding another one.
Modified app/utils/context_processors.py to strip any leading 'v'
prefix from the version value before passing it to templates. This
ensures the template's "v{{ app_version }}" always displays correctly.
Fixes the sidebar version display issue in base.html line 269.
- Add documentation for 18+ features including bulk time entry, time entry
templates, calendar view, Kanban board, task comments, expense tracking,
payment tracking, saved filters, command palette, keyboard shortcuts,
email notifications, OIDC/SSO authentication, role-based permissions,
API tokens, and monitoring stack
- Reorganize Quick Start section with three clear installation options:
Docker with HTTPS (production), Docker with HTTP (dev), and SQLite quick test
- Enhance deployment section with comprehensive guidance for production,
Raspberry Pi, HTTPS configuration, and monitoring deployment
- Add new help page sections for Kanban board, expense tracking, and
productivity features (command palette, keyboard shortcuts)
- Expand admin features documentation with OIDC/SSO integration,
role & permission management, and API token generation
- Add 6 new FAQ items covering command palette, bulk entry, templates,
expenses, and Markdown support
- Update "Recently Added" section to showcase 13 major implemented features
- Verify all file references in installation instructions
All documentation now accurately reflects the current feature set and
provides clear, step-by-step instructions for users and administrators.
## Payment Analytics Integration
- Add 5 new API endpoints for payment metrics:
- /api/analytics/payments-over-time - trend visualization
- /api/analytics/payments-by-status - status distribution
- /api/analytics/payments-by-method - method breakdown
- /api/analytics/payment-summary - statistics with period comparison
- /api/analytics/revenue-vs-payments - collection rate tracking
- Integrate payment data into analytics dashboard with 4 new charts
- Add payment metrics to reports page (total, count, fees, net received)
- Update summary endpoint to include payment statistics
## UI/UX Improvements
- Standardize form styling across all payment templates
- Replace inconsistent Tailwind classes with form-input utility
- Update card backgrounds to use card-light/card-dark
- Fix label spacing to match application patterns
- Ensure consistent border colors and backgrounds
- Replace browser confirm() with system-wide modal for payment deletion
- Consistent danger variant with warning icon
- Keyboard support (Enter/Escape)
- Dark mode compatible
- Clear messaging about impact on invoice status
## Technical Changes
- Import Payment and Invoice models in analytics and reports routes
- Add proper admin/user scoping for payment queries
- Maintain responsive design across all new components
Closes payment tracking phase 2 (analytics & polish)
Replaced browser's native confirm() dialog with the project's custom
confirm_dialog macro for consistency with the rest of the application.
Changes:
- Imported confirm_dialog macro from components/ui.html in event_detail.html
- Updated delete button to trigger custom modal instead of native confirm
- Modified delete_event route to accept both POST and DELETE methods
- Added flash messages and redirect logic for POST-based deletion
- Replaced JavaScript fetch-based deletion with form submission pattern
- Used hidden form with CSRF token for secure deletion (consistent with
tasks and time entries deletion pattern)
The custom dialog provides:
- Consistent UI/UX matching the project's dark theme
- Better accessibility
- Proper styling with danger-colored confirmation button
- Standard project pattern for destructive actions
Fixes: Event deletion showing browser's native unstyled confirmation dialog
Related: Calendar feature implementation
Refactored the existing calendar API endpoint to properly display calendar
events, tasks, and time entries with distinct visual representations.
Changes:
- Updated /api/calendar/events endpoint in api.py to use new
CalendarEvent.get_events_in_range() method that fetches all three item types
- Fixed user_id bug where it was defaulting to None instead of current_user.id
- Modified API response format to include all items in unified 'events' array
with item_type field ('event', 'task', 'time_entry') for differentiation
- Updated calendar.js to parse unified response format and filter items by type
- Added visual distinctions:
* Tasks: 📋 emoji, orange (#f59e0b) color, clickable
* Time entries: ⏱ emoji, project-based colors, non-clickable
* Calendar events: 📅 emoji, custom colors, clickable
- Fixed task detail route from /tasks/view/{id} to /tasks/{id}
- Updated all calendar view renderers (month, week, day) to use correct
data structure with extendedProps
- Added cache-busting to calendar.js (v7) and calendar.css (v2)
- Preserved backward compatibility with existing calendar filtering
(project_id, task_id, tags)
The calendar now correctly displays all time tracking data in a unified view
with proper visual hierarchy and interaction patterns.
Fixes: Calendar not showing tasks and time entries
Related: Calendar/Agenda Support feature implementation
Enhance the email support feature with better UX and debugging capabilities:
- **Fix input field styling**: Update all form inputs to use project-standard
'form-input' class and consistent checkbox styling matching other admin
pages for uniform appearance across the application
- **Add comprehensive logging**: Implement detailed logging throughout email
operations with clear prefixes ([EMAIL TEST], [EMAIL CONFIG]) to track:
- Email configuration changes and validation
- Test email sending process step-by-step
- SMTP connection details and status
- Success/failure indicators (✓/✗) for quick troubleshooting
- **Auto-reload after save**: Page now automatically refreshes 1.5 seconds
after successfully saving email configuration to ensure UI reflects the
latest settings and eliminate stale data
These improvements provide better visual consistency, easier debugging of
email issues, and smoother user experience when configuring email settings.
Files modified:
- app/templates/admin/email_support.html
- app/utils/email.py
- app/routes/admin.py
Major improvements to the backup restore system with a complete UI overhaul
and enhanced functionality:
UI/UX Improvements:
- Complete redesign of restore page with modern Tailwind CSS
- Added prominent warning banners and danger badges to prevent accidental data loss
- Implemented drag-and-drop file upload with visual feedback
- Added real-time progress tracking with auto-refresh every 2 seconds
- Added comprehensive safety information sidebar with checklists
- Full dark mode support throughout restore interface
- Enhanced confirmation flows with checkbox and modal confirmations
Functionality Enhancements:
- Added dual restore methods: upload new backup or restore from existing server backups
- Enhanced restore route to accept optional filename parameter for existing backups
- Added "Restore" button to each backup in the backups management page
- Implemented restore confirmation modal with critical warnings
- Added loading states and button disabling during restore operations
- Improved error handling and user feedback
Backend Changes:
- Enhanced admin.restore() to support both file upload and existing backup restore
- Added dual route support: /admin/restore and /admin/restore/<filename>
- Added shutil import for file copy operations during restore
- Improved security with secure_filename validation and file type checking
- Maintained existing rate limiting (3 requests per minute)
Frontend Improvements:
- Added interactive JavaScript for file selection, drag-and-drop, and modal management
- Implemented auto-refresh during restore process to show live progress
- Added escape key support for closing modals
- Enhanced user feedback with file name display and button states
Safety Features:
- Pre-restore checklist with 5 verification steps
- Multiple warning levels throughout the flow
- Confirmation checkbox required before upload restore
- Modal confirmation required before existing backup restore
- Clear documentation of what gets restored and post-restore steps
Dependencies:
- Updated flask-swagger-ui from 4.11.1 to 5.21.0
Files modified:
- app/templates/admin/restore.html (complete rewrite)
- app/templates/admin/backups.html (added restore functionality)
- app/routes/admin.py (enhanced restore route)
- requirements.txt (updated flask-swagger-ui version)
- RESTORE_BACKUP_IMPROVEMENTS.md (documentation)
This provides a significantly improved user experience for the restore process
while maintaining security and adding powerful new restore capabilities.
Implement comprehensive overtime tracking feature that allows users to
set their standard working hours per day and automatically calculates
overtime for hours worked beyond that threshold.
Core Features:
- Add standard_hours_per_day field to User model (default: 8.0 hours)
- Create Alembic migration (031_add_standard_hours_per_day.py)
- Implement overtime calculation utilities (app/utils/overtime.py)
* calculate_daily_overtime: per-day overtime calculation
* calculate_period_overtime: multi-day overtime aggregation
* get_daily_breakdown: detailed day-by-day analysis
* get_weekly_overtime_summary: weekly overtime statistics
* get_overtime_statistics: comprehensive overtime metrics
User Interface:
- Add "Overtime Settings" section to user settings page
- Display overtime data in user reports (regular vs overtime hours)
- Show "Days with Overtime" badge in reports
- Add overtime analytics API endpoint (/api/analytics/overtime)
- Improve input field styling with cleaner appearance (no spinners)
Reports Enhancement:
- Standardize form input styling across all report pages
- Replace inline Tailwind classes with consistent form-input class
- Add FontAwesome icons to form labels for better UX
- Improve button hover states and transitions
Testing:
- Add comprehensive unit tests (tests/test_overtime.py)
- Add smoke tests for quick validation (tests/test_overtime_smoke.py)
- Test coverage for models, utilities, and various overtime scenarios
Documentation:
- OVERTIME_FEATURE_DOCUMENTATION.md: complete feature guide
- OVERTIME_IMPLEMENTATION_SUMMARY.md: technical implementation details
- docs/features/OVERTIME_TRACKING.md: quick start guide
This change enables organizations to track employee overtime accurately
based on individual working hour configurations, providing better
insights into work patterns and resource allocation.