storybook-design-token icon indicating copy to clipboard operation
storybook-design-token copied to clipboard

Disabling addon panel does not work

Open bronzehedwick opened this issue 2 years ago • 8 comments

Hello,

I've copied the code to disable the addon panel into ./storybook/preview.js as it appears in the documentation:

const preview = {
  parameters: {
    designToken: { disable: true },
  }
}

However, the Design Tokens panel still appears on Stories.

Using version 3.0.0-beta.3 of this plugin, and Storybook version 7.4.2.

Thanks!

bronzehedwick avatar Sep 27 '23 12:09 bronzehedwick

I've seen the same in 3.0.0-beta.5.

laddi-netapp avatar Sep 27 '23 13:09 laddi-netapp

Same for 3.0.0-beta.6 here!

julrich avatar Oct 07 '23 21:10 julrich

Any fix coming for this @Sqrrl ?

atomicrobokid avatar Oct 24 '23 08:10 atomicrobokid

It seems to be an issue with the preview.js not exporting the object. I've adjusted the README accordingly. Adding export default preview; to your preview.js should fix it.

Sqrrl avatar Nov 09 '23 12:11 Sqrrl

Disabling the panel works in 3.0.0-beta.7 with export default preview (I did not try previous versions).
But I get an anoying warning in the browser console:

Warning: The final argument passed to useMemo changed size between renders. The order and size of this array must remain constant.

Previous: [addon-controls, addon-controls, storybook/actions/panel, storybook-design-token/panel, storybook/interactions/panel]
Incoming: [addon-controls, addon-controls, storybook/actions/panel, storybook/interactions/panel]

I made a short screen capture. As you can see, the "Design Tokens" Tab is initially visible and disappears immediately.

https://github.com/UX-and-I/storybook-design-token/assets/31414552/5620d72f-97d3-4ede-acfc-1520002ef288

lmestel avatar Nov 22 '23 15:11 lmestel

Disabling the panel works in 3.0.0-beta.7 with export default preview (I did not try previous versions). But I get an anoying warning in the browser console:

Warning: The final argument passed to useMemo changed size between renders. The order and size of this array must remain constant.

Previous: [addon-controls, addon-controls, storybook/actions/panel, storybook-design-token/panel, storybook/interactions/panel]
Incoming: [addon-controls, addon-controls, storybook/actions/panel, storybook/interactions/panel]

I made a short screen capture. As you can see, the "Design Tokens" Tab is initially visible and disappears immediately.

storybook-design-token.mov

I've seen the same behaviour in previous beta versions as well, very annoying...

laddi-netapp avatar Nov 23 '23 09:11 laddi-netapp

Seeing the same useMemo error. Is there a bug raised for this somewhere I can track / possibly contribute please?

mattmogford-alcumus avatar Nov 28 '23 11:11 mattmogford-alcumus

Seeing the same useMemo error. Is there a bug raised for this somewhere I can track / possibly contribute please?

https://github.com/UX-and-I/storybook-design-token/issues/186

Sqrrl avatar Nov 28 '23 11:11 Sqrrl