-
Notifications
You must be signed in to change notification settings - Fork 124
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
Conversation
* 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.
@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. |
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.
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.
I think it's better to force the icon to be on the same line and then wrap the title if it overflows.
<slot name="_alt"> | ||
<slot name="header"></slot> | ||
<span :class="['card-title']"> |
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.
<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']"> |
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.
Preview: 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) |
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. |
Thanks for sharing the article; That was a good read.
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 (
👍 can be done separately too, and might even be a little out of scope here as well Some more screenshots for comparison: semi rounded fully rounded (original here): |
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. |
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. |
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!) |
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.
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".
docs/userGuide/syntax/panels.mbdf
Outdated
@@ -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`.** |
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.
**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; |
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.
@@ -226,8 +236,10 @@ export default { | |||
.card-title { | |||
display: inline-block; | |||
font-size: 1em; | |||
line-height: 1.2em; |
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.
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.
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.
Ahh alright then can keep it as it is for now :)
.glyphicon { | ||
display: inline-block; | ||
} |
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 believe the provided css from bootstrap-glyphicons already sets the display to inline-block so should be able to remove this.
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) |
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.
Thanks for making the changes @kaixin-hc!
LGTM 👍
What is the purpose of this pull request?
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
hhdqirui suggested change
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:
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: ☑️