Storybook: Have stories on each level of hierarchy

Created on 21 Aug 2017  ยท  8Comments  ยท  Source: storybookjs/storybook

This is very asked improvement from the beginning of the hierarchy feature.

Today we have this:

storiesOf('Cells/Molecules', module)
  .add('with text', () => <Button>Hello Button</Button>)
  .add('with some emoji', () => <Button>๐Ÿ˜€ ๐Ÿ˜Ž ๐Ÿ‘ ๐Ÿ’ฏ</Button>);

storiesOf('Cells/Molecules/Atoms', module)
  .add('with text2', () => <Button>Hello Button</Button>)
  .add('with some emoji2', () => <Button>๐Ÿ˜€ ๐Ÿ˜Ž ๐Ÿ‘ ๐Ÿ’ฏ</Button>);

That will be shown as

- Cells
  - Molecules                
    - with text                
    - with some emoji   
  - Molecules               
    - Atoms                   
      - with text 2
      - with some emoji 2

Desired

- Cells
  - Molecules                
    - with text                
    - with some emoji   
    - Atoms                   
      - with text 2
      - with some emoji 2

In this case we should allow stories and groups to be in the same level.

feature request inactive merged ui

Most helpful comment

I'll take it ๐Ÿ˜‰

All 8 comments

I would like us to discuss this. Do we want to implement this ? Do we want to keep it configurable ?

For example the first thing I can think about is to remove the story auto-selection when clicking the storyKind.

Yes! I ran into this problem in less than 10 minutes with Storybook. I'd also consider this as a bug and not a feature improvement. I think Storybook should merge the nested structure independent of how it is exactly defined.

However, I recognise this might not be trivial. E.g. ordering might raise questions.

I think the desired output IS clearly what everyone expects and wants us to do.
And I agree 100% that's what we want too.

Who's interesting in making a PR for this?

I'll take it ๐Ÿ˜‰

What do you think about always putting stories at the beginning ?

image

@igor-dv I'm pretty sure that's what everyone is expecting โœ…

This feature is complete and merged to the 3.3 branch

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. We do try to do some housekeeping every once in a while so inactive issues will get closed after 90 days. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zvictor picture zvictor  ยท  3Comments

sakulstra picture sakulstra  ยท  3Comments

ZigGreen picture ZigGreen  ยท  3Comments

purplecones picture purplecones  ยท  3Comments

alexanbj picture alexanbj  ยท  3Comments