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

Sidebar customisation improvements #556

Merged
merged 6 commits into from
Nov 23, 2023
Merged

Sidebar customisation improvements #556

merged 6 commits into from
Nov 23, 2023

Conversation

allmarkedup
Copy link
Collaborator

@allmarkedup allmarkedup commented Nov 22, 2023

This PR adds config options to:

  • Customise the order of the nav panels in the sidebar
  • Hide or show the search/filter box for both previews and pages

Sidebar panel order

This PR adds a preview_inspector.sidebar_panels config option that allows for the reordering (or omitting) of section panels in the Lookbook sidebar.

config.lookbook.preview_inspector.sidebar_panels = [:pages, :previews]

The default value is [:previews, :pages]. Documentation here

Search/filter inputs

This PR adds preview_search and page_search config options to hide or show the filter box UI for previews and pages respectively.

config.lookbook.preview_search = false # default: true 
config.lookbook.page_search = true # default: false

For backwards compatibility preview search is enabled by default, but pages search is not.

Documentation for pages and previews.

Copy link

netlify bot commented Nov 22, 2023

Deploy Preview for lookbook-docs canceled.

Name Link
🔨 Latest commit 8430db4
🔍 Latest deploy log https://app.netlify.com/sites/lookbook-docs/deploys/655e68e1be9f4e0008b4bf3d

@cody-clio
Copy link

@allmarkedup I've pulled the gem locally, and I can see that the section configuration is working, but I do not see the search appearing.

Configuration setup:

config.lookbook.preview_inspector.sidebar_panels = [:pages, :previews]
config.lookbook.preview_search = true
config.lookbook.page_search = true

Even if I disable all the configurations, I'm not seeing the search show up any longer:

Screenshot 2023-11-22 at 10 01 41 AM

@allmarkedup
Copy link
Collaborator Author

@cody-clio argh sorry, my bad, I was rushing things to get the PR up before I had to head out and made a stupid typo. Should be fixed now!

@cody-clio
Copy link

Looks great! Thanks for making these changes! Excited to use them.

Screenshot 2023-11-22 at 1 51 37 PM

@allmarkedup
Copy link
Collaborator Author

@cody-clio Awesome, thanks for the feature requests that prodded me into action :) I'll merge this now and hopefully get a new release out in the next day or two.

@allmarkedup allmarkedup merged commit 044508a into main Nov 23, 2023
20 checks passed
@allmarkedup allmarkedup deleted the page-search branch November 23, 2023 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants