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 contacts menu on mentions #11258

Merged
merged 2 commits into from Sep 18, 2018
Merged

Fix contacts menu on mentions #11258

merged 2 commits into from Sep 18, 2018

Conversation

danxuliu
Copy link
Member

This pull request ensures that the contacts menu will be shown when clicking on any area of the mention, and it also fixes the position of the contacts menu shown on mentions in the comments.

The positioning of the contacts menu is a bit messy right now. There are no default CSS rules for the contacts menu, as its position depends on the context in which it is shown (a different position is needed if the avatar is 16px or 32px, for example). However, there are some rules set in the share tab which use a broad selector and thus affect the contacts menu in the Comments app. Moreover, the position is also affected by the default rules for other CSS classes used in the contacts menu, like .popover-menu.menu-left.

The contacts menu is now positioned to show the tip of the arrow horizontally aligned with the center of the avatar *1, and with the top of the menu slightly below the bottom border of the mention *2.

*1: the avatar is 16px and the mention has a left padding of 1px, so the tip of the arrow has to appear at 9px from the left border of the mention to be centered on the avatar; the arrow is 18px (it is created using a 9px bottom border), so the tip is at 9px from its left border, and the left border of the arrow is 6px to the left of the contacts menu, which is left aligned with the mention, so the contacts menu has to be pulled 6px to the left to horizontally center the tip of the arrow on the avatar.

*2: the height of the mention is 20px, so the top of the contacts menu is at 24px to give some space between the mention and the menu while still keeping the tip of the arrow on the avatar.

Before:
comment-mentions-contacts-menu-before

After:
comment-mentions-contacts-menu-after

@nextcloud/designers

The contacts menu was triggered only when the avatar or the name of the
user were clicked. Due to this, clicking on certain (small) areas of a
mention (like the right end, or the space between the avatar and the
name) did not show the contacts menu. Now the contacts menu is shown
when any area of the mention is clicked.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
There are no default CSS rules for the contacts menu, as its position
depends on the element on which it is shown. Note, however, that if no
explicit rules are provided the contacts menu on mentions is affected by
the rules for the contacts menu on shares from the sharing tab.

The contacts menu is now positioned to show the tip of the arrow
horizontally aligned with the center of the avatar, and with the top of
the menu slightly below the bottom border of the mention.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@blizzz blizzz merged commit 7f6d42c into master Sep 18, 2018
@blizzz blizzz deleted the fix-contacts-menu-on-mentions branch September 18, 2018 09:42
@nickvergessen
Copy link
Member

@danxuliu backport today if it shall be in 14.0.1, otherwise 14.0.2

@danxuliu
Copy link
Member Author

backport today if it shall be in 14.0.1, otherwise 14.0.2

Not super important, it can be in 14.0.2.

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 design Design, UI, UX, etc. feature: comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants