Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 457356

Summary: [Hover] Tooltip always opens at the start of an annotation
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: ClientAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, emoffatt
Version: 8.0   
Target Milestone: 9.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2015-01-13 12:18:13 EST
Open org.eclipse.orion.client/bundles/org.eclipse.orion.client.editor/web/orion/editor/annotations.css

and hover over the end of a long-ish annotation like (hover over the last 'p'):

.annotationRange.selectedLinkedGroup {
	background-color: #53D1FF;
}

on line ~287. Notice the tooltip opens all the way over at the start of the annotation, making it pretty much impossible to mouse down to the resulting tooltip. I would expect the tooltip to open where the mouse cursor is.
Comment 1 Curtis Windatt CLA 2015-01-13 12:33:08 EST
If we don't want to move where the tooltip opens, the focus rectangle should be at least extended to the end of the annotation.  That would at least allow the tooltip to be reachable by mouse.
Comment 2 Eric Moffatt CLA 2015-01-13 15:18:04 EST
If we show the tooltip where the mouse is then we'd have to 'drag' the tooltip as the mouse moved to be consistent wouldn't we...

On the other hand you can cause quite long error annotations in the same file by messing with the url of the images (i.e. change 'url(' to 'url[('. Then if you scroll the editor to see the end of the line then hover won't show you the tooltip at all (so we have to do something).

Note that you should be ok to move the mouse anywhere within the text being annotated but perhaps there's an edge condition (literally).
Comment 3 Curtis Windatt CLA 2015-01-13 15:32:48 EST
(In reply to Eric Moffatt from comment #2)
> If we show the tooltip where the mouse is then we'd have to 'drag' the
> tooltip as the mouse moved to be consistent wouldn't we...

No, once the tooltip is opened it would be anchored from that location.  Moving the hover after that would be horrible, as it would be like your quickfix is running away from the mouse :)

> On the other hand you can cause quite long error annotations in the same
> file by messing with the url of the images (i.e. change 'url(' to 'url[('.
> Then if you scroll the editor to see the end of the line then hover won't
> show you the tooltip at all (so we have to do something).

Yes.  My suggested fix of extending the box wouldn't be enough for this case.

> Note that you should be ok to move the mouse anywhere within the text being
> annotated but perhaps there's an edge condition (literally).

My issue is that there is just a huge gap in the focus rectangle.  If you so much as touch a pixel below the text when moving the mouse, the tooltip closes.  The rectangle should extend past the end of the tooltip to the end of the annotation.  I believe the opposite already happens (if the tooltip is larger than the annotation, the focus rectangle extends to the edge of the tooltip).
Comment 4 Curtis Windatt CLA 2015-03-25 17:14:53 EDT
This has been significantly improved.  The outerArea rectangle in the tooltip covers the entire annotation, the tooltip and the extra space inbetween.  This makes it easy to move the mouse to click on any quickfixes.

We still have the problem where a very long annotation with its start scrolled off the view doesn't open a tooltip in a good place.  With recent changes to bound the tooltips, we place it at the far left side of the client.  This looks bad (opens in the navigation pane).  We should restrict the initial placement of the tooltips to the editor area, not the client area.

Next question is whether the entire tooltip should be restricted to the client area or if it is ok for a large tooltip to cover the nav pane.  There is a TODO in tooltip.js reminder to look at this.
Comment 5 Curtis Windatt CLA 2015-03-26 12:41:46 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2b1c3f5ed5607669b1cfe1c89e2a078ce6c5d2ae

This fix always limits the tooltip to the viewport area if it is available.  I also added support to shift the left and right tooltip positions upwards if we run out of room at the bottom of the editor.