Skip to content

Conversation

@yannbf
Copy link
Member

@yannbf yannbf commented Jul 23, 2025

  • Updated the automigration prompt logic to utilize 'defaultSelected' instead of 'promptDefaultValue' for better clarity.
  • Adjusted related files to ensure consistent usage of the new property across automigration fixes.
  • Removed unnecessary imports of 'picocolors' in specific fix files to streamline the code.

Closes #

What I did

When running via storybook upgrade, the automigration is deselected
image

When running via storybook automigrate, "No" is selected
image


Additionally I set clack as prompt library for storybook automigrate:
image

otherwise it looks really bad
image

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make 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/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

Greptile Summary

This PR introduces a new defaultSelected property to the automigration system to provide more granular control over which automigrations are pre-selected when users run Storybook upgrade commands.

The key changes include:

  1. Property Rename: Replaces the confusing promptDefaultValue property with the more intuitive defaultSelected property across the automigration system
  2. Improved User Experience: When running storybook upgrade, automigrations are now deselected by default, while storybook automigrate defaults to "No" - giving users more control over potentially disruptive changes
  3. Granular Control: Individual automigration fixes can now specify whether they should be selected by default using defaultSelected: false (as demonstrated in the upgrade-storybook-related-dependencies fix)
  4. UI Enhancement: Switches the prompt library to 'clack' for the automigrate command to improve visual presentation
  5. Code Cleanup: Removes unused picocolors imports from several automigration fix files

The change integrates with Storybook's existing automigration infrastructure by updating the BaseFix type definition, modifying the prompt logic in both single-project and multi-project scenarios, and maintaining backward compatibility by defaulting to true when the property is not specified. This allows the system to distinguish between different upgrade contexts and provide appropriate default behaviors for each.

Confidence score: 4/5

  • This PR appears safe to merge with well-structured changes that improve the user experience
  • The implementation maintains backward compatibility and follows established patterns in the codebase
  • The multi-project.ts file needs careful testing to ensure the new filtering logic works correctly across different project configurations

- Updated the automigration prompt logic to utilize 'defaultSelected' instead of 'promptDefaultValue' for better clarity.
- Adjusted related files to ensure consistent usage of the new property across automigration fixes.
- Removed unnecessary imports of 'picocolors' in specific fix files to streamline the code.
@yannbf yannbf self-assigned this Jul 23, 2025
@yannbf yannbf added maintenance User-facing maintenance tasks cli ci:normal labels Jul 23, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@nx-cloud
Copy link

nx-cloud bot commented Jul 23, 2025

View your CI Pipeline Execution ↗ for commit 8e94783

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 16s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-23 15:35:48 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal cli maintenance User-facing maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants