-
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
Implementation/62608 add hovercard to gates #18543
Conversation
ded41ff
to
002dca7
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.
Looks and works well!👍
Just noted a few minor things, feel free to merge.
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.
Copilot reviewed 13 out of 15 changed files in this pull request and generated no comments.
Files not reviewed (2)
- app/components/_index.sass: Language not supported
- app/components/projects/phases/hover_card_component.sass: Language not supported
This is useful in case we want to show actual project hover cards in the future.
This has always been an issue. Sometimes, when you hover over an element, nothing will happen. One cause of this is now fixed: child elements might emit hover events, which are then caught by their parents. We will consider these as if they were triggered by the parent themselves.
ab06960
to
831f750
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.
Copilot reviewed 13 out of 15 changed files in this pull request and generated no comments.
Files not reviewed (2)
- app/components/_index.sass: Language not supported
- app/components/projects/phases/hover_card_component.sass: Language not supported
Comments suppressed due to low confidence (2)
frontend/src/stimulus/controllers/hover-card-trigger.controller.ts:122
- [nitpick] Consider removing the explicit declaration of 'triggerTargets' as a private property if the Stimulus framework auto-populates it based on the static targets declaration.
if (!this.triggerTargets.some((trigger) => trigger === el)) {
app/components/projects/phases/hover_card_component.rb:48
- [nitpick] Consider explicitly handling the :finish case (e.g., using 'when :finish') instead of relying on an else clause for clarity and future maintainability.
def phase_gate_name
Ticket
https://community.openproject.org/wp/62608
What are you trying to accomplish?
Show hover cards on phase gates.
Screenshots
phase_hover_cards.mov
What approach did you choose and why?
I have created a new hover card component for phase gates. This component is responsible for rendering the view within the hover card. I chose the best directory to place these new files in that I could find. Since we don't have a dedicated folder for phases yet, I made something up.
To make the hover card actually show up, you need to place a trigger in a
data
attribute within the DOM, so that the hover card trigger service can start listening for mouse events, making a turbo request, and finally rendering the hover card component view within a popover. Luckily, all of this was already done, I only had to attach some data attributes to our existing phase component ✌🏻 With that, the hover cards will trigger both on the project overview as well as in the project list table (and all further future places where we display them).I sneaked a small bugfix into the hover card trigger service, since the event bubbling behaves a bit weird for the svg icon. With the fix in place, displaying the hover card upon hovering over the gate icon works reliably 👏🏻
As for specs, I unit tested the component itself and added a small feature spec that triggers a hover card by hovering. I tried to keep the feature spec as short as possible, since I think that hover cards are a nice-to-have in most cases.
Merge checklist