Editor: user actions in Project Explorer cause items & folders recreation, loss of folder states #2105
Labels
context: ui/ux
type: bug
unexpected/erroneous behavior in the existing functionality
what: editor
related to the game editor
Milestone
Describe the bug
Whenever you do (almost) any operation with items within a Project Explorer, such as moving items around, changing their names, adding and deleting items, and so forth, the Editor regenerates whole project subtree with items and folders. Not only this is an inefficient operation, but also it causes all folders to loose their collapsed/expanded state. This makes it very inconvenient for users to work with these folders, especially when they rearrange items.
AGS Version
Any version starting with 3.2.2 which introduced folders.
To Reproduce
Expected behavior
Folders don't expand or collapse unless by user's direct command.
Cause and solution
The root of the problem is
RePopulateTreeView
method, which is sprinkled around all the Editor's Component classes. Whenever there's a change to a project item (added, deleted, moved, modified) this method is called, with the purpose of synchronizing project data and Explorer tree.As mentioned above, this is very inefficient, and also is causing inconveniences.
The way I see this, the solution is to write another method for data->ui synchronization that would not blindly recreate whole tree structure, but do it more gracefully. For example, compare item by item and see which have changed. Alternatively, make this method accept a hint from the caller, which tells about recent changes.
The text was updated successfully, but these errors were encountered: