feat: add Django Lookbook (Storybook analogue) to repository#2209
Draft
feat: add Django Lookbook (Storybook analogue) to repository#2209
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the Django Lookbook component visualizer to the project.
This serves as a replacement to our current Storybook implementation, which uses React and lives in a different codebase.
Setup
docker compose up --build;http://localhost:8000/lookbook/(don't forget the trailing/);Pros & Cons
A good thing about moving to Lookbook is that it showed how some components were not working properly outside of the
v3/demo/componentspage, giving us the possibility to fix some of those issues.Some may find that the demo page is better for visualization, as all the components are there easily accessible (I tend to think that myself). We can always refactor the current implementation and condense some discrete pages into a single one, like the
buttonssection pages.But, at its core, we get the basics: component catalog, implementation documentation, theme switching, component searching and grouping.
Missing Features & Current Issues
Django Lookbook is very minimal and doesn't offer many features like React Storybook does (like measuring, test s integration etc.).
Maybe a second test implementation could be made with storybook-django to see if that works well. The purpose here was to minimize the dependencies on anything related to Node.JS, but that comes at a cost.
Some components are showing weird behavior when displayed in Lookbook, like the install card, which overflows the dropdown trigger, but not its children:

The banner also spans full width, and I'm not sure what's causing this yet.
The learn card gets a weird font coloring when in dark mode.
Library intro card has some padding issues on the right.
There are other small styling issues like these, and I'm investigating each one of them, especially to guarantee that the tool is reliable and it's not it that it's causing the styling issues.
This is currently a Draft PR, and should be converted to a real one once these minor bugs are fixed.