Bug 363598 - [quick fix] Improve UI for multi fixes in Ctrl+1 popup
Summary: [quick fix] Improve UI for multi fixes in Ctrl+1 popup
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 11:00 EST by Deepak Azad CLA
Modified: 2020-02-21 04:59 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-11-11 11:00:54 EST
I always thought that multi-fixes are available only in the problem hover, and didn't realize the Ctrl+Enter trick in the Ctrl+1 popup until today :(

I think it is easy to miss the message mentioning the Ctrl+Enter trick at the bottom of the popup. Even if you know the trick you have to select each quick fix proposal and look down to check if it is a multi-fix or not.

Ideally there should be visual cues available for all quick fix proposals the moment the quick fix pop-up comes up. Maybe one of the following can be done
a) Follow a pattern similar to the problem hover, i.e. show an additional proposal for the multi-fix case. Would this also enable us to show a preview?
b) In the problem hover we use a 'double icon' for the multi-fix link i.e. 2 overlapping green curved arrows or 2 overlapping red X. Can we use the same icons in the Ctrl+1 popup for a quick fix proposal which is also available as a multi-fix? (But maybe this confuses people that the quick fix is only a multi-fix)
c) Add a number in the popup to the right of a multi-fix name, something like we do for Search results or Call Hierarchy. 
e.g. X Remove unnecessary '$NON-NLS$' tag (2)
Here (2) indicates the number of problems in the file.

I would prefer (a), but (c) might be easier to implement. Or maybe someone else has a better idea :-)
Comment 1 Markus Keller CLA 2011-11-14 05:56:01 EST
a) Adding the multi-fixes to the current flat list would make the list even longer and thus harder to use. In the hover, multi-fixes are indented, so it is easier to skip them when scanning through the proposals.

b, c) Maybe we could alleviate this by indenting items as well, but TableItem#setImageIndent(int) is not available on all platforms.

If we add something to the single-fix icon or label, it has to be clear that the quick fix only fixes 1 problem and not all of them. We already tried to combine the two options on one line in the hover, but we couldn't find a satisfying solution, so we went for two lines.
Comment 2 Deepak Azad CLA 2011-11-14 06:48:33 EST
Maybe the label/icon can be changed when the user presses 'Ctrl', this would be similar to the behavior in Content Assist popup for replacing an existing identifier in the editor.

(Though this would still have the disadvantage that you need to know the trick)
Comment 3 Markus Keller CLA 2016-04-15 12:17:51 EDT
There are some more problems with multi-fixes when you give focus to the proposal popup:
- The "Press 'Ctrl+Enter' to fix <n> problems ..." message stays whatever it was when the popup got focus. It should continue to be updated when the selection changes.
- Ctrl+Enter doesn't work, because that doesn't send a DefaultSelection event, but a Traverse event.
- Ctrl+Doubleclick does apply the multi-fix if one is available
Comment 4 Markus Keller CLA 2016-04-15 12:36:10 EDT
(In reply to Markus Keller from comment #3)
> - Ctrl+Doubleclick does apply the multi-fix if one is available

... at least on Windows and after http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=ffc17b55a858eac8507427f57a0bddfc11d08996 . The stateMask sometimes includes mouse button state, although this was not specified before bug 380257.