Xcode Project Navigator does not consistently persist folder layout

Originator:enquiries
Number:rdar://32787072 Date Originated:September 18 2017
Status:Open Resolved:
Product:Xcode Product Version:
Classification: Reproducible:
 
Summary:
When using Xcode I've noticed that the Project Navigator (list of all folders and files on the left-hand side-bar) may expand unrelated folders during certain actions. Further, after tapping the disclosure icon to re-minimise the erroneously expanded directory, if you then navigate to another tab (e.g. the Source Control Navigator) and back to the Project Navigator, the directories will have once again expanded.

Steps to Reproduce:
1. Open Xcode
2. Create a new Single View iOS app via the template called 'Test'
3. The project is created with defaults including an expanded 'Test' directory in the Project Navigator
4. Right-click on the test directory and add new file > Swift file > Named 'Test'
5. Minimise the 'Test' directory so the Project Navigator displays two minimised directories, 'Test' and 'Product' within the expanded 'Test Project'
6. Navigate to the Source Control Navigator
7. Navigate back to the Project Navigator

Expected Results:
To see the same directory layout state as Step 5.

Observed Results:
The layout is the same as Step 4. My folder layout configuration has not persisted.

Notes:
This is the simplest situation to reproduce this issue. It is also repeated in many other situations. For example, try minimising all folders in the directory again, and adding a new top-level group. You will find the other, non-related, directories expand. Try minimising all the directories again. Then add a file to the new group. All the directories will expand... etc.

Comments

WORKAROUND

see the workaround at https://stackoverflow.com/a/48982427/113461.

  1. Input any number of letters in the file filter (input field at the bottom of the project navigator)
  2. Close Xcode immediately
  3. Reopen your Xcode
  4. MAGIC

Not the most intuitive user flow from Apple, but I'll take what I can get.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!