Bug 575197

Summary: Sticky hovers are resized on F2
Product: [Eclipse Project] Platform Reporter: Thomas Wolf <twolf>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.20   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Thomas Wolf CLA 2021-08-02 12:35:03 EDT
I recently implemented proper sticky hovers for EGit's "Show Revision Information" command. (Revision annotations in the ruler; they show per-line revision information in a hover when a revision is moused-over in the ruler.)

That works beautifully when the hover is made sticky and enriched by moving the mouse cursor into it. However, when the user hits F2 to make the hover sticky and focus it, a completely different code path is taken and the hover is not only made sticky and enriched, but is also resized. The FocusedInformationPresenter enforces a maximum and minimum size of 100 * 12 "characters", and this size is not customizeable in any way.

The effect is also visible in the Javadoc hovers, but is less pronounced there because the initial non-sticky hover usually is small. Revision hovers, however, can be large -- they show information about the commit, the commit message, and a diff. With large commit messages or long diffs, the hover can rather tall. Resizing it on F2 is then very annoying (and surprising) for the user: the hover becomes sticky, but most of the useful information is no longer visible. The user either has to scroll in the now small hover, or resize it again manually.

There should be API by which this maximum size can be overridden by the IInformationControl. There is already API for it to tell its preferred size, but that gets then constrained by this minimum and maximum size imposed by FocusedInformationPresenter. See AbstractInformationControlManager.internalShowInformationControl().