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

Enhance appearance of minimised panels #1694

Merged
merged 9 commits into from
Feb 8, 2022

Conversation

kaixin-hc
Copy link
Contributor

@kaixin-hc kaixin-hc commented Dec 18, 2021

What is the purpose of this pull request?

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

Referring to PR #1422 and the associated comments, I wanted to try putting them on the same line as well as using a different icon / sizing / margin. Provides a slightly different suggestion for #1201 .

Overview of changes:
Before
before

hhdqirui suggested change
image

Suggested
suggested

  • Add caret icon (as most minimised panels tend to use a caret icon to show that it is a clickable button

  • Add top margin (This is to prevent ugly cluttering. as expanded cards also have a top margin but not a bottom margin, top margin was chosen. I do wonder what the reason is for having a top margin and not a bottom margin though! )

Anything you'd like to highlight / discuss:

  • Could be expanded by allowing the user to turn off the icon the same way they can turn off the buttons for the panels
  • I think this may not pass tests - I found a diff in markbind/fontawesome/css/all.min.css. Is it possible just to run a command to update specific test files or only the ones which have changed...? **ETA: oh, it passed! Huh. I wonder why npm run test stopped then 🤔 **

(Possibly to break up into other PRs?)

  • I think for code maintenance, we could probably remove some of the styles in NestedPanel.vue . If I remember correctly, we only need to specify the styles to change in the responsive breakpoints, so is it really needed to specify the same style twice?

  • https://developer.mozilla.org/en-US/docs/Web/CSS/float suggests that it might be unneeded to specify display: inline-block if we are also specifying float, as it would be overridden and ignored.

Testing instructions:

Proposed commit message: (wrap lines at 72 characters)
Enhance appearance of minimised panels

  • Add caret icon (as most minimised panels tend to use a caret icon to
    show that it is a clickable button

  • Add top margin (as expanded cards also have a top margin but not a
    bottom margin, top margin was chosen. This is to prevent ugly cluttering)


Checklist: ☑️

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

* Add caret icon (as most minimised panels tend to use a caret icon to
show that it is a clickable button

* Add top margin (as expanded cards also have a top margin but not a
bottom margin, top margin was chosen. This is to prevent ugly cluttering)

Note: I think for code maintenance, we could probably remove some of the
styles in NestedPanel.vue . If I remember correctly, we only need to specify
the styles to change in the responsive breakpoints, so is it really needed
to specify the same style twice?

Note 2: https://developer.mozilla.org/en-US/docs/Web/CSS/float suggests that
it might be unneeded to specify display: inline-block if we are also
specifying float, as it would be overridden and ignored.
@damithc
Copy link
Contributor

damithc commented Dec 18, 2021

@kaixin-hc if this is a visual change, please post before-and-after screenshots too

@kaixin-hc
Copy link
Contributor Author

@kaixin-hc if this is a visual change, please post before-and-after screenshots too

Okay! I've edited the first message so that it is more visible.

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

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

Thanks @kaixin-hc for working on this :) I think putting them on the same line works as it maintains the minimalistic form and at the same time inform the user that the button can be expanded 👍 I am fine with the current design. Prof @damithc @ang-zeyu any thoughts on this?

Just a quick review and left some comments.

I think on mobile if the title of the panel is long, the icon and the text are on different lines which increases the height of the button.

image

I think it's better to force the icon to be on the same line and then wrap the title if it overflows.

Something like this:
image

<slot name="_alt">
<slot name="header"></slot>
<span :class="['card-title']">
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
<span :class="['card-title']">
<span class="card-title">

Just a trivial suggestion: If there is only one class, would directly assigning the class be better? Same for the span in NestedPanel

:class="['glyphicon', 'glyphicon-chevron-right']"
></span>
</div>
<span :class="['card-title']">
Copy link
Contributor

Choose a reason for hiding this comment

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

The text for each panel is slightly shifted downwards and no longer centered vertically.

image

Seems like the vertical-align: middle; from .card-title is causing it to move downwards.

@damithc
Copy link
Contributor

damithc commented Dec 19, 2021

I think putting them on the same line works as it maintains the minimalistic form and at the same time inform the user that the button can be expanded 👍 I am fine with the current design. Prof @damithc @ang-zeyu any thoughts on this?

I'm OK with this design 👍

@ang-zeyu
Copy link
Contributor

ok with the design as well! A caret icon seems like a good balance.

Could be expanded by allowing the user to turn off the icon the same way they can turn off the buttons for the panels

Agreed, let's add this in, something like no-minimized-switch (can be less verbose)

Another (subjective) suggestion:

round the buttons into pills to make it a little sleeker, so it blends in better with content .
panelspillrounded

@damithc
Copy link
Contributor

damithc commented Dec 23, 2021

round the buttons into pills to make it a little sleeker, so it blends in better with content .
panelspillrounded

Yup, this blends in better with the content. The downside is that a minimized panel 'changes shape' when expanded as panels are actually square-shaped, causing a bit of a disconnect between the minimal and the other forms. So, I'm on the fence about this one.

@ang-zeyu
Copy link
Contributor

Yup, this blends in better with the content. The downside is that a minimized panel 'changes shape' when expanded as panels are actually square-shaped, causing a bit of a disconnect between the minimal and the other forms. So, I'm on the fence about this one.

Preview:

panelexpandrounded

It does seem a little disconnected, but I'm personally leaning more toward rounding the buttons for a sleeker look with the rest of the page.

I think its something we can eventually "smooth out" to some degree by adding some transitions between the minimised and expanded form as well. (or we could round the existing panels a tad bit more)

@kaixin-hc
Copy link
Contributor Author

Thanks for the review and comments everyone. The preview makes it really easy to visualise. I do think that animations will help to smooth it out, and while I don't know how to apply animations yet it might be nice even if they are not rounded. I'll look into it in the new year!

I'm not sure about fully rounding the corners though, I think it might depend on if users tend to put many minimised expandable panels near each other. I found this article https://uxdesign.cc/make-sense-of-rounded-corners-on-buttons-dfc8e13ea7f7 which made a case for fully rounded buttons for primary content when you have space to spare, to direct users attention to those buttons. They suggested to avoid fully rounded buttons when many are used next to each other as it may not be obvious which to click.

Since I assume the minimised form of the expandable panels would be used more when there are many expandable panels next to each other, I wonder if the eye might become more drawn to the round buttons.

@ang-zeyu
Copy link
Contributor

Thanks for sharing the article; That was a good read.

I think it might depend on if users tend to put many minimised expandable panels near each other

I agree fully rounded buttons wouldn't be too suitable here, it might be confused for multiple selection type interfaces.

Not sure if this is a common use case as well @damithc

We could also experiment with slightly milder settings and see which works best (20px -> 10px), I would also be fine if we delayed this decision to some later time completely =P

I do think that animations will help to smooth it out, and while I don't know how to apply animations yet it might be nice even if they are not rounded. I'll look into it in the new year!

👍

can be done separately too, and might even be a little out of scope here as well


Some more screenshots for comparison:

semi rounded 10px (fully rounded is 20px)
seamless3

fully rounded (original here):

ok

dosentflow

@damithc
Copy link
Contributor

damithc commented Jan 4, 2022

I agree fully rounded buttons wouldn't be too suitable here, it might be confused for multiple selection type interfaces.

Not sure if this is a common use case as well @damithc

In the CS2103 website (and its variants), we do have such cases. So, I'm leaning slightly away from fully-rounded corners in this case.

@ang-zeyu
Copy link
Contributor

@kaixin-hc

Agreed, let's add this in, something like no-minimized-switch (can be less verbose)

just in case you missed this ^

As for the corner rounding, you could try a couple of settings and post back here; Also ok if it turns out the best setting is the current / we leave it be for now.

@kaixin-hc
Copy link
Contributor Author

I tried a couple of settings for corner rounding; it looked similar to what you posted previously. However, I still feel looking at it that the original settings are best for visual consistency with the rest of MarkBind as it matches the rounding of other components. The inconsistency makes it look a little jarring to me (and again, a bit like tags!)

corners inconsistency

The current appearance is as follows:
panels
minimised no caret

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

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

Nice work @kaixin-hc 👍 A couple of suggestions on the implementation.

I tried a couple of settings for corner rounding; it looked similar to what you posted previously. However, I still feel looking at it that the original settings are best for visual consistency with the rest of MarkBind as it matches the rounding of other components. The inconsistency makes it look a little jarring to me (and again, a bit like tags!)

We can leave the corner rounding as it is for now. We can come back to this again or as a separate issue, round the corners of the other components as well if it makes the entire site "sleeker".

@@ -104,11 +104,14 @@
</include>


**Show/Hide buttons using `no-switch` or `no-close`.**
**Show/Hide buttons using `no-switch`, `no-close`, or `no-mimized-switch`.**
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
**Show/Hide buttons using `no-switch`, `no-close`, or `no-mimized-switch`.**
**Show/Hide buttons using `no-switch`, `no-close`, or `no-minimized-switch`.**

Typo here :)

.minimal-caret-wrapper {
display: inline-block;
font-size: 13px;
margin-right: 2px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Might want to slightly increase the margin between the minimized switch and the card title on mobile? Right now it looks a little too cluttered.

image

@@ -226,8 +236,10 @@ export default {
.card-title {
display: inline-block;
font-size: 1em;
line-height: 1.2em;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an opinion:

I think the card titles look slightly more centered vertically without setting the line-height here.

With line-height:
image

Without line-height:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what you mean, but it helps for panels with long names.

With line-height:
With line-height picture

Without line-height:
Without line-height picture

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh alright then can keep it as it is for now :)

Comment on lines 260 to 262
.glyphicon {
display: inline-block;
}
Copy link
Contributor

@jonahtanjz jonahtanjz Jan 24, 2022

Choose a reason for hiding this comment

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

I believe the provided css from bootstrap-glyphicons already sets the display to inline-block so should be able to remove this.

@kaixin-hc
Copy link
Contributor Author

Thanks for the review @jonahtanjz, sorry for the delay in implementing changes. I've done as you suggested for all except line height (screenshot explanation in the comments)

Copy link
Contributor

@jonahtanjz jonahtanjz left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes @kaixin-hc!

LGTM 👍

@jonahtanjz jonahtanjz added this to the 4.0 milestone Feb 7, 2022
@jonahtanjz jonahtanjz merged commit 40bb7a5 into MarkBind:master Feb 8, 2022
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.

4 participants