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

Bug 453226

Summary: [Hover] Improve the placement and sizing of tooltips
Product: [ECD] Orion Reporter: Curtis Windatt <curtis.windatt.public>
Component: ClientAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: emoffatt
Version: 8.0   
Target Milestone: 9.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 429250    
Bug Blocks: 450152, 463009    

Description Curtis Windatt CLA 2014-11-25 13:58:41 EST
As we display more content in the tooltip, the size of the tooltip is more important.

1) Tweak the timings of tooltip fade/close so that users can easily mouse over content in the tooltip (specifically the tooltip can close while trying to mouse to a quickfix).

2) The tooltip should be placed above the caret location when there isn't enough space below.  It should also be shifted left when space on the right is limited (this may already happen).  There is logic that already does this for the content assist popup.

3) Ensure that it is easy to give the popup focus.  This allows the user to select content and interact with the tooltip without it closing.

4) Allow the user to resize the tooltip.  Perhaps this should only be available when the tooltip has focus.  We should also consider saving the new size.
Comment 1 Eric Moffatt CLA 2015-01-05 15:43:46 EST
I've committed code to organize how we position the tooltip and the 'hoverArea':

https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=57e7aeff515b444c4713c55e5d3f722c3012c56c

Note that this commit has some non-functional code in hover.js which is an early attempt to clean up the tooltips for the quickfix commands. This will be addressed in a future commit (once silenio gets back).
Comment 2 Curtis Windatt CLA 2015-02-23 11:13:59 EST
5) Tooltips opening on very short annotations (unnecessary comma for example) are very difficult to mouse to.  While the OKToHide function uses a focus area extending to the end of the tooltip, the OKToShow only uses the annotation text area.  This means that mousing even one pixel over while moving downward can close the hover.  I played around with always using the larger focus area, but then we don't change the content when a different annotation is found.
Comment 3 Curtis Windatt CLA 2015-03-25 13:16:02 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=9e075a7508d13d41bdad29003bae0d875de5a2e0

This ended up being a full refactoring of tooltip.js.  Now the order in which we perform the operations is very clear and we don't have state information being stored in multiple places.

There are TODOs in tooltip.js for further improvements we could make, but I have fixed all regressions I found.