Commit graph

9 commits

Author SHA1 Message Date
DJP
fcd329ada8 Compact UI and fix zoom bug
UX Improvements:
 Multi-column grid layout for issues (2-3 columns on wide screens)
- Issues now display in columns using CSS Grid
- Reduces scrolling by 50-70% on large reports
- Automatically responsive (1 column on mobile)

📏 Reduced white space throughout:
- Issue cards: 20px → 10px padding
- Card margins: 30px → 20px
- Section headers: 20px → 10px padding
- Smaller fonts and tighter spacing
- Page overview cards more compact

🔍 Fixed zoom bug:
- Wrapped image + SVG in zoomContainer
- Apply transform to container, not just image
- SVG markers now scale perfectly with zoom
- No redrawing needed - automatic scaling!

Before: ~40px per issue → Now: ~25px per issue
Result: 20 issues fit in ~500px vs ~800px

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 17:46:27 -04:00
DJP
91d2ff3573 Fix coordinate origin - remove Y-axis flipping
Issue: Markers still misaligned after DPI scaling
Cause: pdfplumber uses top-left origin, I was flipping Y incorrectly
Fix: Remove Y-flip - both pdfplumber and SVG use top-left (0,0)

Coordinate Systems:
- pdfplumber: (0,0) = top-left, y increases DOWN
- SVG: (0,0) = top-left, y increases DOWN
- Standard PDF: (0,0) = bottom-left, y increases UP

Since pdfplumber already gives us top-left coords, just scale, don't flip!

Now: x_pixel = x_pdf × scale, y_pixel = y_pdf × scale

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 16:33:47 -04:00
DJP
2952731bd6 Fix coordinate scaling for visual markers
Issue: Marker boxes were misaligned with actual PDF content
Cause: Coordinate system mismatch between PDF (72 DPI) and rendered images (150 DPI)
Fix: Apply proper DPI scaling factor to coordinates

Changes:
- Calculate scale factor: DPI / 72 (e.g., 150/72 = 2.083)
- Scale all x/y coordinates before drawing
- Store page_image_dpi in JSON for frontend
- Add debug console logs to verify scaling

Formula:
- pixel_coordinate = pdf_coordinate × (image_dpi / 72)
- Example: 100 points @ 150 DPI = 208 pixels

Now markers should align perfectly with PDF content!

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 16:31:02 -04:00
DJP
3a81d2623d Fix poppler PATH for MAMP environments
Issue: Page images weren't being generated in web interface
Cause: MAMP/PHP doesn't include /opt/homebrew/bin in PATH
Fix: Add poppler paths before executing Python script

Now page images will generate correctly and Visual Page Inspector will appear!

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-20 16:28:02 -04:00
DJP
0986285d4b Add test PDF for visual inspector demo
- Created test_visual_inspector.pdf with 6 images containing text
- 3 pages: Pages 1-2 have issues, Page 3 is correct
- Demonstrates visual markers on actual issues
- Script included to regenerate if needed

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-20 16:21:18 -04:00
DJP
59efe72607 Add Visual Page Inspector with interactive issue markers
Frontend Features:
 NEW: Visual Page Inspector component
- Display PDF pages as images with zoom controls
- SVG overlay system for precise issue highlighting
- Color-coded markers by severity (red/orange/yellow/blue)
- Numbered badges on each issue for easy reference
- Interactive hover tooltips with issue details
- Click-through to see exact locations on page

User Experience:
📄 Page selector sidebar shows all pages
- Color-coded badges indicate issue severity per page
- Click any page to view it
- Pages with no issues show in green

🔍 Zoom Controls:
- Zoom in/out buttons (50% - 300%)
- Reset to 100%
- Markers scale with zoom level

🎯 Interactive Markers:
- Dashed rectangles highlight issue locations
- Hover to see full issue description + fix recommendation
- Semi-transparent overlays don't obscure content
- Numbered circles for easy cross-reference

Backend Support:
- API endpoint: api.php?action=image&job_id=X&page=Y
- Serves PNG images with proper caching headers
- Coordinate system conversion (PDF → screen coords)

How It Works:
1. Python generates page images at 100 DPI
2. Issues with coordinates get visual markers
3. SVG overlays drawn at correct positions
4. Tooltips show on hover

Perfect for:
- Seeing exactly where image/contrast issues are
- Visual verification of accessibility problems
- Training teams on what to fix
- Before/after comparisons

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 16:01:52 -04:00
DJP
b07116f402 Add coordinate tracking and page image generation
Backend Changes:
- Added coordinates field to AccessibilityIssue class
- Extract and store x0, y0, x1, y1 coordinates for image issues
- Generate PNG images for each page (100 DPI)
- Save page images alongside JSON report
- Include page_images map in JSON output

Coordinate Support:
- Image issues now include exact location on page
- Coordinates use PDF coordinate system (bottom-left origin)
- Ready for visual highlighting in web interface

Image Generation:
- Automatic when --output specified
- Images saved to {output}_images/ directory
- PNG format optimized for web display
- Only generated if pdf2image available

Next: Update web interface to display pages with markers

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-20 15:57:51 -04:00
DJP
87bdacc22b Add visual page-by-page issue display
New Features:
- 📄 Interactive page overview map showing issue severity
- Color-coded page cards (red=critical, yellow=warning, green=good)
- Click page cards to jump to that page's issues
- Collapsible sections for each page
- Issue grouping: Document-wide vs Page-specific
- Visual icons for each issue category (🏗️📋🖼️🎨 etc)
- Severity icons (🚨⚠️ℹ️)
- Better "How to Fix" recommendations
- Page sections collapse/expand with ▼▶ indicators

Improvements:
- Much easier to navigate multi-page PDFs
- Visual heat map shows problem areas at a glance
- Grouped by page makes fixing issues more systematic
- Category icons help identify issue types quickly

🤖 Generated with Claude Code
2025-10-20 15:53:11 -04:00
DJP
bf83a409bb Initial commit: Enterprise PDF Accessibility Checker
- Complete WCAG 2.1 accessibility checking system
- AI-powered analysis with Claude 4.5 and Google Vision
- Web interface with drag-and-drop upload
- REST API backend (PHP)
- Python checker with parallel processing
- Quick mode for fast scans (~10 seconds)
- Full mode with AI analysis (~2 minutes)
- .env file support for API keys
- Error logging and debugging tools
- Comprehensive documentation

Performance improvements:
- Parallel image processing (3x faster)
- Smart API timeouts (10s)
- Reduced DPI for faster conversions
- Real-time progress updates

🤖 Generated with Claude Code
2025-10-20 15:50:56 -04:00