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

Alphabetize documentation sidenav elements #5080

Merged
merged 5 commits into from May 7, 2024

Conversation

jmuzina
Copy link
Member

@jmuzina jmuzina commented May 6, 2024

Done

@bartaz noticed today that the ordering of items in the side-nav is not alphabetical (as he was expecting it to be). This PR alphabetizes the sidenav items by title using Python, hopefully eliminating the tech debt of manually ensuring the nav items are alphabetized and preventing this sort of issue from arising in the future.

This is configurable in side-navigation.yaml so that only nav items with ordering: alphabetical have their subheadings sorted (since there are still some cases where we want fine-grain control over subheading order, such as "Welcome".

This results in a few changes to the sidenav ordering vs our current setup:

  • Base elements
    • "Paper background" moved to the end
  • Components
    • "Equal height row" moved to after "Empty state"
  • Utilities
    • "Show" moved to after "Padding collapse"
  • Resources
    • "Download Sketch UI Kit" moved to after "Component examples"

Closes WD-11052

QA

  • Open demo
  • Verify that the subheadings within all side-nav sections except "Welcome" are alphabetized.

Check if PR is ready for release

If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 🎁, Breaking Change 💣, Bug 🐛, Documentation 📝, Maintenance 🔨.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention:
    • if CSS class names are not changed it can be bugfix relesase (x.x.X)
    • if CSS class names are changed/added/removed it should be minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) should be listed on the what's new page.

@webteam-app
Copy link

@jmuzina jmuzina requested a review from bartaz May 6, 2024 20:05
url: /docs/base/typography
- title: Paper background
url: /docs/base/paper
ordering: alphabetical
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work if we move ordering up one level (alongside heading and subheadings, to avoid additional nesting level of items)?

@bartaz
Copy link
Contributor

bartaz commented May 7, 2024

Just a little question/suggestion on the yaml structure, but otherwise great idea. Thanks for the sort implementation.

@@ -106,6 +108,7 @@
url: /docs/patterns/tabs
- title: Tooltips
url: /docs/patterns/tooltips
ordering: alphabetical
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small thing, but I'd suggest moving ordering up under heading, so it's clearer what it applies to.

So like:

- heading: Components
  ordering: alphabetical
  subheadings:
    … 

Copy link
Member Author

@jmuzina jmuzina May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordering has been moved accordingly @bartaz

@jmuzina jmuzina force-pushed the sidenav-alphabetical-order branch from c1fe3ca to 590c9d1 Compare May 7, 2024 15:04
Copy link
Contributor

@bartaz bartaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, this is a great improvement!

@bartaz bartaz merged commit ff6325f into canonical:main May 7, 2024
5 checks passed
@jmuzina jmuzina deleted the sidenav-alphabetical-order branch May 7, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants