Bug 539869 - Project Explorer/Nested Projects - Child projects move around and folders collapse on file save
Summary: Project Explorer/Nested Projects - Child projects move around and folders col...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.9   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.11 M3   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on: 541232
Blocks:
  Show dependency tree
 
Reported: 2018-10-05 21:32 EDT by Larkin Lowrey CLA
Modified: 2019-02-01 05:55 EST (History)
4 users (show)

See Also:


Attachments
Screen recording showing file bad Project Explorer behavior (207.51 KB, image/gif)
2018-10-05 21:32 EDT, Larkin Lowrey CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Larkin Lowrey CLA 2018-10-05 21:32:10 EDT
Created attachment 276149 [details]
Screen recording showing file bad Project Explorer behavior

Project Explorer exhibits bad behavior with my multi-module maven projects.

Periodically, when I save a file, all of the expanded folders of one or more of the module projects collapse and the module projects move to different positions within the parent.

See the animated gif that I attached. I made a trivial change, saved (ctrl-s), then you'll see that the open tree items in 'api-common-test' all collapse and 'api-common-test' moves above 'api-common-shared'.

I am constantly having to re-open tree elements. It's killing my productivity.

I only see this behavior for multi-module maven projects and only the individual module projects are effected. The other projects in the workspace are not effected.
Comment 1 Rolf Theunissen CLA 2018-11-09 10:02:59 EST
I see similar behavior, and it is not only triggered by saving files. It is basically triggered anytime a file changes. Especially during code generation, project keep jumping around.

What seems to happen is that project that are marked changed by GIT are sorted to be in top. However, sometimes it seems to switches back to alphabetic shorting. This could be while the GIT markers are being refreshed on the tree.

This jumping around of projects is really annoying.
Comment 2 Rolf Theunissen CLA 2018-11-09 11:20:10 EST
Having a closer look at what happens, its seems that the '>' decoration is sorted before 'a-z'. As such, the project moves to the top as soon as a change is detected by GIT.

Most likely not a JDT bug, but eGIT or Platform.
Comment 3 Andrey Loskutov CLA 2018-11-09 11:34:38 EST
This must be a bug in Common Navigator code. Packages Explorer doesn't show such behavior. Most likely common sorter uses *decorated* element names to sort.

Rolf, is this a recent regression? In which release do you observe it?
Comment 4 Rolf Theunissen CLA 2018-11-09 12:06:20 EST
I see the behavior on 2018-09 on Windows, it did not exist on Oxygen releases, not tested on Photon.

It seems that the decoration is not taken in account all the time, refreshing (F5) on the root of the nested project makes them jumping around.
Comment 5 Andrey Loskutov CLA 2018-11-09 12:11:20 EST
(In reply to Rolf Theunissen from comment #4)
> I see the behavior on 2018-09 on Windows, it did not exist on Oxygen
> releases, not tested on Photon.
> 
> It seems that the decoration is not taken in account all the time,
> refreshing (F5) on the root of the nested project makes them jumping around.

This rings the bell. Is this happening for nested projects only? 
@Mickael - something related to your changes?
Comment 6 Mickael Istria CLA 2018-11-09 12:15:07 EST
(In reply to Andrey Loskutov from comment #5)
> @Mickael - something related to your changes?

Could very well be.
Comment 7 Rolf Theunissen CLA 2018-11-09 12:16:53 EST
I can confirm that it only happens only for nested projects. When 'flat' representation for projects is selected they all stay in place.
Comment 8 Mickael Istria CLA 2018-11-09 12:18:42 EST
(In reply to Rolf Theunissen from comment #7)
> I can confirm that it only happens only for nested projects. When 'flat'
> representation for projects is selected they all stay in place.

Ok. This kind of thing of
Comment 9 Mickael Istria CLA 2018-11-16 10:24:27 EST
Bug 541232 is dedicated to the sorting issue and a patch should be provided very soon. Maybe it will be enough to fix this bug, we'll see. But because they're incepted from different case (this one is first about collapse and the other one about sorting), I'll keep them separated at the moment.
Comment 10 Mickael Istria CLA 2018-11-16 10:38:21 EST
Can someone please give a try to https://git.eclipse.org/r/#/c/132578/ and report whether this helps or not?
Comment 11 Rolf Theunissen CLA 2018-11-19 04:26:36 EST
I tried the patch, by applying it to my current 2018-09 install. It does not seem to have any difference.

I did notice something else, in the Project Explorer:
- If the sort order is correct and when I press 'F5' once, then nothing happens and the sort order remains the same.
- If the sort order is incorrect (e.g. '>' on top) and when I press 'F5' once, then the projects move around and collapse, and the sort order is correct again.
- When I press 'F5' twice quickly, i.e. trigger the second refresh before the first finished, then the projects move around and collapse, and the sort order becomes incorrect.

The same behavior can be triggered by saving a file twice quickly, in that case, the folder/file with the current selection is not collapsed.
Comment 12 Mickael Istria CLA 2018-11-19 06:28:29 EST
I think that bug 541300 could be another symptom of the same issue.
Comment 13 Larkin Lowrey CLA 2019-01-16 15:21:25 EST
This still occurs in v4.10 (2018-12).

Any update?
Comment 14 Mickael Istria CLA 2019-01-25 10:35:55 EST
It could be a symptom of bug 541232 that was fixed recently.
Can someone who face this issue deterministically download a recent integration build from https://download.eclipse.org/eclipse/downloads/index.html , install EGit in it and check whether the issue still happens?
Comment 15 Mickael Istria CLA 2019-02-01 05:54:52 EST
I've not seen this issue happening recently (I'm using I-Builds). Assuming it's fixed then.