Skip to content

Refactor html report to use robust sitegraph template#20

Merged
saurabhsharma2u merged 2 commits into
mainfrom
refactor/consolidate-html-report-4622851668163800598
Feb 25, 2026
Merged

Refactor html report to use robust sitegraph template#20
saurabhsharma2u merged 2 commits into
mainfrom
refactor/consolidate-html-report-4622851668163800598

Conversation

@saurabhsharma2u

Copy link
Copy Markdown
Contributor

This PR addresses a code health issue in plugins/core/src/report/html.ts by consolidating the graph visualization logic.

Previously, generateHtml contained a simplified, inline D3 implementation that duplicated logic found in plugins/core/src/report/sitegraph_template.ts. This PR refactors generateHtml to use SITEGRAPH_HTML from the template file, ensuring a single, robust implementation is used across the codebase.

Key changes:

  • generateHtml now injects graphData and metrics into SITEGRAPH_HTML.
  • The html property is removed from nodes in the injected data to keep the report lightweight, similar to how the CLI export handles it.
  • Tests in plugins/core/tests/html_report.test.ts are updated to verify that the template and data are correctly injected.
  • Frontend verification was performed, confirming the new report renders correctly.

PR created automatically by Jules for task 4622851668163800598 started by @saurabhsharma2u

- Consolidate visualization logic by reusing SITEGRAPH_HTML in generateHtml.
- Remove duplicated D3 visualization code.
- Ensure graph data is sanitized (remove html property) before injection.
- Update tests to verify data injection instead of legacy HTML structure.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@saurabhsharma2u
saurabhsharma2u marked this pull request as ready for review February 25, 2026 15:04
saurabhsharma2u added a commit that referenced this pull request Feb 25, 2026
- Consolidate visualization logic by reusing SITEGRAPH_HTML in generateHtml.
- Remove duplicated D3 visualization code.
- Ensure graph data is sanitized (remove html property) before injection.
- Update tests to verify data injection instead of legacy HTML structure.
@saurabhsharma2u
saurabhsharma2u merged commit 5bbe055 into main Feb 25, 2026
6 checks passed
@saurabhsharma2u
saurabhsharma2u deleted the refactor/consolidate-html-report-4622851668163800598 branch February 25, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant