Commit graph

3 commits

Author SHA1 Message Date
ben
f66f1494c5 fix: resolve announcements modal visibility issues (v2.0.1)
Comprehensive architectural fix for master trainer announcements modal
that was invisible despite JavaScript executing correctly.

Root Causes Fixed:
1. Duplicate CSS modal definitions causing cascade conflicts
2. JavaScript using fadeIn() but CSS expecting .active class
3. Inline style="display:none" overriding all CSS rules
4. Browser cache preventing JavaScript updates

Changes:
- Remove duplicate .hvac-modal CSS definition (lines 794-835)
- Remove unused @keyframes fadeIn and slideIn animations
- Update openModal() to use .active class + body scroll prevention
- Update closeModal() to remove .active class
- Remove inline display:none from modal HTML templates
- Increment HVAC_VERSION to 2.0.1 for cache busting

Testing:
- Validated with MCP Playwright browser automation
- Visual confirmation of working modal
- Code review with Zen GLM-4.6 expert analysis

Files Modified:
- assets/css/hvac-announcements.css
- assets/js/hvac-announcements-admin.js
- includes/class-hvac-plugin.php
- includes/class-hvac-announcements-admin.php
- includes/class-hvac-announcements-display.php

Status: Modal now fully functional on staging
Next: Fix wp.editor.setContent error, investigate remaining page errors

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 13:59:24 -04:00
Ben
cc34abb5fe feat: implement announcement modal system with comprehensive documentation
- Add interactive modal popup for announcement 'Read More' functionality
- Fix nonce conflict by creating separate hvac_announcements_ajax object
- Implement secure AJAX handler with rate limiting and permission checks
- Add comprehensive modal CSS with smooth animations and responsive design
- Include accessibility features (ARIA, keyboard navigation, screen reader support)
- Create detailed documentation in docs/ANNOUNCEMENT-MODAL-SYSTEM.md
- Update API-REFERENCE.md with new modal endpoints and security details
- Add automated Playwright E2E testing for modal functionality
- All modal interactions working: click to open, X to close, ESC to close, outside click
- Production-ready with full error handling and content sanitization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 16:28:55 -03:00
Ben
c20b461e7d feat: Implement secure Trainer Announcements system with comprehensive features
This commit introduces a complete announcement management system for HVAC trainers
with enterprise-grade security, performance optimization, and email notifications.

## Core Features
- Custom post type for trainer announcements with categories and tags
- Role-based permissions (master trainers can create/edit, all trainers can read)
- AJAX-powered admin interface with real-time updates
- Modal popup viewing for announcements on frontend
- Automated email notifications when announcements are published
- Google Drive integration for training resources

## Security Enhancements
- Fixed critical capability mapping bug preventing proper permission checks
- Added content disclosure protection for draft/private announcements
- Fixed XSS vulnerabilities with proper output escaping and sanitization
- Implemented permission checks on all AJAX endpoints
- Added rate limiting to prevent abuse (30 requests/minute)
- Email validation before sending notifications

## Performance Optimizations
- Implemented intelligent caching for user queries (5-minute TTL)
- Added cache versioning for announcement lists (2-minute TTL)
- Automatic cache invalidation on content changes
- Batch email processing to prevent timeouts (50 emails per batch)
- Retry mechanism for failed email sends (max 3 attempts)

## Technical Implementation
- Singleton pattern for all manager classes
- WordPress coding standards compliance
- Proper nonce verification on all AJAX requests
- Comprehensive error handling and logging
- Mobile-responsive UI with smooth animations
- WCAG accessibility compliance

## Components Added
- 6 PHP classes for modular architecture
- 2 page templates (master announcements, trainer resources)
- Admin and frontend JavaScript with jQuery integration
- Comprehensive CSS for both admin and frontend
- Email notification system with HTML templates
- Complete documentation and implementation plans

This system provides a secure, scalable foundation for trainer communications
while following WordPress best practices and maintaining high code quality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 13:34:15 -03:00