Add tool to highlight ignored elements#411
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #411 +/- ##
========================================
+ Coverage 6.16% 6.54% +0.38%
========================================
Files 161 165 +4
Lines 13936 14161 +225
Branches 293 305 +12
========================================
+ Hits 859 927 +68
- Misses 13000 13155 +155
- Partials 77 79 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds “ignored regions” highlighting support to the addon by introducing preview-side annotations/decorators, a manager toolbar toggle, and packaging/build updates to ship the new preview entrypoint.
Changes:
- Add preview annotations (
src/preview.ts) that can highlight elements matching ChromaticignoreSelectorsand emit a count to the manager. - Add a manager toolbar control (
GlobalIgnoreToggle) and manager-side click handler to open docs for ignore configuration. - Extend build/package configuration to compile and export the preview entrypoint.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tsup.config.ts |
Adds previewEntries build target for browser ESM + DTS. |
src/utils/ignoreHighlight.ts |
Builds highlight options/menu from Chromatic ignore selectors and defaults. |
src/types.ts |
Adds typed globals (ignoredRegions) to addon types. |
src/screens/Authentication/Authentication.stories.tsx |
Demonstrates ignoredRegions global usage and story-level ignoreSelectors. |
src/preview.ts |
New preview decorator: applies highlight + counts matches and communicates to manager. |
src/preset.ts |
Registers previewAnnotations so Storybook loads preview annotations. |
src/manager.tsx |
Adds toolbar tool and handles “learn more” link clicks from highlight menu. |
src/index.ts |
Wires preview annotations into definePreviewAddon. |
src/dev.ts |
Ensures local dev Storybook loads preview annotations. |
src/constants.ts |
Adds event keys, ids, and default ignore selectors. |
src/components/GlobalIgnoreToggle.tsx |
New toolbar toggle showing ignored-element count and enabling highlight. |
package.json |
Adds ./preview export and bundler previewEntries. |
.storybook/preview.tsx |
Adds a default ignore selector (video) for local Storybook config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This adds a toolbar button to toggle element highlighting for Chromatic ignored elements.
Notable features:
ignoreSelectorsdefined for the story, and Chromatic's default ignore selectors.chromatic-ignoreanddata-chromatic="ignore"are supportedScreen.Recording.2026-03-18.at.09.07.19.mov