#Docs ordering

9 messages · Page 1 of 1 (latest)

white sail
#

With the new tags approach to generate docs, the ordering is different from the behaviour of v6. For example in the image attached, in v6 the Default Modal would appear first and then the contained modal, but here is the opposite. The code for this story (shortened to fit the message):

import { ComponentProps, useState } from 'react';
import { StoryFn, Meta } from '@storybook/react';
import { Modal, Button, DragAndDrop } from '@neo4j-ndl/react/src';
import isChromatic from 'chromatic';

export default {
  title: 'UIComponents/Modal',
  decorators: [(storyFn) => <div style={{ height: '800px' }}>{storyFn()}</div>],
  tags: ['docsPage'],
  component: Modal,
  parameters: {
    chromatic: { delay: 100 },
  },
} as Meta;

const Template: StoryFn<ComponentProps<typeof Modal>> = (args) => {
  ......
};

export const DefaultModal = Template.bind({});
DefaultModal.args = {};

const ContainedModalTemplate: StoryFn<ComponentProps<typeof Modal>> = (
  args
) => {
  ....
};

export const ContainedModal = ContainedModalTemplate.bind({});
ContainedModal.args = {};
silent venture
#

Is the order reversed in the DocsPage only? Or in both the DocsPage AND the sidebar?

white sail
#

@silent venture sidebar order seems correct at least in many examples I watched

silent venture
white sail
#

thanks @silent venture

viscid hill
#

Hi, I'm still having a problem with this with v7. Anytime I have a story starting with A,B,C it shows up on the Docs page (and sidebar) before the Default story (from v6). What is the correct thing to do now? I really don't want alphabetical order and would prefer to keep the order they are written/exported in the stories file

silent venture
viscid hill
#

Sure thing!

viscid hill
#

Looks like I finally figured it out, as part of migration from 6.x to 7.0 the features.storyStorev7 is set to false and with that they sorted alphabetically. Removing that entry appears to fix it.