Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control the order of sidebar folders #125

Open
pmackay opened this issue Aug 27, 2022 · 3 comments
Open

Control the order of sidebar folders #125

pmackay opened this issue Aug 27, 2022 · 3 comments
Labels
feature request A suggestion for a feature or enhancement

Comments

@pmackay
Copy link

pmackay commented Aug 27, 2022

Is there any way to configure the order of sidebar folders? So to order by small to large, my preference would be:

  • Elements
  • Components

but the current alphabetical ordering gives:

  • Components
  • Elements
@allmarkedup
Copy link
Collaborator

Hi @pmackay, no I'm afraid at the moment there isn't :-(

It would definitely be a useful feature though and really the only reason it is not in there is because I haven't been able to think of a nice way to implement it.

It's possible to control the order of 'pages' directories by using a prefix on the folder name. But that won't work for previews because it would mess with the Rails autoloading/namespacing mechanism.

Have you got any thoughts on how you'd like to see something like this implemented? I guess it could be done with a configuration array of folder names but it seems pretty ugly to have to keep that manually in sync with the filesystem.

@allmarkedup allmarkedup added the feature request A suggestion for a feature or enhancement label Aug 27, 2022
@allmarkedup
Copy link
Collaborator

Actually, now that you have got me thinking about it again I'm wondering if using a tag annotation (like @position) at the module level could work somehow... I might try to explore that a bit when I get a chance :-)

@pmackay
Copy link
Author

pmackay commented Aug 28, 2022

A tag annotation sounds great. I've used sort_by with an array of different method calls inside the block to sort against. So could sort by position first, then by name/label?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A suggestion for a feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants