Skip to content

Conversation

Sidnioulz
Copy link
Member

@Sidnioulz Sidnioulz commented Aug 29, 2025

Closes #14442

What I did

Added the same API endpoint for the addon panel as for the sidebar and toolbar, so it can be hidden for specific stories.

This makes sense for documentation workflows, for kitchen sink stories where all variants are grouped together, and for some real-world showcase stories with fixed args.

Checklist for Contributors

Testing

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

Caution

Not automatically tested. Same as for showSidebar and showToolbar, we no longer have good examples on how to test the whole manager UI with a mocked API like we had in SB 7.

Manual testing

  1. Add the following to code/.storybook/manager.tsx:
addons.setConfig({
  layoutCustomisations: {
    showPanel(state, defaultValue) {
      const tags = state.index?.[state.storyId]?.tags ?? [];

      if (tags.includes('showcase')) {
        return false;
      }

      return defaultValue;
    },
  },
});
  1. Add the 'autodocs' tag to code/core/src/components/components/IconButton/IconButton.stories.tsx on line 12
  2. Go to http://localhost:6006/?path=/story/components-iconbutton--types
  3. Notice the addon panel is hidden!

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>

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, 2 comments

Edit Code Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Aug 29, 2025

View your CI Pipeline Execution ↗ for commit 469bc63

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

☁️ Nx Cloud last updated this comment at 2025-09-05 12:42:43 UTC

@Sidnioulz Sidnioulz force-pushed the sidnioulz/issue-14442-showAddonPanel branch from f4da5bc to 8866976 Compare August 29, 2025 06:52
@Sidnioulz Sidnioulz changed the base branch from next to a11y-consolidation September 5, 2025 12:46
@Sidnioulz Sidnioulz changed the base branch from a11y-consolidation to next September 5, 2025 12:47
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.

Is there a way to hide the panel on a story basis rather than in the global settings?
2 participants