Skip to content

CLI: Skip AI prompts in React Native during init#34577

Merged
yannbf merged 2 commits into
project/sb-agentic-setupfrom
yann/skip-ai-in-react-native
Apr 17, 2026
Merged

CLI: Skip AI prompts in React Native during init#34577
yannbf merged 2 commits into
project/sb-agentic-setupfrom
yann/skip-ai-in-react-native

Conversation

@yannbf
Copy link
Copy Markdown
Member

@yannbf yannbf commented Apr 17, 2026

Closes #

What I did

As title says

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

Caution

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 publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Improvements

    • AI-assisted setup now takes detected framework into account, improving accuracy of feature availability.
    • Support checks updated to exclude specific framework combinations from AI-powered setup.
  • Bug Fixes

    • More robust onboarding cache cleanup to reduce rare failure modes during startup.
  • Tests

    • Expanded test coverage for AI setup compatibility across additional framework scenarios.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 17, 2026

View your CI Pipeline Execution ↗ for commit fe2b0c9

Command Status Duration Result
nx run-many -t compile,check,knip,test,lint,fmt... ✅ Succeeded 8m 44s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-17 11:10:06 UTC

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 17, 2026

View your CI Pipeline Execution ↗ for commit 26094d3


☁️ Nx Cloud last updated this comment at 2026-04-17 07:38:48 UTC

1 similar comment
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 17, 2026

View your CI Pipeline Execution ↗ for commit 26094d3


☁️ Nx Cloud last updated this comment at 2026-04-17 07:38:48 UTC

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2973f94-c2ae-42e3-9282-38e43b9b4c9f

📥 Commits

Reviewing files that changed from the base of the PR and between 26094d3 and fe2b0c9.

📒 Files selected for processing (1)
  • code/core/src/core-server/build-dev.ts
✅ Files skipped from review due to trivial changes (1)
  • code/core/src/core-server/build-dev.ts

📝 Walkthrough

Walkthrough

Updated AI setup compatibility to be framework-aware: supportsAISetupFeature now accepts a framework argument and explicitly disallows AI-assisted setup for REACT_NATIVE_WEB_VITE. Call site and tests updated; a small error-handling change replaces a .catch() chain with a try/catch in onboarding cache removal.

Changes

Cohort / File(s) Summary
FeatureCompatibilityService
code/lib/create-storybook/src/services/FeatureCompatibilityService.ts
Signature changed to `supportsAISetupFeature(renderer, builder, framework: SupportedFramework
Call Site
code/lib/create-storybook/src/initiate.ts
Updated call to FeatureCompatibilityService.supportsAISetupFeature to pass framework as third argument.
Tests
code/lib/create-storybook/src/services/FeatureCompatibilityService.test.ts
Updated tests to include SupportedFramework argument; added negative cases for null and REACT_NATIVE_WEB_VITE.
Onboarding cache cleanup
code/core/src/core-server/build-dev.ts
Replaced .catch(() => {}) on cache.remove('onboarding-pending') with try { await cache.remove(...); } catch {} for error suppression.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
code/lib/create-storybook/src/services/FeatureCompatibilityService.test.ts (1)

78-94: Add one explicit REACT + VITE + null assertion to lock nullable-framework semantics.

This makes intended behavior for unknown framework explicit and protects against regressions in future refactors.

Proposed test addition
   it('should return false for non-react renderer with non-vite builder', () => {
@@
       ).toBe(false);
     });
 
+    it('should keep AI setup enabled for react renderer with vite builder when framework is null', () => {
+      expect(
+        FeatureCompatibilityService.supportsAISetupFeature(
+          SupportedRenderer.REACT,
+          SupportedBuilder.VITE,
+          null
+        )
+      ).toBe(true);
+    });
+
     it('should return false for react-native-web-vite framework', () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@code/lib/create-storybook/src/services/FeatureCompatibilityService.test.ts`
around lines 78 - 94, Add an explicit test assertion that verifies the nullable
framework case for React with Vite: in the test file add an expect calling
FeatureCompatibilityService.supportsAISetupFeature(SupportedRenderer.REACT,
SupportedBuilder.VITE, null) and assert the intended boolean (true) to lock the
semantics for REACT + VITE + null; reference the existing test pattern around
FeatureCompatibilityService.supportsAISetupFeature, SupportedRenderer,
SupportedBuilder, and SupportedFramework when adding this new assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@code/lib/create-storybook/src/services/FeatureCompatibilityService.test.ts`:
- Around line 78-94: Add an explicit test assertion that verifies the nullable
framework case for React with Vite: in the test file add an expect calling
FeatureCompatibilityService.supportsAISetupFeature(SupportedRenderer.REACT,
SupportedBuilder.VITE, null) and assert the intended boolean (true) to lock the
semantics for REACT + VITE + null; reference the existing test pattern around
FeatureCompatibilityService.supportsAISetupFeature, SupportedRenderer,
SupportedBuilder, and SupportedFramework when adding this new assertion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f63b307-e4a4-4f08-870e-945b7ec781c8

📥 Commits

Reviewing files that changed from the base of the PR and between 047c282 and 26094d3.

📒 Files selected for processing (3)
  • code/lib/create-storybook/src/initiate.ts
  • code/lib/create-storybook/src/services/FeatureCompatibilityService.test.ts
  • code/lib/create-storybook/src/services/FeatureCompatibilityService.ts

@yannbf yannbf merged commit 9a43d2c into project/sb-agentic-setup Apr 17, 2026
125 checks passed
@yannbf yannbf deleted the yann/skip-ai-in-react-native branch April 17, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants