# Changelog - Claude Code This file documents all changes made to this project via Claude Code. ## [2026-02-19] ### Added - Explicit `Include Autotask IDs` import option in the Approved Jobs JSON import form (Settings -> Maintenance) - Explicit `Include Autotask IDs` import option in the Customers CSV import form ### Changed - Approved Jobs import now only applies `autotask_company_id` and `autotask_company_name` when the import option is checked - Customers CSV import now only applies Autotask mapping fields when the import option is checked - Import success and audit output now includes whether Autotask IDs were imported - 3CX parser now recognizes `3CX Notification: Update Successful - ` as an informational run with `backup_software: 3CX`, `backup_type: Update`, and `overall_status: Success`, and excludes this type from schedule inference (no Expected/Missed generation) - Run Checks now hides only non-backup 3CX informational types (`Update`, `SSL Certificate`), while other backup software/types remain visible ## [2026-02-16] ### Added - Customer-to-jobs navigation by making customer names clickable on the Customers page (`/jobs?customer_id=`) - Jobs page customer filter context UI with an active filter banner and a "Clear filter" action - Global search page (`/search`) with grouped results for Inbox, Customers, Jobs, Daily Jobs, Run Checks, Tickets, Existing overrides, and Reports - Navbar search form to trigger global search from all authenticated pages - Dedicated Remarks section in global search results (with paging and detail links), so remark records are searchable alongside tickets ### Changed - `/jobs` route now accepts optional `customer_id` and returns only jobs for that customer when provided - Default Jobs listing keeps inactive-customer filtering only when no `customer_id` filter is applied - Updated `docs/technical-notes-codex.md` with a new "Last updated" date, Customers->Jobs navigation notes, and test build/push validation snapshot - Search matching is now case-insensitive with wildcard support (`*`) and automatic contains behavior (`*term*`) per search term - Global search visibility now only includes sections accessible to the currently active role - Updated `docs/technical-notes-codex.md` with a dedicated Global Grouped Search section (route/UI/behavior/access rules) and latest test build digest for `v20260216-02-global-search` - Global search now supports per-section pagination (previous/next), so results beyond the first 10 can be browsed per section while preserving current query/state - Daily Jobs search result metadata now includes expected run time, success indicator, and run count for the selected day - Daily Jobs search result links now open the same Daily Jobs modal flow via `open_job_id` (instead of only navigating to the overview page) - Updated `docs/technical-notes-codex.md` with search pagination query params, Daily Jobs modal-open search behavior, and latest successful test-build digest - Search pagination buttons now preserve scroll position by linking back to the active section anchor after page navigation - "Open
" behavior now passes `q` into destination pages and applies page-level filtering, so opened overviews reflect the same search term - Filtering support on Inbox, Customers, Jobs, Daily Jobs, Run Checks, Tickets, Overrides, and Reports now accepts wildcard-enabled `q` terms from search - Reports frontend loading (`/api/reports`) now forwards URL `q` so client-side refresh keeps the same filtered result set - Daily Jobs search section UI now shows an explicit English note that the Daily Jobs page itself is day-scoped while search matches can reflect jobs across other days - Updated `docs/technical-notes-codex.md` to include remarks in grouped search sections, `p_remarks` pagination key, q-forwarding to overview pages, and latest test-build digest ### Fixed - `/search` page crash (`TypeError: 'builtin_function_or_method' object is not iterable`) by replacing Jinja dict access from `section.items` to `section['items']` in `templates/main/search.html` ## [2026-02-13] ### Added - Added internal technical reference document `docs/technical-notes-codex.md` with repository structure, application architecture, processing flow, parser system rules, ticketing/Autotask constraints, feedback attachment notes, deployment/build workflow, and operational attention points ### Changed - Changed `docs/technical-notes-codex.md` language from Dutch to English to align with project language rules for documentation ### Fixed - Fixed Autotask tickets and internal tickets not being linked to missed runs by calling `link_open_internal_tickets_to_run` after creating missed JobRun records in `_ensure_missed_runs_for_job` (both weekly and monthly schedules), ensuring missed runs now receive the same ticket propagation as email-based runs - Fixed checkboxes being automatically re-selected after delete actions on Inbox and Run Checks pages by adding `autocomplete="off"` attribute to all checkboxes, preventing browser from restoring previous checkbox states after page reload ## [2026-02-12] ### Fixed - Fixed tickets not being displayed in Run Checks modal detail view (Meldingen section) by extending `/api/job-runs//alerts` endpoint to include both run-specific tickets (via ticket_job_runs) and job-level tickets (via ticket_scopes), ensuring newly created tickets are visible immediately in the modal instead of only after being resolved - Fixed copy ticket button not working in Edge browser on Job Details page by moving clipboard functions (copyToClipboard, fallbackCopy, showCopyFeedback) inside IIFE scope for proper closure access (Edge is stricter than Firefox about scope resolution) ## [2026-02-10] ### Added - Added screenshot attachment support to Feedback/Bug system (user request: allow screenshots for bugs/features) - New database model: `FeedbackAttachment` with file_data (BYTEA), filename, mime_type, file_size - Upload support on feedback creation form (multiple files, PNG/JPG/GIF/WEBP, max 5MB each) - Upload support on reply forms (attach screenshots when replying) - Inline image display on feedback detail page (thumbnails with click-to-view-full-size) - Screenshot display for both main feedback items and replies - File validation: image type verification using imghdr (not just extension), size limits, secure filename handling - New route: `/feedback/attachment/` to serve images (access-controlled, admins can view deleted item attachments) - Database migration: auto-creates `feedback_attachments` table with indexes on startup - Automatic CASCADE delete: removing feedback item or reply automatically removes associated attachments - Added admin-only deleted items view and permanent delete functionality to Feedback system - "Show deleted items" checkbox on feedback list page (admin only) - Deleted items shown with reduced opacity + background color and "Deleted" badge - Permanent delete action removes item + all attachments from database (hard delete with CASCADE) - Attachment count shown in deletion confirmation message - Admins can view detail pages of deleted items including their screenshots - Two-stage delete: soft delete (audit trail) → permanent delete (database cleanup) - Prevents accidental permanent deletion (requires item to be soft-deleted first) - Security: non-admin users cannot view deleted items or their attachments (404 response) - Added copy ticket button (⧉) to Job Details page modal for quickly copying ticket numbers to clipboard (previously only available on Run Checks page) ### Fixed - Fixed cross-browser clipboard copy functionality for ticket numbers (previously required manual copy popup in Edge browser) - Implemented three-tier fallback mechanism: modern Clipboard API → legacy execCommand('copy') → prompt fallback - Copy button now works directly in all browsers (Firefox, Edge, Chrome) without requiring user interaction - Applied improved copy mechanism to both Run Checks and Job Details pages - Fixed Autotask ticket not being automatically linked to new runs when internal ticket is resolved by implementing independent Autotask propagation strategy (now checks for most recent non-deleted and non-resolved Autotask ticket on job regardless of internal ticket status, ensuring PSA ticket reference persists across runs until explicitly resolved or deleted) - Fixed internal and Autotask tickets being linked to new runs even after being resolved by removing date-based "open" logic from ticket query (tickets now only link to new runs if they are genuinely unresolved, not based on run date comparisons) - Fixed Job Details page showing resolved tickets for ALL runs by implementing two-source ticket display: directly linked tickets (via ticket_job_runs) are always shown for audit trail, while active window tickets (via scope query) are only shown if unresolved, preserving historical ticket links while preventing resolved tickets from appearing on new runs - Fixed Run Checks page showing resolved ticket indicators by removing date-based logic from ticket/remark existence queries (tickets and remarks now only show indicators if genuinely unresolved) - Fixed Run Checks popup showing resolved tickets for runs where they were never linked by replacing date-based ticket/remark queries in `/api/job-runs//alerts` endpoint with explicit link-based queries (now only shows tickets/remarks that were actually linked to the specific run via ticket_job_runs/remark_job_runs tables, completing the transition from date-based to explicit-link ticket system) - **HOTFIX**: Fixed Run Checks popup showing duplicate tickets (same ticket repeated multiple times) by removing unnecessary JOIN with ticket_scopes/remark_scopes tables and adding DISTINCT to prevent duplicate rows (root cause: tickets with multiple scopes created multiple result rows for same ticket via Cartesian product) ### Changed - Added debug logging to ticket linking function to troubleshoot resolved ticket propagation issues (writes to AuditLog table with event_type "ticket_link_debug", visible on Logging page, logs EVERY run import to show whether tickets were found and their resolved_at status, uses commit instead of flush to ensure persistence) - **LATER REMOVED** after ticket system was fixed - Reduced test email generation from 3 emails per status to 1 email per status for simpler testing (each button now creates exactly 1 test mail instead of 3) - Updated Settings Maintenance page text to reflect that test emails are Veeam only and 1 per button (changed from "3 emails simulating Veeam, Synology, and NAKIVO" to "1 Veeam Backup Job email" per status button) ### Removed - Removed debug logging from ticket linking function after successfully resolving all ticket propagation issues (the logging was temporarily added to troubleshoot why resolved tickets kept appearing on new runs, wrote to AuditLog with event_type "ticket_link_debug" showing ticket_id, code, resolved_at status for every run import, debug code preserved in backupchecks-system.md documentation for future use if similar issues arise) ### Release - **v0.1.26** - Official release consolidating all ticket system bug fixes from 2026-02-10 (see docs/changelog.md and changelog.py for customer-facing release notes) ## [2026-02-09] ### Added - Extended Veeam parser to recognize "Job did not start on schedule" error notifications for Veeam Backup for Microsoft 365 (and other Veeam backup types) with job name extraction from subject and error message from plain text body (proxy server offline, scheduled run failed) - Added parser for Synology monthly drive health reports (backup software: Synology, backup type: Health Report, job name: Monthly Drive Health, informational only, no schedule learning) with support for both Dutch and English notifications ("schijfintegriteitsrapport"/"Drive Health Report") and automatic status detection (Healthy/Gezond → Success, problems → Warning) - Added "Cleanup orphaned jobs" maintenance option in Settings → Maintenance to delete jobs without valid customer links and their associated emails/runs permanently from database (useful when customers are removed) - Added "Preview orphaned jobs" button to show detailed list of jobs to be deleted with run/email counts before confirming deletion (verification step for safety) - Added "Generate test emails" feature in Settings → Maintenance with three separate buttons to create fixed test email sets (success/warning/error) in inbox for testing parsers and maintenance operations (each set contains exactly 3 Veeam Backup Job emails with the same job name "Test-Backup-Job" and different dates/objects/statuses for reproducible testing and proper status flow testing) - Added parser registry entry for Synology DSM automatic update cancelled notifications (backup software: Synology, backup type: Updates, informational only, no schedule learning) - Extended Synology DSM update parser with additional detection patterns ("Automatische DSM-update", "DSM-update op", "Packages on", "out-of-date", "Package Center", "new DSM update", "Auto Update has detected", "Update & Restore", "belangrijke DSM-update", "kritieke oplossingen", "wordt automatisch geïnstalleerd", "is beschikbaar op") and hostname extraction regex to recognize DSM update cancelled, out-of-date packages, new update available, and automatic installation announcements under same Updates job type while maintaining backward compatibility with existing patterns - Extended Synology Active Backup for Business parser to recognize skipped/ignored backup tasks ("genegeerd", "skipped", "ignored") as Warning status when backup was skipped due to previous backup still running ### Changed - Updated `docs/changelog.md` with comprehensive v0.1.25 release notes consolidating all changes from 2026-02-09 (Parser Enhancements for Synology and Veeam, Maintenance Improvements, Data Privacy, Bug Fixes) - Updated `containers/backupchecks/src/backend/app/changelog.py` with v0.1.25 entry in Python structure for website display (4 sections with subsections matching changelog.md content) - Removed customer name from Autotask ticket title to keep titles concise (format changed from "[Backupchecks] Customer - Job Name - Status" to "[Backupchecks] Job Name - Status") - Replaced real customer names in parser registry examples with generic placeholders (NTFS Auditing, QNAP Firmware Update, NAKIVO) to prevent customer information in codebase ### Fixed - Fixed Autotask ticket description being set to NULL when resolving tickets via `update_ticket_resolution_safe` by adding "description" to the optional_fields list, ensuring the original description is preserved during PUT operations - Fixed responsive navbar overlapping page content on smaller screens by implementing dynamic padding adjustment (JavaScript measures actual navbar height and adjusts main content padding-top automatically on page load, window resize, and navbar collapse toggle events) ### Changed - Updated `docs/changelog.md` with comprehensive v0.1.23 release notes consolidating all changes from 2026-02-06 through 2026-02-08 (Documentation System, Audit Logging, Timezone-Aware Display, Autotask Improvements, Environment Identification, Bug Fixes) - Updated `containers/backupchecks/src/backend/app/changelog.py` with v0.1.23 entry in Python structure for website display (8 sections with subsections matching changelog.md content) ## [2026-02-08] ### Changed - **Remarks & Tickets page**: Corrected "Integration with Autotask" section to clarify tickets are manually created (not automatically on failures), updated to describe manual ticket creation and PSA synchronization only ### Changed - Fixed critical inaccuracies in Backup Review documentation based on user feedback: - **Approving Backups page**: Corrected Stage 6 to emphasize ALL runs must be marked as reviewed regardless of action taken (override/ticket/remark created), added warning callout that failing to mark as reviewed leaves runs visible with wrong status next day, corrected Stage 7 to clarify successful runs MUST also be reviewed (goal is empty Run Checks page), added bulk review functionality for efficiency, completely rewrote Complete Workflow Example to focus on Run Checks page (primary daily tool) instead of Daily Jobs, updated best practices and role-based workflows to prioritize Run Checks over Daily Jobs, added performance tips for bulk review, corrected bulk review section from "select multiple run checkboxes" to "select multiple job checkboxes" to reflect per-job review mechanism - **Daily Jobs page**: Added blue "Success (Override)" status indicator to table showing runs treated as success due to active override, added callout clarifying Daily Jobs is for viewing schedules only and Run Checks is the primary operational tool (Daily Jobs may be deprecated in future), corrected page purpose from "primary operational dashboard" to schedule viewing tool - **Run Checks Modal page**: Corrected overview to emphasize this is THE primary daily operational tool (not just detail modal), added callout that goal is completely empty page, corrected "Success Runs Don't Need Review" to "All Runs Must Be Reviewed" with explanation, added bulk review section (select multiple + mark all), updated status information to include blue badge for override-applied runs, changed access description from "modal" to "page", removed non-existent "reviewed indicator" from page layout, corrected review mechanism from per-run to per-JOB (when marking a job as reviewed, ALL runs within that job are marked simultaneously), updated Mark as Reviewed section to clarify all runs for the job disappear together, corrected bulk review from "select multiple run checkboxes" to "select multiple job checkboxes", updated Unmark Reviewed section to reflect per-job unmarking, removed incorrect statement that successful runs are automatically reviewed, fixed troubleshooting section to remove false claim about successful runs not needing review - **Overrides & Exceptions page**: Updated "Treat as Success" action description to show blue badge instead of green, added visual differentiation explanation (green=genuine success, blue=override applied, yellow/red=unexpected problems) - All changes ensure documentation accurately reflects actual workflow: Run Checks is primary tool, all runs need review (including successes), blue badges indicate overrides, review is per-JOB not per-run ### Added - Completed Mail & Import documentation section (4 pages): - **Mail Import Setup**: Microsoft Graph API configuration with enhanced security (Azure AD app registration, start with Mail.Read only, Application Access Policy to restrict access to one mailbox via Exchange PowerShell, add Mail.ReadWrite after testing), two-step save workflow clarification (same "Save settings" button clicked twice - once for credentials to enable folder browsing, then again for complete configuration), automatic folder browser popup (no manual path entry), test configuration, troubleshooting (authentication errors, folder not found, no emails imported), advanced configuration (email retention, multiple mailboxes), comprehensive security best practices including principle of least privilege, note about planned UI improvement to make two-step save workflow more obvious - **Inbox Management**: Inbox overview and workflow (inbox shows ONLY unapproved emails - approved emails immediately disappear), table columns explanation (EML column shows download link, not checkmark), viewing email details with screenshot (approve-job.png), email detail modal TWO-COLUMN layout (left: metadata + action buttons + parsed objects, right: email body iframe), action buttons (Approve, Delete, Download .eml - NO Re-parse in modal), approving emails (customer selection ONLY - job name is READ-ONLY and cannot be edited), what happens after approval (email disappears from inbox, future emails auto-approved and never appear in inbox), re-parsing emails (ONLY "Re-parse all" button on inbox page - no individual re-parse), deleting emails (single and bulk delete, soft delete viewable on "Deleted Mails" page for Admins only), downloading .eml files, common workflows (new customer setup, troubleshooting unparsed emails - parsers can ONLY be created by developer, cleaning spam), best practices (verify parsed job names before approval - cannot edit during approval), removed Inbox Filters section (not in planning) - **Mail Parsing**: Parsing overview and workflow (retrieval, preprocessing, parser selection, matching, parsing, storage), parsers (viewing on separate "Parsers" page - Admin only, NOT in Settings), parser information table (removed non-existent "Enabled" column, added callout that parser list is read-only), match criteria (sender, subject, body match), supported backup software (Veeam, Synology, NAKIVO, Boxafe, Panel3, QNAP, Syncovery, 3CX, RDrive, NTFS Auditing), parser execution order, REMOVED entire "Enabling and Disabling Parsers" section (feature doesn't exist!), re-parsing emails (ONLY "Re-parse all" available, no individual re-parse), parsing workflow example, troubleshooting parsing issues (contact support - users cannot enable/disable/modify parsers), parser limitations, REMOVED "AI-powered parsing" future enhancement (not in planning, completely fabricated), best practices (removed references to testing/enabling parsers - users cannot manage parsers) - **Auto-Import Configuration**: Auto-import overview and features, enabling auto-import, import interval configuration (5/15/30/60 minutes), batch size explanation, how auto-import works (timer, check settings, authenticate, fetch, parse, auto-approve, move, log, persist, wait), auto-approval logic and conditions, when auto-approval fails, manual import (triggering, batch size 1-50), import settings summary table, monitoring import activity (audit log, inbox page, jobs/daily jobs), troubleshooting (auto-import not running, emails not auto-approved, import errors), best practices, advanced configuration (disabling temporarily, EML retention, high-volume environments) - Completed Backup Review documentation section (5 pages): - **Daily Jobs View**: Primary operational dashboard for monitoring backup operations, schedule inference from historical run patterns (weekly and monthly detection), status tracking (Success/Warning/Failed/Missed/Expected badges), missing job detection, override indicators with badges, ticket (🎫) and remark (💬) indicators, date selection with timezone support, job table columns (customer, backup software/type, job name, schedule, last run, status, reviewed checkmark for Admin only), schedule inference explanation (daily/weekly/monthly patterns, requires 10-14 days of data), override badges showing treated-as-success status, viewing job details via Run Checks modal, reviewing jobs (mark as reviewed for warnings/failures, successful jobs auto-reviewed), common workflows (morning review, checking previous days, identifying schedule changes), best practices (review daily, focus on failures first, watch for missed jobs, use overrides for known issues, create tickets for recurring issues), troubleshooting (job not appearing, schedule shows irregular/-, job shows missed but ran) - **Run Checks Modal**: Detailed review interface for investigating backup job runs (opens from Daily Jobs or Job History), available to Admin and Operator roles only (not Viewer), modal layout with job header, run list (left side showing unreviewed runs by default, Admin can toggle "Include reviewed"), run details (right side showing status, backup objects table with name/type/status/message, email content in iframe with metadata and download .eml option, Autotask ticket information if integration enabled), review actions (Mark as reviewed for acknowledging issues, Unmark reviewed for Admin only), linking tickets and remarks from modal, backup objects table showing individual item statuses (objects only shown if parser extracted them), email body rendering (HTML with formatting, plain text as preformatted, sandboxed iframe for security), Autotask fields (ticket number, status, resolved origin, resolved at, deleted info with who/when), common workflows (investigating failures, comparing multiple runs, reviewing warnings with overrides, troubleshooting missed jobs), best practices (always check objects, read error messages carefully, review full email body, create tickets for recurring issues, use remarks for temporary issues, compare historical runs), troubleshooting (no backup objects shown, email body blank, can't mark as reviewed, run list is empty) - **Overrides & Exceptions**: Override rules to automatically handle known issues and expected warnings, two override levels (global: by backup software/type affecting multiple jobs across customers, object-level: specific job or object within job checked first before global), match criteria (status match for any/success/warning/failed, error text match with contains/exact/starts_with/ends_with modes), treat as success action (enabled by default, displays green badge with override indicator instead of original status), time windows (From date optional for retroactive application to existing runs, Until date optional for permanent/temporary overrides), creating overrides (form with level/software/type/job/object/status/error match/time window/comment fields, retroactive application to unreviewed runs), managing overrides (existing overrides table showing level/scope/time/active/comment, Edit button to modify, Disable/Enable toggle, Delete for Admin only), override evaluation order (object-level first, then job-level, then global - first match wins), common scenarios with examples (Veeam retry warnings, planned maintenance windows, known issue with one VM, global NAKIVO replication warnings), best practices (start specific then generalize, always document with comments and ticket numbers, use time windows for temporary issues, review periodically, be specific with error text, test before global overrides, disable don't delete when unsure), troubleshooting (override not applied - check active status/time window/match criteria, override too broad - check global vs object level and error match type, multiple overrides conflicting - most specific wins) - **Remarks & Tickets**: Two mechanisms for documenting issues (tickets for external followup requiring tracking, remarks for internal notes/known issues/temporary problems), accessing via Tickets page with two tabs (Tickets and Remarks tabs, filtering by status/customer/backup software/type/search), ticket properties (ticket code, description, active from date, start date, resolved at, scopes defining what it affects), creating tickets (from Run Checks modal or Tickets page, auto-linked to job run with scopes auto-populated), ticket scopes (customer/backup software/backup type/job/job run levels for automatic ticket indicators), viewing ticket details (status, code, dates, scopes list, linked runs last 20), resolving tickets (marks as resolved with timestamp, remains visible with ✅ indicator, 🎫 removed from job displays, Admin/Operator only), linking tickets to additional runs, remark properties (body freeform text, start date, resolved at, scopes), creating remarks (from Run Checks modal or Remarks tab, similar to tickets but simpler), viewing remark details (status, body, scopes, linked runs), resolving remarks (similar to tickets, 💬 removed from displays), filtering options (status active/all, customer, backup software/type, search by ticket code or job name), tickets vs remarks comparison table (when to use each), ticket/remark indicators (🎫 for active tickets, 💬 for active remarks in Daily Jobs and Job History), common workflows (creating ticket for recurring failure, adding remark for planned maintenance, resolving after customer action, reviewing historical tickets), best practices (create tickets promptly, use descriptive codes referencing PSA, set accurate active from dates, resolve promptly, use remarks for temporary issues, link to multiple runs, review monthly, use remarks for documentation), Autotask integration mention for automatic ticket creation, troubleshooting (indicator not showing - check active status and date and scope, cannot create - check role permissions, scope affecting wrong jobs - review scopes breadth), ticket editing currently disabled (resolve old and create new) - **Approving Backups**: Complete backup review lifecycle workflow from email import to marking runs as reviewed, seven lifecycle stages (email import, parsing, inbox approval, automatic processing, daily monitoring, run review, issue tracking, mark as reviewed), Stage 1 Email Import & Parsing (auto-import from mailbox via Graph API every 15 minutes, parsers extract structured backup information), Stage 2 Inbox Approval (new job emails appear in inbox, review and approve with customer selection, creates Job and JobRun records, email disappears from inbox, future emails auto-approved), Stage 3 Automatic Processing (matching emails auto-create JobRun records, no inbox appearance, immediate Daily Jobs visibility), Stage 4 Daily Monitoring (schedule inference from patterns, status badges, overrides applied automatically, ticket/remark indicators shown), Stage 5 Run Review (click job in Daily Jobs to open Run Checks modal, investigate objects/errors/email content, determine appropriate action), Stage 6 Issue Tracking with four options (mark as reviewed for no action needed, create override for recurring expected issues, create remark for temporary/internal notes, create ticket for external followup), Stage 7 Mark as Reviewed (marks with review timestamp, disappears from unreviewed list, creates audit record, successful runs auto-reviewed), complete workflow example from Day 1 new customer onboarding through Day 15 issue resolved (showing real timestamps and decision points), role-based workflows (Operator: review/create tickets/remarks/overrides/mark reviewed, Admin: same plus view reviewed runs and unmark and delete, Viewer: read-only view Daily Jobs only), performance tips (use filters, review by exception with overrides, batch approve inbox, create global overrides for common warnings, use tickets for tracking workload, archive resolved tickets), best practices (review daily, approve inbox quickly, triage by status, use overrides for recurring warnings, create tickets for customer action, use remarks for temporary notes, always check objects, document in comments, resolve tickets promptly, monitor schedule inference) ### Added ### Added - Added comprehensive documentation system for user onboarding and reference: - **Documentation Blueprint**: New `/documentation` route with dedicated blueprint (doc_bp) - **Navigation Structure**: Hierarchical documentation with 9 sections and 33 pages covering all features - Getting Started (3 pages): What is BackupChecks, First Login, Quick Start - User Management (3 pages): Users & Roles, Authentication, Profile Settings - Customers & Jobs (4 pages): Managing Customers, Configuring Jobs, Approved Jobs, Job Schedules - Mail & Import (4 pages): Setup, Inbox Management, Mail Parsing, Auto-Import - Backup Review (5 pages): Approving Backups, Daily Jobs, Run Checks Modal, Overrides, Remarks & Tickets - Reports (4 pages): Creating Reports, Relative Periods, Scheduling, Exporting Data - Autotask Integration (4 pages): Setup, Company Mapping, Creating Tickets, Ticket Management - Settings (6 pages): General, Mail, Autotask, Reporting, User Management, Maintenance - Troubleshooting (3 pages): Common Issues, FAQ, Support Contact - **UI Components**: - Sidebar navigation with collapsible sections and active page highlighting - Breadcrumb navigation for current location context - Previous/Next pagination buttons for sequential reading - Documentation menu item in main navbar (📖 icon) visible to all authenticated users - **Styling**: - Custom CSS with support for dark mode - Callout boxes (info, warning, tip, danger) for highlighting important content - Code blocks, tables, and image support - Responsive design for mobile and desktop - **Access Control**: Login required (@login_required) - accessible to all user roles - **Current Status**: Core infrastructure complete, getting-started (3 pages), users (3 pages), and customers-jobs (4 pages) sections completed with comprehensive content - **Placeholder Pages**: Remaining 23 pages created with basic structure for future content - Full content for remaining sections will be added incrementally in future updates ### Changed - Enhanced documentation accuracy in Users section: - **Login & Authentication page**: Added captcha requirement explanation (simple math problem), noted future plan to make it optional via Settings - **Browser Security section**: Clarified HTTPS context - only relevant for external access via domain name, not for internal IP-based deployments (typical use case) - **Browser Compatibility**: Marked Mozilla Firefox as "Recommended - Most tested" browser for optimal experience - **Profile Settings page**: Streamlined to reflect actual functionality - only password change available in User Settings page, theme and role selectors located in navigation bar ### Removed - Removed non-existent features from Profile Settings documentation: - Notification Preferences section (no plans for implementation) - Session Information section (not displayed in User Settings) - Redundant theme/role configuration sections (these are in navbar, not settings page) ### Added - Completed Customers & Jobs documentation section (4 pages): - **Managing Customers**: Customer creation, editing, activation/deactivation, Autotask company mapping, CSV export/import, delete operations - **Configuring Jobs**: Inbox-based job approval workflow, Mail Parser automatic configuration, Reparse All functionality, job archiving and deletion - **Approved Jobs**: Jobs list overview, job details, status indicators, archive/unarchive workflow, JSON export/import for migration - **Job Schedules**: Automatic schedule learning, schedule types (daily/weekly/monthly), Daily Jobs integration, schedule accuracy and troubleshooting - Added user-settings.png screenshot showing password change form - Enhanced documentation CSS: centered all images horizontally (display: block, margin: 20px auto) ## [2026-02-07] ### Changed - Renamed AdminLog to AuditLog for better semantic clarity: - **Model**: AdminLog → AuditLog (backwards compatible alias maintained) - **Table**: admin_logs → audit_logs (automatic migration) - **Function**: log_admin_event() → log_audit_event() (alias provided) - Better reflects purpose as comprehensive audit trail for both user and system events - Updated UI labels to reflect audit log semantics: - Changed "Admin activity" to "System Audit Log" in logging page header ### Added - Expanded audit logging for critical operations: - **Settings Changes**: Now logs all changes to General, Mail, and Autotask settings - Tracks which settings changed with old value → new value comparison - Event types: `settings_general`, `settings_mail`, `settings_autotask` - Excludes sensitive data (passwords are never logged) - Example logged fields: ui_timezone, require_daily_dashboard_visit, is_sandbox_environment, graph_mailbox, autotask_enabled - **Export Operations**: Logs when users export data - **Customers export** (event type: `export_customers`): CSV format, record count - **Jobs export** (event type: `export_jobs`): JSON schema version, customer/job counts - **Import Operations**: Logs when users import data - **Customers import** (event type: `import_customers`): CSV format, created/updated/skipped counts - **Jobs import** (event type: `import_jobs`): JSON schema version, all operation counts (customers and jobs) - All logging uses structured event_type for filtering and includes detailed JSON in details field - Maintains 7-day retention policy - No performance impact (async logging) - Helps with compliance, troubleshooting, and security audits ## [2026-02-06] ### Added - Added Sandbox/Development environment indicator feature: - **Database Model**: Added `is_sandbox_environment` boolean column to `SystemSettings` model (defaults to `False` for production safety) - **Database Migration**: Created `migrate_system_settings_sandbox_environment()` function for automatic schema update on deployment (idempotent, safe to run multiple times) - **Backend Routes**: - Extended `routes_settings.py` to process the new checkbox setting in the General tab - Updated `routes_shared.py` context processor to inject `system_settings` into all template contexts - **Settings UI**: - Added new "Environment" card in Settings > General (placed after Navigation section) - Toggle switch with clear English description: "Mark this as a Sandbox/Development environment" - Help text explains visual banner behavior - **CSS Styling**: - Created `sandbox.css` with diagonal red banner styling - Position: top-left corner, rotated 45 degrees - Color: Bootstrap danger red (#dc3545) with white text - Z-index: 9999 (always on top) - `pointer-events: none` - banner itself is non-interactive, elements behind it remain clickable - Box-shadow for depth effect - **Base Template**: - Banner conditionally displayed only when setting is enabled - CSS include added to `` section - Banner placed directly after `` tag, before navbar - The banner displays "SANDBOX" in uppercase with letter-spacing for clear visibility across all pages - Auto-load Autotask reference data on Settings page load: - Automatically fetches queues, ticket sources, statuses, and priorities when opening Settings - Only triggers when Autotask is enabled, credentials are configured, and cache is empty - Eliminates need to manually click "Refresh reference data" before selecting defaults - Displays info message with loaded data counts - Extended export/import functionality to include Autotask company mappings: - **Customer Export/Import** (CSV at /customers/export): - Export now includes `autotask_company_id` and `autotask_company_name` columns - Import reads Autotask mapping fields and applies them to existing or new customers - Backwards compatible - old CSV files without Autotask columns still work - Import resets `autotask_mapping_status` and `autotask_last_sync_at` to allow resynchronization - **Jobs Export/Import** (JSON at Settings > Maintenance): - Export now includes Autotask fields in customers array (`autotask_company_id`, `autotask_company_name`) - Import processes customers array first, applying Autotask mappings before creating jobs - Schema remains `approved_jobs_export_v1` for backwards compatibility - Import message now shows both created and updated customer counts - Enables preservation of Autotask company mappings during system reset/migration workflows - Implemented timezone-aware datetime display across all pages: - **Template Filter**: Added `local_datetime` Jinja2 filter to convert UTC datetimes to UI timezone - **Automatic Conversion**: All datetime fields now automatically display in configured timezone (Settings > General > UI Timezone) - **Database**: All datetime values remain stored in UTC for consistency - **Affected Pages**: Customers (Autotask sync time), Settings (reference data sync), Feedback, Logging, Overrides, Archived Jobs, Tickets, Remarks, Inbox, Job Detail, Admin Mail - **Custom Format Support**: Filter accepts strftime format parameter (e.g., `|local_datetime('%d-%m-%Y %H:%M')`) - **Graceful Fallback**: Falls back to UTC display if timezone conversion fails - **Default Timezone**: Europe/Amsterdam (configurable via SystemSettings.ui_timezone) ### Changed - Renamed "Refresh" button to "Search" in Link existing Autotask ticket modal for better clarity (the button performs a search operation) - Added ellipsis-field functionality to "Overall remark" and "Remark" fields in Run Checks modal to prevent long text from hiding action buttons (click to expand/collapse) - Enhanced Autotask ticket display in Run Checks modal: - Added "Open in Autotask" button next to ticket number for direct navigation to ticket in Autotask PSA - Button only appears when ticket is linked (autotask_ticket_id exists) and Autotask integration is enabled - Opens in new tab with proper URL format including workspace and ticket ID parameters - Styled as small outline button to maintain compact layout - Merged all feature branches from v20260203-01 through v20260205-13 into main branch - Consolidated 29 feature branches spanning three development cycles - Used final state from v20260205-13-changelog-python-structure to preserve all functionality - Successfully integrated Autotask PSA integration, changelog restructuring, and UI improvements - All features from individual branches now available in main - Reorganized Autotask settings into two separate forms with dedicated save buttons: - **Autotask Settings** form with "Save Autotask Settings" button inside the card - **Ticket Defaults** form with "Save Ticket Defaults" button inside the card - All fields marked as required with red asterisks (*) - HTML5 validation prevents saving incomplete configurations - Clear visual separation improves UX and prevents accidental saves ### Fixed - Jobs from archived jobs and inactive customers no longer appear on Daily Jobs, Run Checks, and Jobs list pages - Added customer active status filtering to all job list queries - Jobs now filtered where customer is NULL or active=True alongside existing archived=False filter - Prevents showing jobs with "-" status from deleted customers or archived jobs - Default Ticket Status dropdown no longer appears empty on first visit to Settings page - Default Ticket Status value is now protected against accidental clearing: - Only updates when a valid status is selected - Only allows clearing if reference data is loaded (dropdown has options) - Preserves existing value if dropdown is empty (prevents data loss) - Fixes issue where "Create Autotask ticket" failed due to missing default status after saving settings with empty dropdown ### Removed - Cleaned up 66 merged feature branches from repository (both local and remote): - Removed all v20260113-* branches (8 branches) - Removed all v20260115-* branches (17 branches) - Removed all v20260116-* branches (12 branches) - Removed all v20260119-* branches (18 branches) - Removed all v20260120-* branches (11 branches) - Repository now contains only main branch and current working branches (v20260206-*) ## [2026-02-05] ### Added - Redesigned changelog system to use Python-based structure instead of Markdown: - Created `app/changelog.py` with structured changelog data (21 versions from v0.1.22 to v0.1.2) - Each version contains: version number, date, summary, and structured sections - Sections include: title, type (feature/improvement/fixed/documentation), and list of changes - Removed Gitea dependency for changelog rendering - now fully self-contained - No external dependencies, faster loading, always available - New changelog.html template with modern design: - Sidebar navigation with all versions for quick jumping between releases - Sticky sidebar that remains visible during scrolling - Bootstrap cards for each version with gradient blue headers - Color-coded type badges for sections: - Green gradient: Feature - Blue gradient: Improvement - Red gradient: Fixed - Purple gradient: Documentation - Responsive design (sidebar hidden on mobile devices) - Summary section with blue left border highlight - Click-to-expand sections with smooth animations - Created `static/css/changelog.css` with comprehensive styling: - Modern gradients for badges and headers - Dark mode support via CSS variables - Hover effects on navigation links and list items - Smooth scrolling to version anchors - Compact spacing optimizations (reduced padding, margins, font sizes) - CSS specificity enhancements with !important flags to override Bootstrap defaults - Added `{% block head %}` to base.html template to allow pages to inject custom CSS ### Changed - Updated `routes_changelog.py` to load data from `changelog.py` instead of fetching from Gitea - Simplified changelog route - removed markdown parsing and external HTTP requests - Removed dependency on `markdown` library for changelog rendering - Template now receives structured Python data instead of HTML string ### Fixed - Fixed module import path in routes_changelog.py (changed from `from app.changelog` to `from ..changelog`) - Fixed dictionary key conflict - renamed `items` to `changes` to avoid collision with dict.items() method - Added missing `{% block head %}` in base.html that prevented custom CSS from loading ### Technical Details - Changelog data structure uses dictionaries with keys: version, date, summary, sections - Sections contain: title, type, subsections (optional), changes - Subsections contain: subtitle, changes - All list items use "changes" key instead of "items" to avoid Python reserved method conflicts - CSS uses !important flags and increased specificity (.changelog-nav .changelog-nav-link) to override Bootstrap - Compact spacing achieved with: 0.15rem padding, 0.15rem margins, 0.85rem/0.7rem font sizes, 1.1/1.0 line heights ### Added - Autotask customer mapping now auto-searches for similar company names when opening unmapped customers: - Automatically populates search box with customer name - Displays matching Autotask companies as suggestions - Speeds up mapping process by eliminating manual search for most customers - Autotask "Link existing ticket" now supports cross-company ticket search: - Added `query_tickets_by_number()` to search tickets by number across all companies - When searching with a ticket number (e.g., "T20260205.0001"), results include: - Tickets from the customer's company (primary results) - Matching tickets from other companies (for overarching issues) - Enables linking tickets for multi-company infrastructure issues ### Changed - Autotask resolve confirmation and note messages now correctly indicate ticket closure status: - Frontend confirmation dialog explains conditional closure based on time entries - Backend route checks time entries before creating note and generates dynamic message: - "ticket will be closed in Autotask" when no time entries exist - "ticket remains open in Autotask due to existing time entries" when time entries exist - Route docstring updated to reflect conditional status update behaviour ### Added - Autotask conditional ticket status update based on time entries (API contract section 9): - `query_time_entries_by_ticket_id()` - Query time entries for a ticket via POST /TimeEntries/query - `update_ticket_resolution_safe()` now checks for time entries and conditionally sets status: - If NO time entries exist: sets status to 5 (Complete) with completedDate and resolvedDateTime - If time entries exist: keeps current status unchanged (ticket remains open) ### Fixed - Automatic mail import can now be disabled in Settings after being enabled (fixed unchecked checkbox not being processed) - Autotask "Link existing" search box now clears when opening the modal instead of retaining previous search text - Autotask customer mapping search box now clears when opening the edit modal instead of retaining previous search text - Autotask ticket resolution update now correctly preserves exact field values from GET response in PUT payload. The `issueType`, `subIssueType`, and `source` fields are copied with their exact values (including null) from the GET response, as required by Autotask API. Previously these fields were being skipped or modified. ### Added - Restored Autotask PSA integration from branch `v20260203-13-autotask-resolution-item-wrapper`: - `integrations/autotask/client.py` - Autotask REST API client with full support for: - Zone information discovery - Ticket CRUD operations (create, get, update) - Ticket notes via `/Tickets/{id}/Notes` endpoint - Safe resolution updates preserving stabilizing fields - Query support for companies, tickets, time entries, deleted ticket logs - Reference data retrieval (queues, ticket sources, priorities, statuses) - `ticketing_utils.py` - Utilities for internal ticket management and Autotask linkage - Database migrations for Autotask fields: - `SystemSettings`: Autotask connection settings, defaults, and cached reference data - `Customer`: Autotask company mapping fields - `JobRun`: Autotask ticket linkage and deletion tracking fields - `Ticket`: Resolution origin tracking - Settings UI for Autotask configuration (connection test, reference data sync) - Run Checks integration for Autotask ticket creation - Customers page with Autotask company mapping - Documentation files for Autotask integration design and implementation - Added `docs/autotask_rest_api.md` - Validated Autotask REST API contract based on Postman testing ## [2026-02-04] ### Added - `docs/changelog-claude.md` - Changelog file for tracking changes made via Claude Code - Setting to enable/disable daily dashboard redirect requirement (Settings > General > Navigation) - New `require_daily_dashboard_visit` column in `SystemSettings` model - Migration in `migrations.py` to add the column - Toggle in Settings General page under new "Navigation" card - Default value is OFF (disabled) - users can navigate directly to any page ### Changed - Converted changelog to English (all project documentation must be in English) - Documented branch naming convention and build workflow in Claude memory - Filled README.md with comprehensive project documentation based on source code analysis ### Performance - Added database indexes migration (`migrations.py`) for frequently queried foreign key columns: - `JobRun`: indexes on `job_id`, `job_id+run_at`, `job_id+reviewed_at`, `mail_message_id` - `MailMessage`: indexes on `job_id`, `location`, `job_id+location` - `MailObject`: index on `mail_message_id` - `TicketScope`: indexes on `ticket_id`, `job_id` - `RemarkScope`: indexes on `remark_id`, `job_id` - Fixed N+1 query in `_recompute_override_flags_for_runs()` - batch loads all jobs instead of per-run queries - Optimized Daily Jobs page with batch queries: - Batch load all today's runs for all jobs in single query - Batch infer weekly schedules for all jobs (was per-job query) - Batch infer monthly schedules for jobs without weekly schedule - Batch load ticket/remark indicators for all jobs