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

Implementation/62608 add hovercard to gates #18543

Merged
merged 19 commits into from
Apr 8, 2025

Conversation

EinLama
Copy link
Contributor

@EinLama EinLama commented Apr 4, 2025

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

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@EinLama EinLama force-pushed the implementation/62608-add-hovercard-to-gates branch from ded41ff to 002dca7 Compare April 4, 2025 12:49
@EinLama EinLama marked this pull request as ready for review April 4, 2025 12:51
Copy link
Contributor

@dombesz dombesz left a 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.

@dombesz dombesz requested a review from Copilot April 7, 2025 11:25
Copy link

@Copilot Copilot AI left a 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

@toy toy force-pushed the implementation/62608-add-hovercard-to-gates branch from ab06960 to 831f750 Compare April 8, 2025 12:23
@toy toy requested a review from Copilot April 8, 2025 12:28
Copy link

@Copilot Copilot AI left a 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

@toy toy merged commit 83c1839 into dev Apr 8, 2025
17 checks passed
@toy toy deleted the implementation/62608-add-hovercard-to-gates branch April 8, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants