watson-developer-cloud / discovery-components

IBM Watson Discovery components
https://watson-developer-cloud.github.io/discovery-components/storybook
Apache License 2.0
22 stars 38 forks source link

feat: tooltip overlap pdf/text view #533

Closed dorianmiller closed 9 months ago

dorianmiller commented 10 months ago

What do these changes do/fix?

Added tooltip for overlapping enrichments.

PDF view

image

Text view

image

How do you test/verify these changes?

  1. Open a document in Discovery Tooling.
  2. Select 2 enrichment categories (until overlap is available)
  3. Hover over overlapping enrichments and verify tooltip content

Also, In Components sample app, test contracts visualization. Should be same as before. Some changes in the other views, required fixes in this view:

image

Have you documented your changes (if necessary)?

NA

Are there any breaking changes included in this pull request?

No

CLAassistant commented 10 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

noah-eigenfeld commented 10 months ago

Testing results

I keep running into cases where the tooltip isn't displayed all of the enrichments a highlight is associated with, even when the highlight correctly has the overlapping highlights color. At first, I thought it might be that the tooltip needed the two to be an exact match, but then I found examples like this one, where the same word is an exact match for two enrichments, and right next to each other is a highlight with both enrichments in the tooltip and one with a single enrichment.

Screenshot 2023-10-17 at 11 51 45 AM Screenshot 2023-10-17 at 11 51 38 AM

The above example is a dictionary overlapping with entities v2.

I also keep getting stuck with a ghost highlight/border stuck onscreen, often at different positions.

Screenshot 2023-10-17 at 11 58 41 AM

In addition to these, I see that using the arrows to navigate between highlights only scrolls the highlights into view some of the time in the text view, with no pattern I've found as to the type of enrichment that fails.

Edit: looks like the ghosting highlight is an existing bug. I'll write up a bug report for it.

dorianmiller commented 10 months ago

Screenshot 1 and 2: I updated the implementation to match the described design.