Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 21, 2025

This PR adds a new --graph-report CLI flag that generates an interactive expandable tree visualization of API test coverage alongside the existing tabular HTML report.

🎯 Problem Solved

The existing HTML report provides detailed tabular coverage information but lacks a visual overview that makes it easy to quickly understand coverage patterns and relationships between API endpoints. Users needed a hierarchical visualization to:

  • Quickly identify uncovered API endpoints at a glance
  • Understand relationships between related endpoints in a structured way
  • Get a visual overview of overall coverage health with logical grouping

🚀 Solution

Added a new optional --graph-report flag that generates a separate interactive HTML report featuring:

Modern CSS-Only Tree Visualization

  • Hierarchical Structure: APIs → Tags → Paths → Individual Endpoints
  • Expandable Nodes: Click any node to expand/collapse its children
  • Color Coding:
    • 🟢 Green: Fully covered endpoints
    • 🟠 Orange: Partially covered endpoints
    • 🔴 Red: Not covered endpoints
    • 🔵 Blue: Group nodes (tags, paths)

Enhanced UX & Readability Features

  • Modern Design System: Professional gradient header with glassmorphism effect
  • No External Dependencies: Self-contained solution that works offline and in restricted environments
  • Method Badges: Color-coded HTTP method badges (GET=green, POST=blue, DELETE=red, etc.)
  • Smart Filtering: New filter buttons for "Show Covered", "Show Uncovered", "Show All"
  • Enhanced Controls: Emoji-enhanced buttons with hover animations
  • Mobile Responsive: Optimized for all screen sizes with responsive grid layouts
  • Fast Performance: Instant loading without external CDN dependencies

Interactive Features

  • Tree Controls: "Expand All", "Collapse All" buttons with intuitive emoji icons
  • Click to Expand/Collapse: Interactive node expansion for focused exploration
  • Coverage Statistics: Real-time counters showing covered vs uncovered items in each group
  • Test Count Display: Shows number of tests per endpoint
  • Status Indicators: Clear visual status dots for each endpoint
  • Smooth Animations: CSS transitions for professional interaction feedback

Smart Organization

  • Multi-API Support: Groups by API name when multiple specifications are analyzed
  • Tag-based Grouping: Secondary organization by OpenAPI tags
  • Path Grouping: Groups endpoints by base path for logical clustering
  • Leaf Endpoints: Individual operations as terminal nodes with full coverage details
  • Hierarchical Icons: Intuitive emoji icons (🌳 root, 🔗 API, 🏷️ tags, 📁 paths)

📊 Usage

# Generate both regular and tree reports
swagger-coverage-cli --graph-report api-spec.yaml postman-collection.json

# Creates two files:
# - coverage-report.html (existing tabular report)
# - coverage-report-graph.html (new interactive expandable tree)

🔧 Implementation Details

The implementation follows the existing codebase patterns and is fully backward compatible:

  • Minimal Changes: Only modified core files (cli.js, lib/report.js) without breaking existing functionality
  • Optional Feature: Regular report generation unchanged when flag not used
  • Comprehensive Testing: Added unit and integration tests, all 164 tests pass
  • Clean Architecture: New generateGraphHtmlReport() function mirrors existing generateHtmlReport() structure
  • Hierarchical Data Structure: Smart algorithm organizes endpoints into logical tree hierarchy
  • Self-Contained: No external dependencies, works in sandboxed environments

📈 Screenshot

Enhanced Tree Report Visualization

The screenshot shows the dramatically improved interface with professional gradient header, metadata cards, enhanced controls with filtering options, hierarchical tree structure with intuitive icons, color-coded HTTP method badges, and clear coverage statistics.

✅ Testing

  • Added comprehensive unit tests for the new tree report generator
  • Added integration tests verifying CLI flag behavior with tree structure
  • Verified end-to-end functionality with real API specifications
  • All existing tests continue to pass, ensuring no regressions
  • Validated hierarchical data structure and expand/collapse functionality
  • Tested cross-browser compatibility and mobile responsiveness

This enhancement provides users with a powerful hierarchical visual tool to quickly assess API coverage health with modern UX patterns and enhanced readability, while maintaining full backward compatibility with existing workflows. The self-contained implementation works reliably without external dependencies and provides significantly better user experience than traditional graph layouts.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits September 21, 2025 12:44
Co-authored-by: dreamquality <130073078+dreamquality@users.noreply.github.com>
Co-authored-by: dreamquality <130073078+dreamquality@users.noreply.github.com>
…testing

Co-authored-by: dreamquality <130073078+dreamquality@users.noreply.github.com>
Copilot AI changed the title [WIP] Add a new CLI flag --graph-report to swagger-coverage-cli that, when enabled, generates a separate graph schema of API test coverage with nodes (endpoints/operations), edges (dependencies), and color-coded status (green = covered, yellow = partially co... Add --graph-report CLI flag for interactive API coverage visualization Sep 21, 2025
Copilot AI requested a review from dreamquality September 21, 2025 12:52
@dreamquality
Copy link
Owner

@copilot improve graph schema to be expandable tree

…rganization

Co-authored-by: dreamquality <130073078+dreamquality@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 21, 2025

@copilot improve graph schema to be expandable tree

✅ Improved! Changed the graph schema from a force-directed layout to an expandable tree structure. The new tree organizes API endpoints hierarchically (APIs → Tags → Paths → Endpoints) with click-to-expand/collapse functionality and tree control buttons (Expand All, Collapse All, Center View).

The tree provides much better organization and navigation for large API specifications compared to the previous graph layout.

Tree Report

Commit: 2581ebf

Copilot AI changed the title Add --graph-report CLI flag for interactive API coverage visualization Add --graph-report CLI flag for interactive API coverage tree visualization Sep 21, 2025
@dreamquality
Copy link
Owner

@copilot improve readability an UX
image

Co-authored-by: dreamquality <130073078+dreamquality@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 21, 2025

@copilot improve readability an UX
image

✅ Significantly improved readability and UX! Completely redesigned with:

🚀 Major Improvements:

  • No External Dependencies: Removed D3.js, works offline/sandboxed
  • Modern Design: Professional gradient header with glassmorphism cards
  • Enhanced Readability: Better typography, contrast, and visual hierarchy
  • Method Badges: Color-coded HTTP methods (GET=green, POST=blue, etc.)
  • Smart Filtering: New buttons to show only covered/uncovered endpoints
  • Mobile Responsive: Works perfectly on all screen sizes
  • Faster Loading: Instant rendering without CDN dependencies

The tree now shows actual hierarchical structure with expandable nodes, coverage statistics, and professional styling.

Enhanced Tree Visualization

Commit: ea7be7f

Copilot AI changed the title Add --graph-report CLI flag for interactive API coverage tree visualization Add --graph-report CLI flag for modern API coverage tree visualization with enhanced UX Sep 21, 2025
@dreamquality dreamquality added the invalid This doesn't seem right label Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants