Commit graph

6 commits

Author SHA1 Message Date
Vadym Samoilenko
79aaf050bf PDF report reflects adjusted score + manual pass for Matterhorn H-type CPs
- api.php: add save_adjusted_result action that merges dismissed issues,
  check overrides and recalculated score into {job_id}.adjusted.json;
  handleExport() now prefers .adjusted.json over .result.json
- js/results.js: displayMatterhorn() shows Mark as Passed / Undo buttons
  for H-type CPs (CP04, CP13) linked to overridden checks; overrideCheck /
  unoverrideCheck refresh Matterhorn table and recompute overall banner
- js/batch.js: exportReport() saves adjusted result before opening export
  URL, using pre-opened window to avoid popup blockers
- report_generator.py: filter dismissed issues, show (Adjusted) badge,
  Manual Pass in checks and Matterhorn tables; switch generate_html() to
  Montserrat + Oliver branding (#1a1a1a header, #FFC407 skip-link)
- css/styles.css: fix dark-mode log-header from blue-ish #252840 to #242424

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 16:28:53 +00:00
Vadym Samoilenko
148853c699 Add WCAG compliance summary, level badges, font names, next steps
enterprise_pdf_checker.py:
- WCAG_LEVELS dict maps all 2.1 criteria to A/AA/AAA
- AccessibilityIssue.to_dict() now includes wcag_level field
- _check_fonts() collects actual font names into details dict
  instead of just counting (details.non_embedded_fonts list)
- _generate_summary() adds wcag_compliance block:
    level_a / level_aa bool + failing criteria lists
- _generate_summary() adds next_steps: top 8 prioritised actions
  (Critical → Error → Warning, deduplicated by recommendation text)

js/results.js:
- displayWcagCompliance(): renders pass/fail badges for Level A/AA
- displayNextSteps(): numbered action list with priority badges
- createIssueCard(): shows wcag_level pill (A/AA/AAA) alongside
  WCAG criterion link

index.html:
- #wcagCompliance div between statsGrid and scoreBreakdown
- #nextStepsCard below remediationCard

css/styles.css:
- .wcag-badge, .wcag-compliance-row, .wcag-badge-level/status
- .wcag-level-badge + .wcag-level-A/AA/AAA colour variants
- .next-step-item, .next-step-num, .next-step-body/action/meta

report_generator.py:
- HTML report: WCAG conformance section + next steps table
  between score card and issues table
- PDF report: compliance banners + next steps table in sections_html

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 14:32:21 +00:00
Vadym Samoilenko
973c73da7c Fix report accessibility + temp-filename title suggestion bug
pdf_remediation.py:
- _suggest_title() now detects temp filenames (tmp + random chars) and
  extracts the first line of content instead of using the useless
  temp name (e.g. "Tmp9H15Ocsl" → actual document text)

report_generator.py — HTML report:
- Add skip-to-main-content link (WCAG 2.4.1)
- Wrap content in <main id="main-content"> landmark
- Proper <header>/<footer> semantic elements
- <section> + aria-labelledby on each card
- Tables: <caption>, scope="col" on all <th> (WCAG 1.3.1)
- Severity badges: aria-label="Severity: X", class-based color
  (not inline style) so not color-only (WCAG 1.4.1)
- Score ring: role="img" + aria-label with numeric value + grade
- Stats grid: role="group" + aria-label
- Improved contrast: stat labels #475569 not #64748b
- @media (prefers-reduced-motion) block
- Links on WCAG criterion column

report_generator.py — PDF report HTML:
- Add <title> and <meta name="description"> to <head>
- <header role="banner">, <main>, <footer> semantic elements
- Matterhorn/issues tables: <caption>, scope="col" on <th>
- Score block: role="img" + aria-label
- Stats: role="group" + aria-label
- "Not tested" text instead of "—" in status cells

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 14:25:36 +00:00
Vadym Samoilenko
97641ba56c Fix PDF report: prevent table rows splitting across pages, allow sections to flow
- tr { page-break-inside: avoid } stops issue rows from breaking mid-row
- Remove page-break-inside: avoid from .section (was causing blank half-pages
  when Matterhorn table spilled just past a page boundary)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 19:09:11 +00:00
Vadym Samoilenko
ac8aedf4a3 Implement QA report fixes: scoring, Matterhorn, dismiss, PDF report, UX
Part 1 — CSS/Contrast/Accessibility:
- Raise --text-muted contrast to WCAG AA (#696969 light, #9a9a9a dark)
- Add body font-size: 16px baseline
- Enlarge #themeToggle to 15px / 10px 20px padding

Part 2 — Start Button (user-controlled analysis):
- Upload no longer auto-starts check; shows ready state with filename/size
- New showReadyState() / removeFile() functions in upload.js
- beginCheck() now shows progress + hides ready state on click
- Add prominent "Check Another PDF" button at bottom of results

Part 3 — Scoring recalibration:
- Replace deduction formula with check-pass ratio + soft penalty (cap 20)
- Fix run_check() to only examine issues added by the current check
- Add score_breakdown (per-check table) to JSON output + results UI
- Downgrade readability ERROR → WARNING (advisory, not hard failure)

Part 4 — Auto-fix debugging:
- Remediation failure now returns up to 2000 chars of log (was 500)
- pdf_remediation.py: stderr output, sys.exit(0/1), output dir creation

Part 5 — Error location: View on Page button on each issue card

Part 6 — Matterhorn Protocol PDF/UA-1:
- _build_matterhorn_summary() maps 19 checks → 31 checkpoints
- Matterhorn card in index.html with grouped PASS/FAIL/Not-tested table
- Correct M/H badges per checkpoint

Part 7 — Dismiss / False Positive:
- dismissed_issues table in db/init.sql + dismiss/undismiss in db_manager.py
- api.php: dismiss/undismiss endpoints (file-backed), dismissed_indices
  injected into both handleStatus and handleResult responses
- results.js: dismissIssue/undismissIssue with visual strikethrough
- CSS: .dismissed, .btn-dismiss, .btn-undismiss styles

Part 8 — PDF Report (WeasyPrint):
- generate_pdf() in report_generator.py: PAC-style A4, Oliver branding
- api.php handleExport() supports format=pdf
- index.html: "PDF Report" download button in results header
- requirements.txt: weasyprint>=60.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 18:06:32 +00:00
Vadym Samoilenko
112719b2c5 Add Docker stack, frontend redesign, and visual page inspector fix
- Redesigned frontend with Outfit/Figtree typography, coral accent palette,
  noise texture, glassmorphism header, and staggered animations
- Split monolithic index.html into modular JS (app, api, upload, batch,
  results, page-viewer, utils) and extracted CSS
- Fixed worker.py to generate page images for Visual Page Inspector
- Added Docker Compose stack (web, worker, redis, postgres)
- Added batch upload, HTML report export, rate limiting, and Redis queue
- Extended test suite with checker, remediation, worker, and DB tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:12:44 +00:00