-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Feature/59925 show user popover on the name #17692
Conversation
84926fc
to
cf1c93e
Compare
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.
Hi @EinLama
I don't quite get the necessity for the sibling logic. Maybe we can shortly talk about that. Other than that, I found some issues while testing it:
-
I managed quite often to get to a state where either the name or the avatar does not trigger a hoverCard any more
-
There seems to an issue with the helper, but I could not quite get my finger on it. The WP info line shortly shows the author as a link before it switches to a text. That does not happen with all users however, I only saw it when the author is my current logged in user. However, even when there is a link shown, there is no hoverCard when hovering it.
- In the acceptance criteria it is said, that there should be no flicker when switching between name and avatar. The card is however disappearing when I leave the name and reopens when hovering the avatar. Due to the delay it does not feel flickering but I'd neverless like to hear the opinion of the product team on this.
frontend/src/app/core/setup/globals/global-listeners/hover-card-trigger.service.ts
Outdated
Show resolved
Hide resolved
967ddd3
to
960f58c
Compare
Hey @HDinger, thank you for your review. You already helped me get rid of the unnecessary bloat fetching data from a sibling element. So that one is done.
I could reproduce this by "jittering" the mouse cursor over the trigger. The hover card trigger service has a safe-guard that - once shown - will not re-show the same hover card again. This safe-guard was too restrictive and did not consider that you could move the mouse cursor away before the hover card is actually shown. So the trigger service thought it had to safe guard a hover card that wasn't there yet. I moved the safe-guard to the appropriate position and that fixed it. If the cause for your observed behavior was the same, that should be fixed, too.
I could not reproduce this, nor have I ever seen it 🤔
Will discuss later today and report back. |
The hover card disappearing briefly when alternating between username and avatar has been discussed with product and is deemed okay 👍🏻 |
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 only have small remarks left:
- The author of a WP is now correctly shown as link (in the little info row next to the status). However, hovering over it does not trigger a HoverCard
- When opening a user autocompleter (e.g to set an assignee), I can also see groups. Hovering over a group name triggers an empty hovercard which lays behind the dropdown. There should be no card at all
![Bildschirmfoto 2025-02-04 um 08 58 47](https://private-user-images.githubusercontent.com/7457313/409457088-2329012b-d1ff-4228-b98c-684a98154388.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTg4NzcsIm5iZiI6MTczOTAxODU3NywicGF0aCI6Ii83NDU3MzEzLzQwOTQ1NzA4OC0yMzI5MDEyYi1kMWZmLTQyMjgtYjk4Yy02ODRhOTgxNTQzODgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMTI0MjU3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjRhZThhM2MxYzZhMzM2MzhlZGUwZWI3YmEwYTkxZmY0NTFmODAwMmU5ZjQxZTYwNmU1N2MyMjdhODI5NDkyYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.8FnWVLLqHheHhe-7uDWGg8rXNupVnwM7KRmB5z0bALw)
// For hover cards to work within the auto completer, we have to ensure that the hover event can be properly | ||
// triggered when mousing over the name. The easiest way to do this is to set it to inline-block. | ||
.op-user-autocompleter--name.op-hover-card--preview-trigger | ||
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.
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 added this property since I encountered weird behavior. When you hovered over a name in an autocompleter, the hover card would show up. But as soon as you traced over a space between words, it would disappear - only to re-appear shortly thereafter when you leave the space and enter the next word.
However, this no longer happens now. So there must have been another in-development-state present back then that was the cause for this buggy behavior. Thanks for questioning this, I can remove this hack!
Nesting them is not supported.
used in * news * wiki * activity * and more!
... on the overview page
... on overview page
After rendering a comment or wp description, the hover card should appear when you hover over a mentioned username.
This reverts commit e095361.
my-news uses angular, here we are using rails -> do not mix up the translation keys as they are used with different approaches in mind.
The autocompleter hover cards only worked when there was no search highlighting enabled. As soon as there were results, the child spans were transformed and you could not hover over them anymore, so cards did not trigger. Setting these to `inline-block` fixes that issue.
This reverts commit 4fdc18c.
* use cuprite * get rid of unneeded empty grid setup (that is ignored) * expect a location that exists
Yes, it has many conditions. But throwing in additional methods won't help with reducing its complexity.
this is no longer needed
5a24300
to
3eb1fa7
Compare
Thank you, fixed!
That was a side-efffect of me removing the sibling logic. Fixed now so that hover cards are only shown for principals of type user. |
The red spec is flaky, have seen this a couple of times 😵 |
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 job 👍 🌟
Ticket
https://community.openproject.org/wp/59925
What are you trying to accomplish?
Enable the hover card not only on avatars, but also when hovering on names.
Notable technical exceptions where the hover card will not render due to technical limitations of our spot modal usage:
I am currently working on removing these limitations in a follow-up PR, but wanted to make the current state available for review.
Notable other exceptions where the required effort to patch in hover cards was not worth it in my opinion:
Screenshots
hover_card_on_name.mov
What approach did you choose and why?
I applied the same logic to usernames as I did on the avatars.
For some user names (e.g. within auto completers), there was no easy way to inject the necessary parameters into the data attributes of the user name span, so I instead introduced a new CSS class:.op-hover-card--data-on-sibling-principal
If a hover card is triggered, but the source element has this class, the hover card data is sourced from sibling elements if possible.
To cover most other links, I extended
ObjectLinking#link_to_user
to add hover card info to the link.Fixed some timing and consistency bugs while on it, too.
Merge checklist