Build: Add withAdeMode decorator#34781
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a global Storybook decorator ChangesADE Mode Storybook Integration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@code/.storybook/withAdeMode.tsx`:
- Line 1073: Remove the raw console.log({ mode }) from the decorator render path
in withAdeMode (the decorator function that reads the mode variable); either
delete that line or replace it with Storybook's client logger (importing from
'@storybook/client-logger' and using logger.info/logger.log) so logging follows
Storybook guidelines and does not use console directly.
In `@code/core/src/manager/index.stories.tsx`:
- Around line 205-209: Add a play function to the InAdeSession story (const
InAdeSession = meta.story) that performs the same interaction/assertion pattern
used by the other stories: implement an async play({ canvasElement, step,
userEvent, within, expect }) that queries the rendered component in the canvas,
simulates any required user interactions (via userEvent) and asserts expected UI
state or accessibility attributes (via expect/within) to validate ADE mode
rendering; ensure the play function is attached to the story object passed to
meta.story so it runs during Storybook play mode and follows the same testing
utilities and assertions used by the other stories in this file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 302ee6ca-d201-4801-b4bd-cd78f4174d15
📒 Files selected for processing (3)
code/.storybook/preview.tsxcode/.storybook/withAdeMode.tsxcode/core/src/manager/index.stories.tsx
Closes #
What I did
This PR adds a decorator to help us understand how a component would look like in an ADE-like environment, using a global toolbar:
And looking like this:
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit