o3de / o3de

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.
https://o3de.org
Other
7.85k stars 2.21k forks source link

Deleting a project in Project Manager does not remove the project tile #18452

Open spham-amzn opened 6 days ago

spham-amzn commented 6 days ago

Describe the bug In O3DE Project Manager, if there is only one project tile in the Projects page, deleting it will delete the project contents but does not remove the project tile. If there are multiple project tiles, deleting projects will remove them. This only occurs if there is only one project tile left and its the one that you want to delete.

Note that it will correct itself one a restart of the Project Manager, so exiting and re-launching it will fix it.

Steps to reproduce Steps to reproduce the behavior:

  1. Make sure the environment is clean (no pre-existing O3DE projects or .o3de folder)
  2. Install O3DE SDK
  3. Launch O3DE (Project Manager)
  4. Create a new project (using any template)
  5. In the option menu for the new project, click on Delete Project

Expected behavior The project is deleted from disk and the tile is removed from Project Manager

Actual behavior The project is deleted from disk but the tile still remains in Project Manager

Screenshots/Video

Found in Branch main (installer)

Commit ID from o3de/o3de Repository c602b493dbb91b246f479cb4fc35bbbcf3f55228

Desktop/Device (please complete the following information):

Additional context Add any other context about the problem here.

devldm commented 3 days ago

Hi, I'd happily look at solving this if i was assigned. I have a working PR (Currently in draft state), its a fairly simple solution that may need reworking if deemed too naive.

This would be my first contribution here.

I came across a few potential ways to fix this bug such as calling ResetScreenRequest(ProjectManagerScreen:Projects) in HandleRemoveProject() similar to HandleNewProjectButton() which worked but seemed like an not ideal solution and seemed to cause some visual bugs on manual testing.

It would also be possible / simple to pull RemoveProjectButtonsFromFlowLayout() out of the if(!projects.isEmpty() check and refactor it to handle "Empty" projects.

I've first focussed on the draft PR solution as it seemed like simplest solution to me. Happy to hear your thoughts!