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

Add CollapseExpandButtons component #2206

Merged
merged 37 commits into from
Apr 4, 2023
Merged

Conversation

itsyme
Copy link
Contributor

@itsyme itsyme commented Mar 12, 2023

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

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: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

@jovyntls
Copy link
Contributor

Some guidelines we could consider:

  • Unobtrusive - preferably not "in my face" since the focus should be on our SiteNav contents
  • Takes up minimal vertical space on top - we can try to keep the SiteNav contents as high up as possible since a user scanning the site nav starts from top to bottom. In other words, I think it would be good to avoid "pushing down" Sitenav contents
  • Would also be nice if authors can choose to hide/show the buttons on the SiteNav

Some ideas:
Screenshot 2023-03-12 at 9 35 51 PM
Screenshot 2023-03-12 at 9 35 51 PM

Or we could style it more minimalist-y, similar to our current dropdown style, and have a single arrow beside the Sitenav title ("User Guide" in this case); it functions as an "Expand all" button initially, and when clicked it toggles between "Expand all" and "Collapse all"
Screenshot 2023-03-12 at 9 35 51 PM

At the bottom:
image

@itsyme
Copy link
Contributor Author

itsyme commented Mar 12, 2023

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 site-nav-top which iirc is optional. I will try implementing the buttons at the bottom. Any thoughts?

@jovyntls
Copy link
Contributor

jovyntls commented Mar 12, 2023

@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).

@itsyme
Copy link
Contributor Author

itsyme commented Mar 12, 2023

@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!

@itsyme itsyme changed the title Add expand and collapse all buttons in site-nav Add expand and collapse all button component for site-nav Mar 31, 2023
@itsyme itsyme changed the title Add expand and collapse all button component for site-nav Add expand and collapse all button component for SiteNav Mar 31, 2023
@itsyme itsyme changed the title Add expand and collapse all button component for SiteNav Add CollapseExpandButtons component for SiteNav Mar 31, 2023
@itsyme itsyme marked this pull request as ready for review April 1, 2023 02:21
@itsyme
Copy link
Contributor Author

itsyme commented Apr 2, 2023

This looks nice as a component! Not sure about having the component at the bottom with the up/down triangle arrows as it looks like it will trigger a scroll instead of a collapseAll/expandAll feature 😅

Hmmm I actually thought the up/down triangle arrows are not bad because its' consistent with the open and close button in the site nav.
I kind of prefer that over the current icons in the updated video @itsyme 😅 but ok I see it looks very similiar to the current scroll up button

What do you think about these icons instead @yucheng11122017?
Screenshot 2023-04-02 at 6 10 51 PM

How about the plus and minus button that was mentioned by @jovyntls in her first comment?

tbh if its at the top, would the triangles still seem like a scroll top scroll bottom button?

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!

@itsyme
Copy link
Contributor Author

itsyme commented Apr 2, 2023

These are some similar icons from fontawesome

  1. Screenshot 2023-04-02 at 6 37 34 PM
  2. Screenshot 2023-04-02 at 6 38 21 PM
  3. Screenshot 2023-04-02 at 6 38 53 PM

@yucheng11122017
Copy link
Contributor

These are some similar icons from fontawesome

  1. Screenshot 2023-04-02 at 6 37 34 PM
  2. Screenshot 2023-04-02 at 6 38 21 PM
  3. Screenshot 2023-04-02 at 6 38 53 PM

Ooo I think these look a lot nicer! I think 2 fits with the site nav design :)

@jovyntls
Copy link
Contributor

jovyntls commented Apr 2, 2023

This looks nice as a component! Not sure about having the component at the bottom with the up/down triangle arrows as it looks like it will trigger a scroll instead of a collapseAll/expandAll feature 😅

Hmmm I actually thought the up/down triangle arrows are not bad because its' consistent with the open and close button in the site nav.

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

Copy link
Contributor

@jovyntls jovyntls left a 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?

@itsyme
Copy link
Contributor Author

itsyme commented Apr 3, 2023

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!

@itsyme itsyme requested a review from jovyntls April 3, 2023 05:10
Copy link
Contributor

@jovyntls jovyntls left a 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

@yucheng11122017
Copy link
Contributor

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?

@itsyme
Copy link
Contributor Author

itsyme commented Apr 3, 2023

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!

Copy link
Contributor

@yucheng11122017 yucheng11122017 left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@yucheng11122017 yucheng11122017 self-requested a review April 4, 2023 10:09
class="expand-all-button"
@click="expandAll()"
>
<i :class="['far fa-plus-square']"></i>
Copy link
Contributor

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!

@itsyme itsyme changed the title Add CollapseExpandButtons component for SiteNav Add CollapseExpandButtons component Apr 4, 2023
@itsyme itsyme merged commit 61eebde into MarkBind:master Apr 4, 2023
/* Button Positioning */

.button-container {
position: absolute;
Copy link
Contributor

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

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.

SiteNav: give a way to expand/collapse all items
4 participants