-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[#68834] Fix Time Entry tooltips in My spent time #20956
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
Conversation
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.
Pull Request Overview
This PR migrates the calendar tooltip implementation from the legacy jQuery UI tooltip to a modern tool-tip web component using Primer's design system. The changes include simplified CSS styling for tooltip content and a complete rewrite of the tooltip attachment/removal logic.
Key changes:
- Replaces jQuery tooltip with native
tool-tipcustom element - Simplifies tooltip map styling by consolidating margin properties and adding text alignment
- Implements tooltip as a popover with proper ARIA attributes and positioning
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
frontend/src/global_styles/content/_tooltip.sass |
Simplifies .tooltip--map styling by consolidating margins and adding left text alignment |
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts |
Replaces jQuery tooltip with custom tool-tip element, adds proper ID management and popover attributes |
Comments suppressed due to low confidence (1)
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts:646
- The HTML string is missing the closing
</ul>tag. This will result in malformed HTML when the tooltip is rendered.
<ul class="tooltip--map">
<li class="tooltip--map--item">
<span class="tooltip--map--key">${schema.project.name}:</span>
<span class="tooltip--map--value">${this.sanitizedValue(entry.project.name)}</span>
</li>
<li class="tooltip--map--item">
<span class="tooltip--map--key">${schema.entity.name}:</span>
<span class="tooltip--map--value">${entry.entity ? this.sanitizedValue(this.entityName(entry)) : this.i18n.t('js.placeholders.default')}</span>
</li>
<li class="tooltip--map--item">
<span class="tooltip--map--key">${schema.activity.name}:</span>
<span class="tooltip--map--value">${this.sanitizedValue(entry.activity?.name || '')}</span>
</li>
<li class="tooltip--map--item">
<span class="tooltip--map--key">${schema.hours.name}:</span>
<span class="tooltip--map--value">${this.timezone.formattedDuration(entry.hours as string)}</span>
</li>
<li class="tooltip--map--item">
<span class="tooltip--map--key">${schema.comment.name}:</span>
<span class="tooltip--map--value">${this.sanitizedValue(entry.comment.raw || this.i18n.t('js.placeholders.default'))}</span>
</li>
`;
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
Outdated
Show resolved
Hide resolved
|
@HDinger I think we can probably delete some of the styles in |
9401acf to
ce0fbf0
Compare
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
Outdated
Show resolved
Hide resolved
Implements tooltips using Primer's `tool-tip` custom element.
56771fc to
5335ff5
Compare
mrmir
left a comment
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.
For the bug we discussed already regarding the tooltip not moving with the cursor
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.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
Outdated
Show resolved
Hide resolved
frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
Outdated
Show resolved
Hide resolved
0708ec6 to
0f1b0e6
Compare
Uses Primer's Popover component styles along with `anchored-position` custom element to position the popover. Switches to Primer utility classes for styling. See https://primer.style/product/components/popover/ See https://github.com/primer/behaviors/blob/main/src/anchored-position.ts
0f1b0e6 to
3995f80
Compare
mrmir
left a comment
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 fine as a popover, but the tracking/following behaviour needs to be figured out
Ticket
https://community.openproject.org/wp/68834
What are you trying to accomplish?
Implements tooltips using a Primer-style Popover - a
FIXMEfrom the jQuery removal work.Screenshots
What approach did you choose and why?
This (ab)uses Primer's tooltip - as it shows multiple lines of text (actually a list). Tooltips generally shouldn't contain this much information, but this was the quickest fix (and hopefully takes care of accessibility).Merge checklist