Skip to content

CLI: Remove deprecated componentSubtitle - #36129

Merged
ndelangen merged 13 commits into
refactor/automigrate-fix-filesfrom
agent/sto-111-component-subtitle
Sep 29, 2026
Merged

ndelangen merged 13 commits into
refactor/automigrate-fix-filesfrom
agent/sto-111-component-subtitle

Conversation

@valentinpalkovic

@valentinpalkovic valentinpalkovic commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #

What I did

parameters.componentSubtitle has been deprecated for a while, and the Subtitle block still fell back to it.
Storybook 11 removes that fallback.
A new component-subtitle automigration moves the value to parameters.docs.subtitle, in the preview and in story metas.

This is a real run on twentyhq/twenty's twenty-ui Storybook (1 main.ts, 1 preview.tsx, 105 story files), with componentSubtitle added to four metas, one of them built from a spread:

 const meta: Meta<typeof ButtonGroup> = {
-  parameters: { componentSubtitle: 'Injected subtitle' },
+  parameters: {
+    docs: {
+      subtitle: 'Injected subtitle',
+    },
+  },
   title: 'UI/Input/Button/ButtonGroup',

What changes for users:

  • parameters.componentSubtitle no longer renders a subtitle, and its deprecation warning is gone.
  • A docs.subtitle in the preview used to win over a componentSubtitle in a meta. After the migration the meta value wins, like any other parameter. MIGRATION.md asks users with a preview-level docs.subtitle to check their Docs pages.
  • A componentSubtitle on a single story stays where it is, since the block never read it there.

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!

  1. Generate a sandbox: yarn task sandbox --template react-vite/default-ts --start-from auto.
  2. In the sandbox, add parameters: { componentSubtitle: 'Legacy' } to the default export of .storybook/preview.ts and to the meta of one story file.
  3. In a second story file's meta, add parameters: { ...shared, componentSubtitle: 'Unsafe' }, where shared is imported from another module.
  4. Run npx storybook automigrate component-subtitle.
    Confirm that the preview and the first story file now use parameters.docs.subtitle, that the second story file is unchanged, and that the command reports 1 file that could not be migrated and points to automigrations-summary.md.
  5. Open automigrations-summary.md in the project root and confirm it lists the second story file under component-subtitle.
  6. Replace the spread in the second story file with parameters: { componentSubtitle: 'Fixed' } and run the command again.
    Confirm the second story file now uses parameters.docs.subtitle, automigrations-summary.md is gone, and the subtitles render on the Docs pages.

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

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • 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>

🤖 Generated with Claude Code

@valentinpalkovic valentinpalkovic added BREAKING CHANGE ci:normal Run our default set of CI jobs (choose this for most PRs). qa:needed Pull Requests that will need manual QA prior to release. labels Sep 2, 2026
@valentinpalkovic valentinpalkovic self-assigned this Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor
Fails
🚫

PR is not labeled with one of: ["qa:needed","qa:skip","qa:success"]

Warnings
⚠️

This PR targets refactor/automigrate-fix-files. The default branch for contributions is next. Please make sure you are targeting the correct branch.

Generated by 🚫 dangerJS against 3a8a33e

@storybook-app-bot

storybook-app-bot Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Package Benchmarks

Commit: 3a8a33e, ran on 29 September 2026 at 09:58:57 UTC

No significant changes detected, all good. 👏

@valentinpalkovic

Copy link
Copy Markdown
Contributor Author

@copilot rebase and resolve conflicts

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@copilot rebase and resolve conflicts

Merged origin/next into the branch and resolved the conflicts in merge commit 153fc6aabbf.

Comment thread MIGRATION.md Outdated
Comment thread code/lib/cli-storybook/src/automigrate/fixes/component-subtitle.ts Outdated
Comment thread code/lib/cli-storybook/src/automigrate/fixes/component-subtitle.ts Outdated
Comment thread code/lib/cli-storybook/src/automigrate/fixes/component-subtitle-transform.ts Outdated
@valentinpalkovic

Copy link
Copy Markdown
Contributor Author

CSF mutation adoption pushed at 2b798ef7b32a6a809e86adfeeff62d46ab3b2732.

  • Stacked on CSF: Add shared mutation API for stories and config files #36248 with a normal merge; no force-push.
  • Story-file mutations now use CsfFile.objects() and its formatting-preserving move, transform, and remove operations for meta, CSF2 annotations, and CSF4 stories. Preview-config precedence policy remains in this migration.
  • Added CSF2 and CSF4 regression coverage.
  • Verified: vitest run --config code/lib/cli-storybook/vitest.config.ts ...component-subtitle.test.ts ...component-subtitle-run.test.ts — 37 passed; nx check cli passed; focused oxlint passed.

@valentinpalkovic
valentinpalkovic changed the base branch from next to agent/sto-286-final-csf-diagnostics September 9, 2026 20:40
@valentinpalkovic
valentinpalkovic force-pushed the agent/sto-286-final-csf-diagnostics branch from a286c58 to 720a813 Compare September 10, 2026 21:00
@valentinpalkovic
valentinpalkovic force-pushed the agent/sto-111-component-subtitle branch from efd7548 to 4ca5e60 Compare September 11, 2026 07:16
Base automatically changed from agent/sto-286-final-csf-diagnostics to next September 14, 2026 12:18
@valentinpalkovic

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts with origin/next in merge commit 4b11ae43fd3. Focused component subtitle tests pass (45 tests).

@valentinpalkovic

valentinpalkovic commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

[AUTOMATED MESSAGE]

Component-subtitle migration: PASS for exact head 4b11ae43fd3c1edf1ad543d290a3b9931b716c10.

Both repositories upgraded through Storybook 9 and 10 to PR-built Storybook 11 packages with storybook@11.0.0-alpha.0 upgrade --yes --force --config-dir .storybook.

  • fintraffic-design/fds-coreui-components: moved 14 componentSubtitle values to parameters.docs.subtitle. Headless Chromium rendered the migrated subtitle at desktop and mobile sizes; the popover interaction showed “Popover content.”
  • excaliburjs/Excalibur: moved two subtitle values to parameters.docs.subtitle. Headless Chromium rendered the pointer-events story at desktop and mobile sizes; hover, pointer-down, and pointer-up produced distinct canvas states. Its config has no autodocs entry, so the subtitle was source-verified while the affected story was runtime-verified.

In both repositories, the installed runtime reported 11.0.0-alpha.0, no legacy subtitle keys remained, git diff --check passed, and a second automigrate component-subtitle found no applicable migration. The PR head still matched after verification.

@valentinpalkovic
valentinpalkovic marked this pull request as ready for review September 14, 2026 14:00
@valentinpalkovic
valentinpalkovic changed the base branch from next to refactor/automigrate-fix-files September 25, 2026 20:45
@valentinpalkovic
valentinpalkovic force-pushed the refactor/automigrate-fix-files branch from a0dcf12 to 6d85646 Compare September 28, 2026 07:26
@valentinpalkovic
valentinpalkovic force-pushed the agent/sto-111-component-subtitle branch from dec80a1 to 1a9799e Compare September 28, 2026 07:26
@valentinpalkovic
valentinpalkovic force-pushed the refactor/automigrate-fix-files branch from 6d85646 to 6f879d1 Compare September 28, 2026 07:30
…btitle

The Subtitle block no longer reads parameters.componentSubtitle. The new
component-subtitle automigration moves preview, meta, and story values to
parameters.docs.subtitle when it can preserve inheritance, and reports the
files it cannot migrate safely. loadAnnotationFile gives preview and story
files the same object editor, and nested paths follow a sole spread of a
single-use local object literal.
@valentinpalkovic
valentinpalkovic force-pushed the agent/sto-111-component-subtitle branch from 1a9799e to 96b69e0 Compare September 28, 2026 07:31
@valentinpalkovic valentinpalkovic added BREAKING CHANGE ci:normal Run our default set of CI jobs (choose this for most PRs). labels Sep 28, 2026
valentinpalkovic and others added 6 commits September 28, 2026 15:18
The fix now describes its edits as hooks: the preview hook migrates the
preview and records what it passes down, and the story hook migrates
each story with that inheritance. The runner reads and writes the files.

A file that cannot be migrated safely is skipped and listed in
automigrations-summary.md instead of blocking the whole migration.
Stories that depend on a preview that cannot be migrated or inspected
are skipped too, rather than migrated against unknown inheritance.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Subtitle block read `docs.subtitle || componentSubtitle` from the
preview and meta parameters only. The migration now does exactly that
move: in the preview and every meta, it moves componentSubtitle to
docs.subtitle, or drops it where docs.subtitle is already set. Files
the editor cannot change safely are skipped and reported by the runner.

This removes the cross-file inheritance checks, the story-level
migration, the upgrade version gate and its isUpgrade/beforeVersion
threading, and the csf-tools AnnotationFile and spread-following
additions, along with an unrelated Yarn1Proxy change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The runner now parses, checks diagnostics, prints, and formats, so the
fix is the move rule plus one hook for preview configs and story metas.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@valentinpalkovic
valentinpalkovic marked this pull request as ready for review September 29, 2026 09:51
@valentinpalkovic valentinpalkovic changed the title CLI: Automigrate component subtitles to docs CLI: Move component subtitles to parameter docs Sep 29, 2026
@valentinpalkovic valentinpalkovic changed the title CLI: Move component subtitles to parameter docs CLI: Remove deprecated componentSubtitle Sep 29, 2026
@ndelangen
ndelangen merged commit 85997ed into refactor/automigrate-fix-files Sep 29, 2026
157 of 161 checks passed
@ndelangen
ndelangen deleted the agent/sto-111-component-subtitle branch September 29, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING CHANGE ci:normal Run our default set of CI jobs (choose this for most PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants