Skip to content

fix(visualizer): export an audit with a rating and no value as an audit - #435

Merged
nucliweb merged 1 commit into
mainfrom
fix/visualizer-markdown-export
Nov 14, 2026
Merged

nucliweb merged 1 commit into
mainfrom
fix/visualizer-markdown-export

Conversation

@nucliweb

Copy link
Copy Markdown
Owner

Summary

Copy as Markdown of the visualizer treated every result with a rating as a metric. An audit such as Script-Loading, which has a rating and no value, came out as a heading with undefined and none of its issues or items, and a result whose unit is a score threw before copying anything.

  • The export picks its format with detectRenderer, as the page picks its view.
  • detectRenderer moves from index.jsx to its own module, so that the export can import it.
  • A result the page shows as JSON is exported as JSON instead of "No issues found".

Test plan

  • Failing test first: 7 failures before the fix, among them ## Script-Loading — undefined ⚠️ needs-improvement.
  • npm run test:components locally: 298 of 298. One case exports the 114 result fixtures and fails on any undefined or NaN.
  • npm run lint locally.
  • In Chromium (Playwright) against a local dev server, on /visualizer: pasted four results, clicked Copy as Markdown and read the clipboard, with no page errors. Script-Loading comes with its 2 issues and its table of 3 items, CLS as ## CLS — 0.0638 ✅ good, a score without a value copies, and a result with neither issues nor items comes as a JSON block.

Copy as Markdown treated every result with a rating as a metric, so an audit such as Script-Loading came out as a heading with "undefined" and none of its issues or items, and a result whose unit is a score threw before copying anything.

The export picks its format with detectRenderer, as the page picks its view. detectRenderer moves to its own module so that the export can import it. A result the page shows as JSON is exported as JSON instead of "No issues found".

The tests export the 114 result fixtures and fail on any "undefined" or "NaN".
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
webperf-snippets Ready Ready Preview Nov 14, 2026 5:30pm UTC

@nucliweb
nucliweb merged commit 6780e51 into main Nov 14, 2026
13 checks passed
@nucliweb
nucliweb deleted the fix/visualizer-markdown-export branch November 14, 2026 20:49

This branch was successfully deployed

1 active deployment
Preview — cf0ad6a4 Deployed Nov 14, 2026 by vercel[bot]
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