railsdevs.com icon indicating copy to clipboard operation
railsdevs.com copied to clipboard

Integrate Lookbook for admin components

Open joemasilotti opened this issue 2 years ago • 6 comments

More and more View Components have been added to the Admin:: namespace the past few weeks. I'd love to be able to preview them on their own and together as a page. This could be especially helpful for new folks to the project as they can see examples without diving into code.

A PR addressing this issue should:

  • [ ] Integrate the Lookbook gem in development
  • [ ] Add fully implemented previews for Admin::ListComponent, Admin::Tables::TableComponent, and Admin::Forms::ContainerComponent
  • [ ] Add 2-3 individual component previews

Please don't add all the component previews in this PR. This will be a pressure test of how Lookbook works, is integrated, and what we can customize. Then we can go back and add the rest when we are sure it's the right path!

Also, I'm not interested in the experimental pages feature (yet). For now the 3 "component" previews could be under a "Pages" folder.

joemasilotti avatar Aug 31 '22 16:08 joemasilotti

@joemasilotti i never integrated lookbook into a project, would you like that I take this one?

faqndo97 avatar Aug 31 '22 18:08 faqndo97

If you're up for it then go for it!

Please post updates when you can as I'm really excited about this and want to see it live. If I don't hear back in 7 days I'll reach out and see how you're doing.

joemasilotti avatar Aug 31 '22 19:08 joemasilotti

@joemasilotti cool, thanks! I'll keep updated here and probably start some thread in twitter to document the process 🙌🏼

faqndo97 avatar Aug 31 '22 19:08 faqndo97

That would be amazing – please do!

joemasilotti avatar Aug 31 '22 20:08 joemasilotti

@joemasilotti Small update here. I already installed the gem and documented the easiest component. Everything have been going well so far, but I needed to do a small trick with the base components of the previews that we can discuss later.

Current result:

https://user-images.githubusercontent.com/16840674/188258431-64f1c456-4a99-414a-98d4-3996f62ded0a.mov

BTW, the default route for this is /lookbook, but I'm using /docs/components, which one do you prefer? Or would you like to use a different one?

faqndo97 avatar Sep 03 '22 06:09 faqndo97

Nice – awesome progress! /docs/components sounds great to me, and let's also set up a redirect from /lookbook.

I needed to do a small trick with the base components of the previews that we can discuss later.

Feel free to post a WIP PR with a comment or GitHub review comment and I can take a look. Happy to get it started earlier if the code will trickle throughout the changes.

joemasilotti avatar Sep 03 '22 14:09 joemasilotti

Closing until the redesign is live.

joemasilotti avatar Jun 06 '23 13:06 joemasilotti