-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add CollapseExpandButtons component #2206
Conversation
Hi @jovyntls! Thanks for the feedback! I will try to implement the suggestions in due course. On the look of the buttons, I really like the first 3 implementations, however the location of the buttons are in the |
@itsyme What do you think about making these buttons a component (like the scroll to top button)? This could allow users to choose whether or not they want to have the Expand/Collapse All buttons and give us more flexibility on where it can be added (including in optional components). |
I think thats a great idea! I will try to implement that soon! |
I felt like the plus and minus icons were a little too different from our present icons which are mostly from fontawesome, I will find a similar icon from fontawesome compare them! |
I agree! I have no issues with the icons - more concerned about placing it at the bottom which would be disconnected from a shorter sitenav. Having it at the top right of the site nav looks good :) Sorry for the confusion |
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.
The code and tests LGTM! 😄 Remaining nits are on the documentation.
I'm not sure if this component should be under "others" or "navigation" (I can see how it may fall into either 🤔 ) Though I think it would be nice to add a note about this component under the "sitenav" section to improve feature discoverability.
Also, "Collapse/Expand All Buttons" or "Collapse & Expand All Buttons" or "Collapse Expand All Buttons" be a nicer reader-facing name?
Thanks for reviewing my PR @jovyntls! I feel that the component fits better under "others" as the effect of the buttons do not offer any navigation functionality. I will add in a note under sitenav for this component! As for the naming, I think "Collapse/Expand All Buttons" sounds the most natural to me! I will update it in the next commit! |
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.
LGTM! Thank you @itsyme
Hi @itsyme, the documentation has an example but the buttons seem to collapse and expand the site nav at the side instead of at the example. Understand that its part of the implementation but was thinking that it would be good to not have this example in that case and just say there is an example of the left of the page at the site nav. What do you think? |
I agree! I will make the appropriate changes in the next commit! |
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.
LGTM except for one small nit! thanks for the work
<!-- Included in readerFacingFeatures.md --> | ||
<div id="examples" class="d-none"> | ||
|
||
You can see an example of collapse/expand all buttons ==on the top right== of the site navigation. |
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.
You can see an example of collapse/expand all buttons ==on the top right== of the site navigation. | |
You can see an example of collapse/expand all buttons ==on the top right== of the site navigation that is located on the left of this page. |
class="expand-all-button" | ||
@click="expandAll()" | ||
> | ||
<i :class="['far fa-plus-square']"></i> |
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.
I think you don't need :class here because its static not dynamic :) Same for below!
/* Button Positioning */ | ||
|
||
.button-container { | ||
position: absolute; |
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.
The design looks nice 👍 From a product standpoint this feels a little odd for a component as it is far from standalone.
Did we consider baking this into the <site-nav>
? (as an attribute or built-in)
The design may have to be tweaked slightly but this PR should largely be reusable.
We should consider this carefully before releasing
What is the purpose of this pull request?
Overview of changes:
Resolves #655. Added a CollapseExpandButtons component that renders 2 buttons to collapse and expand all dropdowns in the SiteNav.
Anything you'd like to highlight/discuss:
Looking for suggestions to improve the look of the buttons as it may look slightly out of place now. Wondering if it should be toggle-able or only appear when there are dropdowns in site-nav.
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Add CollapseExpandButtons component
Checklist: ☑️