fix(CookieConsent): add comprehensive Storybook controls#52
Merged
garrity-miepub merged 1 commit intomainfrom Feb 3, 2026
Merged
fix(CookieConsent): add comprehensive Storybook controls#52garrity-miepub merged 1 commit intomainfrom
garrity-miepub merged 1 commit intomainfrom
Conversation
- Add argTypes for all controllable props including showDecline and showCustomize - Add boolean controls for isVisible, showDecline, showCustomize, isMobileApp - Add text controls for message, acceptText, declineText, customizeText, appName - Add select controls for position and variant (already existed, now with descriptions) - Disable controls for complex link props (termsLink, privacyLink, cookieLink) - Add action handlers for onAccept, onDecline, onCustomize callbacks - Add default args at meta level with sensible defaults - Add Playground story for easy testing of all controls - Clean up existing stories to remove redundant args that are inherited from meta - Remove inline onAccept handlers that were overriding action handlers The showDecline and showCustomize controls now work properly in the Storybook Controls panel, allowing dynamic toggling of these buttons.
There was a problem hiding this comment.
Pull request overview
This PR enhances the CookieConsent Storybook configuration by adding comprehensive controls for all component props, enabling dynamic testing of the cookie consent banner through Storybook's Controls panel.
Changes:
- Added comprehensive argTypes for all CookieConsent props with appropriate control types (boolean, text, select) and descriptions
- Configured action handlers for callback props (onAccept, onDecline, onCustomize) to enable event tracking in Storybook
- Added sensible default args at the meta level to reduce duplication across stories
- Introduced a new Playground story for interactive testing of all controls
- Cleaned up individual stories by removing redundant args that now inherit from meta defaults
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The showDecline and showCustomize controls now work properly in the Storybook Controls panel, allowing dynamic toggling of these buttons.
cookie-consent-updates.mov