-
Notifications
You must be signed in to change notification settings - Fork 90
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
refactor(styleguide): migrate and redesign buttons #2562
Conversation
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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.
Wow @alina-beck !
That looks really nice and is great in general !!! 😍💫👍🏼
Examples …
- The buttons in the editor looking great!
- … for the categories as well!
I just started the review and will add up what I’ve seen so far:
On the frontend I found:
- On the new terms and conditions page hover the button looks not nice. The text is unreadable:
- On the create post page
Cancel
looks on hover the same asSave
not hovered:
- If I hover an emoticon on the post page nothing changes at all before I click:
- The content menu is not working on a post card:
- Create post button is not working on the users profile page:
- Shall the notifications red number circle be cut?
- Emoticons are a little bit small in the filter menu and not aligned with the
Users I follow
button:
… review in progress …
@@ -74,7 +74,7 @@ describe('CommentForm.vue', () => { | |||
|
|||
it('calls `clear` method when the cancel button is clicked', async () => { | |||
wrapper.vm.updateEditorContent('ok') | |||
await wrapper.find('.cancelBtn').trigger('submit') | |||
await wrapper.find('[data-test="cancel-button"]').trigger('submit') |
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 😍
<base-button | ||
:disabled="disabled && !update" | ||
@click="handleCancel" | ||
data-test="cancel-button" |
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.
Same same 👆🏼
Wow @Tirokk, thank you! That was a very thorough review. 😍 |
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 feel like I asked for some changes, but I'm going to approve, cause maybe you can give reasons why, or you have changed them in the other PR
Great job!! Really love it! would love to get the client, @DennisHack, to sign off on the design changes, if he hasn't already
</ds-button> | ||
</ds-flex-item> | ||
</ds-flex> | ||
<div class="buttons"> |
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 would typically suggest something a bit more descriptive, but I really like how you target this class as a grandchild of comment-form
to apply CSS
, so it doesn't make me nervous that the styling will be accidentally applied elsewhere.
Or that we be tempted to use scoped
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 know, it's counter-intuitive at first! Also my first time to use it like this but if we really follow the rscss
suggestions and VueJS Styleguide
all our components will have two-word-names and we'd only have these shorter and more generic class names as children of more specific classes. And I really like the readability of buttons
in comment-form
as opposed to BEM-style comment-form__buttons
... 😉
margin-top: 0; | ||
|
||
> .counter-icon { | ||
margin-right: 12px; |
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 thought we wanted to avoid using magic numbers instead of design tokens, @alina-beck ??
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.
got me... 😊 we do!
filled | ||
:disabled="!deleteEnabled" | ||
@click="handleSubmit" | ||
> |
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.
why is this still ds-button
?
actually, there are 10 files for me locally that still include ds-button
... I will have a look at the other PR
you put in... maybe there were bigger changes needed?
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.
yes, that's in the second PR. I know it's a bit confusing, I'll try to find a better solution next time than splitting things up into two PRs... sorry! 🤷♀
<ds-button | ||
<div class="follow-filter-button"> | ||
<base-button | ||
name="filter-by-followed-authors-only" |
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 know you didn't add this, but is this here only for testing purposes?
if so, wouldn't it be better to use data-test
, which is removed in production?
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.
ha, I'll go check!
import NotificationMenu from './NotificationMenu' | ||
|
||
const localVue = global.localVue | ||
|
||
localVue.filter('truncate', string => string) | ||
|
||
config.stubs.dropdown = '<span class="dropdown"><slot /></span>' | ||
config.stubs.dropdown = '<span class="dropdown"><slot :toggleMenu="() => null" /></span>' |
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.
cool trick!
it('uses a primary button', () => { | ||
expect(tag.classes()).toContain('ds-tag-primary') | ||
it('renders the capped count with a plus', () => { | ||
expect(count.text()).toEqual('99+') |
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.
really like this!
Report Details | ||
</ds-button> | ||
</counter-icon> | ||
<counter-icon icon="bell" :count="0" /> |
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.
cool stuff here!
I like that I can see what they look like without needing to create 100 notifications, for example
I did notice that the counter is neutral when inactive... which makes sense!
.add('default', () => ({ | ||
components: { LoadingSpinner }, | ||
template: '<loading-spinner />', | ||
})) |
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.
it just spins and spins!! 😛
transform: rotate(2160deg); | ||
} | ||
} | ||
</style> |
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.
cool new reusable component!
<ds-button @click="back" :disabled="!hasPrevious" icon="arrow-left" primary /> | ||
</ds-flex-item> | ||
</ds-flex> | ||
<hc-paginate :hasNext="hasNext" :hasPrevious="hasPrevious" @next="next" @back="back" /> |
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.
ahhh, thanks... I must have forgotten to refactor this
🍰 Pullrequest
CounterIcon
(because it was wrapped around a button but I would argue it should be the other way round 😉)Old buttons
New buttons
Please start
storybook
to see them in action!Motivation
secondary
button because it is never used on the site and would disrupt the design in its current state. I don't think we need the blue color at all.disabled
which can be very confusing. By the way, the vast majority of buttons on the network is set asprimary
(filled in green) anyway.ghost
buttons as well. They are very rarely used and I think the new design of thedefault
button is a good replacement – especially sinceghost
buttons are only ever used in combination withprimary
ordanger
buttons.primary-light
andprimary-dark
, same fordanger
), so thehover
andactive
states are now more easily distinguishable.circle
shapes which was impossible before.Issues
Questions
Testing: We should make this decision as a team, but I'm especially interested what @mattwr18 has to say – because you added tests for
CounterIcon
: What should be covered in component tests, especially forgeneric
components?I think it would make sense to test logic, but only if there is any (in case of the
CounterIcon
I added a cap for the counter, so we could make sure that count values below100
are displayed at their actual value and counts above as99+
) but I don't think it is necessary to test that all the elements are rendered. If that is something we do want to test I would maybe suggest thestorybook snapshots
instead. What do you think?Icon Button Design: Do you think there is a use case for the below button style or should
icon-only
buttons by default becircles
?ToDo
<ds-button>
with<base-button>
throughout the projectscss variables
inBaseComponents