storybookjs / react-native

📓 Storybook for React Native!
https://storybook.js.org
MIT License
996 stars 141 forks source link

Customisation in manager.js #508

Closed msachi closed 10 months ago

msachi commented 10 months ago

Is your feature request related to a problem? Please describe. I'm trying to do this kind of customisation using .storybook/manager.js, but it doesn't seem to take effect: https://storybook.js.org/docs/7.2/react/configure/features-and-behavior

Describe the solution you'd like Should this be working in react-native? If not would you consider adding it?

dannyhw commented 10 months ago

There is not really a manager/preview separation on react native storybook since there's no iframe to isolate the preview.

In some ways you can consider everything the preview. What do you want to configure with this manager.js file?

msachi commented 10 months ago

Oh I see. Basically I'd like to configure some of these, e.g. whether the controls panel is open by default etc.

{
  isFullscreen: false,
  showNav: true,
  showPanel: true,
  panelPosition: 'bottom',
  enableShortcuts: true,
  showToolbar: true,
  theme: undefined,
  selectedPanel: undefined,
  initialActive: 'sidebar',
  sidebar: {
    showRoots: false,
    collapsedRoots: ['other'],
  },
  toolbar: {
    title: { hidden: false },
    zoom: { hidden: false },
    eject: { hidden: false },
    copy: { hidden: false },
    fullscreen: { hidden: false },
  },
}
dannyhw commented 10 months ago

Well most of those don't really apply though you can set the initial tab in the parameters of the getStorybookUI function

msachi commented 10 months ago

So there is no way to keep the addon panel (with controls etc) open by default?

dannyhw commented 10 months ago

yes sorry if I wasn't clear but thats what I was saying.

getStorybookUI({
    tabOpen: 1  // -- which tab should be open. -1 Sidebar, 0 Canvas, 1 Addons
})
msachi commented 10 months ago

Ah got you, thanks!

And actually what I wanted was for it to show up from the bottom, which can be achieved with isSplitPanelVisible: true.

🙌