Refactor html report to use robust sitegraph template#20
Conversation
- 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.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- 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.
This PR addresses a code health issue in
plugins/core/src/report/html.tsby consolidating the graph visualization logic.Previously,
generateHtmlcontained a simplified, inline D3 implementation that duplicated logic found inplugins/core/src/report/sitegraph_template.ts. This PR refactorsgenerateHtmlto useSITEGRAPH_HTMLfrom the template file, ensuring a single, robust implementation is used across the codebase.Key changes:
generateHtmlnow injectsgraphDataandmetricsintoSITEGRAPH_HTML.htmlproperty is removed from nodes in the injected data to keep the report lightweight, similar to how the CLI export handles it.plugins/core/tests/html_report.test.tsare updated to verify that the template and data are correctly injected.PR created automatically by Jules for task 4622851668163800598 started by @saurabhsharma2u