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

Bug 472275

Summary: Code Edit Widget: Content assist dialog should adjust the tooltips position after it is resized.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, emoffatt
Version: 10.0   
Target Milestone: 10.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 468555    
Bug Blocks: 482522    

Description libing wang CLA 2015-07-09 07:18:25 EDT
When you resize the content assist by dragging the bottom-right corner, the proposal tooltip always stays there and in most of the cases it just overlaps the proposals. It is always an annoying issue when a proposal is long.
Comment 1 Curtis Windatt CLA 2015-07-09 09:47:15 EDT
The tooltip will recognize the size change if you switch proposals.  It looks like there is no straightforward way to listen for a resize event.  Eric mentioned there was some way to recognize it, but it had very poor performance implications.
Comment 2 libing wang CLA 2015-07-09 16:12:04 EDT
first cut of the fix with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=1afbd0d15e3ac6b5a85a50e25300ef5626f2535.
Will need to refine something in the TODO list inside contentAssit.js
Comment 3 Curtis Windatt CLA 2015-07-09 16:17:49 EDT
I thought mutation observers weren't typically used due to performance concerns:
https://developers.google.com/web/updates/2012/02/Detect-DOM-changes-with-Mutation-Observers?hl=en

Or is my knowledge way out of date?

Also, your TODO mentions just updating the size/position of the tooltip.  By passing true to _showTooltip, it should be calling tooltip.update(target).  update (vs show) is doing exactly that, only updating the positioning of the tooltip, not recreating contents.
Comment 4 libing wang CLA 2015-07-09 17:18:29 EDT
(In reply to Curtis Windatt from comment #3)
> I thought mutation observers weren't typically used due to performance
> concerns:
> https://developers.google.com/web/updates/2012/02/Detect-DOM-changes-with-
> Mutation-Observers?hl=en
> 
> Or is my knowledge way out of date?
> 

we only use it for FF. maybe we should just use timer for all browsers?

> Also, your TODO mentions just updating the size/position of the tooltip.  By
> passing true to _showTooltip, it should be calling tooltip.update(target). 
> update (vs show) is doing exactly that, only updating the positioning of the
> tooltip, not recreating contents.

That is what I thought at beginning. I thought tooltip.update(target) should not recreate contents but I just want to be cautious. Will double check tomorrow.
Comment 5 Eric Moffatt CLA 2015-07-10 14:42:58 EDT
Here's a tweak that allows us to skip the information gathering step and just update the tooltip's position.

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=fdc4582e3ac6e9093e99f22d7b2dfddc23c5ac26
Comment 6 libing wang CLA 2015-07-13 09:05:27 EDT
fixed.