Skip to content

Conversation

@myabc
Copy link
Contributor

@myabc myabc commented Nov 6, 2025

Ticket

https://community.openproject.org/wp/68834

What are you trying to accomplish?

Implements tooltips using a Primer-style Popover - a FIXME from the jQuery removal work.

Screenshots

Screenshot 2025-11-10 at 15 30 01

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

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

@myabc myabc marked this pull request as ready for review November 6, 2025 13:20
Copilot AI review requested due to automatic review settings November 6, 2025 13:20
@myabc myabc added javascript Pull requests that update Javascript code needs review bugfix labels Nov 6, 2025
Copy link
Contributor

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.

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-tip custom 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>
        `;

@myabc
Copy link
Contributor Author

myabc commented Nov 6, 2025

@HDinger I think we can probably delete some of the styles in src/global_styles/content/_tooltip.sass as we're no longer using jQuery UI tooltip (AFAICT Backlogs doesn't use it)

@myabc myabc force-pushed the bug/68834-time-entries-calendar-tooltips branch 2 times, most recently from 9401acf to ce0fbf0 Compare November 6, 2025 13:27
@myabc myabc force-pushed the bug/68834-time-entries-calendar-tooltips branch from 56771fc to 5335ff5 Compare November 6, 2025 13:53
@myabc myabc requested a review from mrmir November 10, 2025 11:15
@myabc myabc added this to the 17.0.x milestone Nov 10, 2025
mrmir

This comment was marked as outdated.

Copy link
Contributor

@mrmir mrmir left a 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

@myabc myabc requested review from Copilot and mrmir November 10, 2025 15:44
Copy link
Contributor

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.

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

@myabc myabc force-pushed the bug/68834-time-entries-calendar-tooltips branch from 0708ec6 to 0f1b0e6 Compare November 10, 2025 16:17
@myabc myabc force-pushed the bug/68834-time-entries-calendar-tooltips branch from 0f1b0e6 to 3995f80 Compare November 10, 2025 16:19
Copy link
Contributor

@mrmir mrmir left a 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

@myabc myabc merged commit 5853e44 into dev Nov 11, 2025
17 checks passed
@myabc myabc deleted the bug/68834-time-entries-calendar-tooltips branch November 11, 2025 10:25
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

4 participants