backupchecks/docs/changelog-claude.md
Ivo Oskamp d08fbfecd4 Expand changelog entry with detailed implementation description
Added comprehensive breakdown of the Sandbox environment indicator feature
including all modified components (database, backend, frontend, CSS) with
specific technical details for better documentation and understanding.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 12:53:45 +01:00

9.8 KiB

Changelog - Claude Code

This file documents all changes made to this project via Claude Code.

[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 <head> section
      • Banner placed directly after <body> tag, before navbar
    • The banner displays "SANDBOX" in uppercase with letter-spacing for clear visibility across all pages

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)

[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