Bug 550560 - Rename dialog shown after inline editing
Summary: Rename dialog shown after inline editing
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.13   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.14 M3   Edit
Assignee: Andrew Obuchowicz CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 548877 551494 560113
  Show dependency tree
 
Reported: 2019-08-29 05:52 EDT by Lars Vogel CLA
Modified: 2020-04-14 08:29 EDT (History)
10 users (show)

See Also:


Attachments
Video (837.95 KB, video/mp4)
2019-08-29 05:52 EDT, Lars Vogel CLA
no flags Details
Don't show rename dialog for simple changes (269.74 KB, image/gif)
2019-10-02 15:49 EDT, Andrew Obuchowicz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-08-29 05:52:34 EDT
Created attachment 279711 [details]
Video

Bug 548877 introduced inline editing in the project explorer.

Thanks for that. But if I rename certain resources, for example a folder, I still get a rename dialog AFTER the inline editing. See attached video.
Comment 1 Lars Vogel CLA 2019-08-29 05:53:19 EDT
Andrew, can you please have a look?
Comment 2 Mickael Istria CLA 2019-08-29 06:21:01 EDT
The rename action still relies on the refactoring action (that's desired and not something we should/can change). At the moment, to minimize the risk, the inline renaming will show the dialog whenever there is a refactoring handler for the rename action; this allows for example to get the preview.
We could imagine a way to perform the refactoring action without having the dialog for cases where the refactoring action provides no option. However, I don't know how easy it would be to implement.

I'm removing Andrew as assignee at the moment to make it clear that anyone is free to work on it. I'll let Andrew mark himself as assignee when he starts working on it (if ever ;).
Comment 3 Andrey Loskutov CLA 2019-09-16 07:23:13 EDT
(In reply to Mickael Istria from comment #2)
> The rename action still relies on the refactoring action (that's desired and
> not something we should/can change). At the moment, to minimize the risk,
> the inline renaming will show the dialog whenever there is a refactoring
> handler for the rename action; this allows for example to get the preview.

The preview just says "A" will be renamed to "B", so what's the value?

I'm sorry I didn't validated the original feature during implementation, because I could not imagine that "inline rename" makes the rename process *longer*, not faster.

4.12: F2 -> typing -> Enter
4.13: F2 -> typing -> Enter -> Enter (+ surprise about dialog)

This is surprising at least, or, in my POV, doesn't make any sense.

(In reply to Mickael Istria from comment #2)
> We could imagine a way to perform the refactoring action without having the
> dialog for cases where the refactoring action provides no option. However, I
> don't know how easy it would be to implement.

As long as we are thinking about a proper "final" solution, we require a possibility to disable this "inline rename" at least via product customization (without UI), or, if anyone needs, with an extra new entry on preferences UI page. I will add this on the internal list of patches that we (Advantest) expect to be fixed in 4.14 before we can migrate. We plan contribute this "product customization" way to disable this "inline renaming" if there will be no other way to get rid of the extra dialog.
Comment 4 Mickael Istria CLA 2019-09-16 07:34:29 EDT
(In reply to Andrey Loskutov from comment #3)
> The preview just says "A" will be renamed to "B", so what's the value?

Some cases of rename are refactoring and build complex composite actions. For those, the Preview is valuable.
Some refactoring actions also have options (java refactoring among them) that needs the user to review them. So for this case, we can't even skip the dialog.

At the moment, I think the LTKRenameAction could be tweaked so that if it's a plain resource without specific refactoring handler and a name is pre-set, then we can skip the dialog and just apply.
But for the case when the dialog has options, I don't think it's possible to skip it, nor that it's possible from inside the RenameHandler to know in advance whether there will be need for a dialog or not at the moment. Maybe we could add some extra API to LTKRenameAction to inform about that in advance.
Comment 5 Dani Megert CLA 2019-09-16 12:42:03 EDT
(In reply to Mickael Istria from comment #4)
> But for the case when the dialog has options, I don't think it's possible to
> skip it, nor that it's possible from inside the RenameHandler to know in
> advance whether there will be need for a dialog or not at the moment. Maybe
> we could add some extra API to LTKRenameAction to inform about that in
> advance.
Definitely that needs to happen I do not want to start inline and see a dialog after 'Enter'. This will get a -2 in the future from me.
Comment 6 Mickael Istria CLA 2019-09-16 12:48:17 EDT
(In reply to Dani Megert from comment #5)
> Definitely that needs to happen I do not want to start inline and see a
> dialog after 'Enter'. This will get a -2 in the future from me.

In a first iteration, we may make it a preference "always use inline renaming", as the case of refactoring dialog being important typically doesn't affect some EPP packages (like Rust or JavaScript) where inline renaming is nicer than dialog.
Comment 7 Andrew Obuchowicz CLA 2019-09-19 10:17:39 EDT
Thanks for the feedback Dani and Andrey.
I'm working on adressing the abovementioned issues and have been making progress.
Comment 8 Eclipse Genie CLA 2019-10-02 15:30:32 EDT
New Gerrit change created: https://git.eclipse.org/r/150517
Comment 9 Andrew Obuchowicz CLA 2019-10-02 15:49:20 EDT
Created attachment 280146 [details]
Don't show rename dialog for simple changes

The latest patch I submitted does not show the dialog for cases where the rename operation only affects the file being renamed.

@Andrey & Dani, let me know your thoughts.
Comment 10 Eclipse Genie CLA 2019-10-09 15:22:59 EDT
New Gerrit change created: https://git.eclipse.org/r/150854
Comment 11 Eclipse Genie CLA 2019-10-09 15:28:16 EDT
New Gerrit change created: https://git.eclipse.org/r/150855
Comment 12 Eclipse Genie CLA 2019-10-09 15:29:02 EDT
New Gerrit change created: https://git.eclipse.org/r/150856
Comment 13 Eclipse Genie CLA 2019-10-31 15:49:48 EDT
New Gerrit change created: https://git.eclipse.org/r/151857
Comment 15 Mickael Istria CLA 2019-11-06 11:20:16 EST
@Andrew: now the JDT part is merged, can you please rework the Platform UI part to rely on those changes. It should be a matter of reverting https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=c99322eec70b19200e9b8dbc9e45f2b25e751fdb and tweaking it a bit, isn't it?
Or is there a patch ready for review on that area?
Comment 16 Andrew Obuchowicz CLA 2019-11-06 15:04:39 EST
(In reply to Mickael Istria from comment #15)
> Or is there a patch ready for review on that area?

Yes, this is the new Platform UI patch which relies on those changes: https://git.eclipse.org/r/#/c/151857/
Comment 18 Eclipse Genie CLA 2019-11-13 11:00:17 EST
New Gerrit change created: https://git.eclipse.org/r/152589
Comment 20 Christian Dietrich CLA 2020-02-13 09:06:59 EST
hi, what has been actually fixed for that. if i rename a Xtend file inline i get another rename resource dialog in project explorer after the rename. any idea? shouldnt the fix be generic (4.15.0M2)
Comment 21 Christian Dietrich CLA 2020-02-13 09:13:33 EST
seems to be caused by

// Let user see rename dialog with preview page for composite changes or if another RefactoringProcessor is used (which may offer rename options)
					if (newName == null || change == null || isCompositeChange(change) || !(processor instanceof RenameResourceProcessor)) {
						RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(refactoringWizard);
						op.run(activeShell, RefactoringUIMessages.RenameResourceHandler_title);
					} else {
						//Silently perform the rename without the dialog
						change.perform(new NullProgressMonitor());
					}

which i dont understand. 
why is a dialog shown if there is a composite change?
Comment 22 Andrey Loskutov CLA 2020-02-13 09:48:20 EST
Yep. We use XText and we see in our IDE that rename on every Xtext related file opens a dialog *after* inline rename and to make things worse, the "OK" in the dialog is grayed out and user has to change already changed name *again* in order to continue.

I see here at least two major issues:

1) The code obviously doesn't work with XText based files.
2) It is inconsistent. In our projects, where every second file is from an xtext related provider we have totally inconsistent "F2" behavior - sometimes it opens a dialog, sometimes "inline" edit, sometimes *both* inline editor and dialog (due point 1).

As a product owner, I see no reason why should I explain users why can't they see a *consistent* rename behavior in same project for two sibling files, no one will understand / accept that.

With the dialog rename was consistent - we simply had differently complex dialogs, but usage was very similar. Now it just feels wrong.

Re-opening this bug for the fix problem with XText based file types.
I will open another one to disable "inline" rename entirely via preference for those who want to have consistent rename behavior.
Comment 23 Dani Megert CLA 2020-02-13 10:02:40 EST
(In reply to Andrey Loskutov from comment #22)
> Re-opening this bug for the fix problem with XText based file types.
> I will open another one to disable "inline" rename entirely via preference
> for those who want to have consistent rename behavior.
Please open a new bug.
Comment 24 Andrey Loskutov CLA 2020-02-13 10:27:45 EST
(In reply to Dani Megert from comment #23)
> (In reply to Andrey Loskutov from comment #22)
> > Re-opening this bug for the fix problem with XText based file types.
> > I will open another one to disable "inline" rename entirely via preference
> > for those who want to have consistent rename behavior.
> Please open a new bug.

See bug 560113 for "double rename" and bug 560100 for a new preference to disable inline rename.
Comment 25 Andrew Obuchowicz CLA 2020-02-27 09:40:48 EST
Setting this to VERFIED FIXED as the related bugs (bug 560100 & bug 560113) have been fixed.