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

Fix appnavigationitem layout #1897

Merged
merged 1 commit into from
Apr 30, 2021
Merged

Conversation

marcoambrosini
Copy link
Contributor

@marcoambrosini marcoambrosini commented Apr 29, 2021

Fix #1868 and adds 4px padding on top and bottom too so that the actions hover circle doesn't intersect with the boundary of the element

Screenshot from 2021-04-29 12-31-39
Screenshot from 2021-04-29 12-31-58

Signed-off-by: Marco Ambrosini marcoambrosini@pm.me

@marcoambrosini marcoambrosini added the 3. to review Waiting for reviews label Apr 29, 2021
@marcoambrosini marcoambrosini added this to the 4.0.0 milestone Apr 29, 2021
@marcoambrosini marcoambrosini self-assigned this Apr 29, 2021
@marcoambrosini marcoambrosini added bug Something isn't working regression Regression of a previous working feature labels Apr 29, 2021
@marcoambrosini
Copy link
Contributor Author

@raimund-schluessler I added the extra margin on the right of the counter for a visual balance, the element is much shorter than the actions component and it looked weird too close to the right border of the wrapper.

I can come up with a different classname though, what about ...__counter-wrapper?

@raimund-schluessler
Copy link
Contributor

@raimund-schluessler I added the extra margin on the right of the counter for a visual balance, the element is much shorter than the actions component and it looked weird too close to the right border of the wrapper.

The thing is that the counter can have different widths. So setting a fixed margin will only achieve a "balance" for a single width. In all other cases, it won't be balanced and not aligned at the right side. That's why I would prefer a right alignment.

@raimund-schluessler
Copy link
Contributor

I can come up with a different classname though, what about ...__counter-wrapper?

A wrapper won't be necessary if we just use &::v-deep .app-navigation-entry__counter.

@marcoambrosini
Copy link
Contributor Author

A wrapper won't be necessary if we just use &::v-deep .app-navigation-entry__counter.

The thing is that appnavigationcounter will be deprecated and developers will start using this instead, so we'd have to v:deep two class names with the same rule

@marcoambrosini
Copy link
Contributor Author

The thing is that the counter can have different widths. So setting a fixed margin will only achieve a "balance" for a single width. In all other cases, it won't be balanced and not aligned at the right side. That's why I would prefer a right alignment.

About this, the action's hover feedback is visible only when hovering, most of the times you only see the 3 dots icon, so the spacing of the element to the right is even bigger.

This is what happens without that extra padding and that's what I'm trying to tackle here. It's sort of independent of the amount of characters in the counter, but the less of them, the more out of balance it looks.

Screenshot from 2021-04-30 11-11-46

@raimund-schluessler
Copy link
Contributor

A wrapper won't be necessary if we just use &::v-deep .app-navigation-entry__counter.

The thing is that appnavigationcounter will be deprecated and developers will start using this instead, so we'd have to v:deep two class names with the same rule

Ah, yeah, fair enough. Then let's just use a different class name.

Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
@marcoambrosini marcoambrosini force-pushed the fix-appnavigationitem-layout branch from f36bd8a to a08dcf9 Compare April 30, 2021 10:21
@raimund-schluessler
Copy link
Contributor

raimund-schluessler commented Apr 30, 2021

This is what happens without that extra padding and that's what I'm trying to tackle here. It's sort of independent of the amount of characters in the counter, but the less of them, the more out of balance it looks.

This is how it looks with longer counters when right-aligned:

Screenshot_2021-04-30 Nextcloud Vue Style Guide

And the same elements with the changes from this PR:

Screenshot_2021-04-30 Nextcloud Vue Style Guide(1)

I agree the differences are subtle and probably a matter of taste. I just like alignment 😉 I leave it up to you.

@raimund-schluessler raimund-schluessler self-requested a review April 30, 2021 10:57
@skjnldsv
Copy link
Contributor

/backport to stable3

@marcoambrosini marcoambrosini merged commit f9bb5d8 into master Apr 30, 2021
@marcoambrosini marcoambrosini deleted the fix-appnavigationitem-layout branch April 30, 2021 12:49
@raimund-schluessler
Copy link
Contributor

@ma12-co @skjnldsv This change (the wrapper around the counter) breaks the Calendar and the Tasks app, since both apps use the counter slot to show an avatar and the sharing action like so:
https://github.com/nextcloud/calendar/blob/master/src/components/AppNavigation/CalendarList/CalendarListItem.vue#L39-L45

Screenshot_2021-04-30 Tasks - Nextcloud

I am not really sure what is the proper solution here. The counter slot probably wasn't supposed to show an Avatar and an ActionItem in the first place. But there is no other slot to show something in the app-navigation-entry__utils element.
For now, adding

.app-navigation-entry__counter-wrapper {
	display: flex;
	align-items: center;
	flex: 0 1 auto;
}

mitigates the issue:

Screenshot_2021-04-30 Tasks - Nextcloud(1)

Also @ChristophWurst, because you will have the same problem in the Calendar app.

@raimund-schluessler
Copy link
Contributor

raimund-schluessler commented Apr 30, 2021

Also, increasing the height of the AppNavigationItem by 20% is to much, I think. Was this discussed with @nextcloud/designers and especially @jancborchardt? In my impression, we now waste a lot of screen space (especially height) in the AppNavigation, because every item is now 52px instead of 44px high.

Before we see 15+ entries:
Screenshot_2021-04-30 Tasks - Nextcloud(3)

After we only see 13 entries without a real benefit imho:

Screenshot_2021-04-30 Tasks - Nextcloud(2)

I will overwrite this change in the Tasks app for now, until this is discussed and confirmed.

@skjnldsv
Copy link
Contributor

skjnldsv commented May 3, 2021

The counter slot probably wasn't supposed to show an Avatar and an ActionItem in the first place.

Yep 😞

Also, increasing the height of the AppNavigationItem by 20% is to much

Ah right @ma12-co, this is supposed to be a bugfix. This is too much, please let's keep the 44px, this is not a feature-pr :)

@skjnldsv
Copy link
Contributor

skjnldsv commented May 3, 2021

@ma12-co please only fix the margin :)

@skjnldsv skjnldsv mentioned this pull request Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working regression Regression of a previous working feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppNavigation counter have wrong right margin
3 participants