-
Notifications
You must be signed in to change notification settings - Fork 81
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
A new documentation page and layout fixes for KBreadcrumbs #292
Conversation
to prevent from unnecessary breadcrumbs layout updates. The update is triggered on each width change of the parent container which is sufficient.
when not necessary Fixes learningequality#198 Fixes learningequality/kolibri#6918
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. I love the documentation. Since this is documented directly on the component page, I wonder if we might consider a design that shows code example along with the example. Looking at the code for the docs component I think it'd be nice to see directly in the docs. (I'll tuck this thought away for an upcoming tactical so no need to do anything here). I didn't spin it up because it looks good in your screenshots and on the live netlify of the docs.
// The throttled update function is defined here and not as a method on purpose | ||
// since having it defined as a method on the options object would cause problems | ||
// when there are more KBreadcrumbs instances rendered on one page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense thanks for the explanation!
Yes, I was thinking about exactly the same thing. I welcome chatting about it during the tactical as you suggest since it's related rather to the whole KDS documentation. |
The only situation I can think of that would be useful to show the single breadcrumb is when there isn't any other page header or label that shows what the current level is. |
Hi friends! Thought I'd provide a little context here: The However, the component does not actually render the example code – that is a separate block. This is somewhat unfortunate because the code is duplicated. On the other hand, it can be useful because some examples need additional code (e.g. css margins) that is irrelevant to demonstrating the component API and this can be omitted. Another option and something that could be useful regardless: changing the Github link into a "View source" link for the current page, which would let devs more easily inspect the source directly kind of like on readthedocs:
Also some history: At one point we actually had a system working where the code displayed would drive a live example, and you could even edit the code to see changes. This ended up being challenging because it required the Vue template compiler to be loaded client-side and it required the entire template to shown including the entire |
Thank you, @indirectlylit. @jtamiace I added your suggestion on allowing a single breadcrumb to the guidelines section. Could you please review the whole page? |
@jtamiace The latest preview is here https://deploy-preview-292--kolibri-design-system.netlify.app/kbreadcrumbs/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this new documentation is great
Description
(1) Adds a first version of
KBreadcrumbs
page to components documentation(2) Consolidates styles in regards to vertical alignment of breadcrumbs items
(3) Optimizes breadcrumbs to use all space available
(4) Consolidates throttling and resizing logic
Particularly in regards to having more breadcrumbs instances on one page like in KDS documentation. See commit messages and code comments for details. In the following recording, notice the second breadcrumbs not being properly collapsed because
updateCrumbs
never ran for this particular instance:Issue addressed
KBreadcrumbs
truncates long items even when there is enough space to show it in its entirety #198Steps to test
The documentation page
Regarding text, this is just the very first draft that’s main purpose was to provide me with testing and development environment for new updates as @indirectlylit suggested:
Feel free to suggest any changes. @jtamiace I’d appreciate particularly your thoughts. Also, @jtamiace, I’d like to add some guidance to the new page on when to allow displaying a single breadcrumb item (#129) on this opportunity. Do you have any suggestions?
The library component
Testing checklist
changelog
Reviewer guidance
Post-merge updates and tracking
Comments
I’ll update the changelog and create a new release tag as soon as the first review of the documentation page and the component is done.