lookbook-hq / lookbook

A UI development environment for Ruby on Rails apps ✨

Home Page:https://lookbook.build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pages section ordering incorrect when using order number prefix

mbuckley opened this issue · comments

Describe the bug

After upgrading Lookbook from version 1.5.5 to 2.0.0, the ordering of the pages section is not being set according to the order number integer value and instead folders are appearing in alphabetical order.

To Reproduce

Steps to reproduce the behavior:

Create this docs folder structure

spec/components/docs/
  - 01_getting_started/
    - 01_slots.md.erb
    - 02_html_attributes.md.erb
  - 02_components/
    - 01_basic_components.md.erb
    - 02_complex_components.md.erb

Expected behavior

The Pages section should sort according to the order number prefix if they exists on the folder/file names.

Expected Order

Pages

  • Getting Started
  • Components

Actual Order

Pages

  • Components
  • Getting Started

Version numbers

Please complete the following information:

  • Lookbook: 2.0.0
  • ViewComponent: 2.82.0
  • Rails: 6.1.6
  • Ruby: 2.7.6

Hey @mbuckley, thanks for letting me know - I'll look into this and try to get a fix together as soon as I can.

@mbuckley I've believe I've got a fix for this in PR #444 - I'll get it tested properly over the weekend and out in the next release. Thanks again for the heads up on this!

Thanks @allmarkedup! Congrats on the v2 release btw, looks amazing. 🎉

Thanks @mbuckley, appreciate the kind words 😊 I've merged in the PR now so it will go out in the 2.0.1 release, either today or tomorrow.

@mbuckley 2.0.1 is now out with the fix for this so I'm going to go ahead and close this down now, thanks again for your help.