godot icon indicating copy to clipboard operation
godot copied to clipboard

Deleting a file in the root folder (res://) scrolls filesystem dock all the way to the top

Open anniryynanen opened this issue 1 year ago • 5 comments

Tested versions

Reproduces in:

  • v4.3.rc1.official [e343dbbcc]
  • v4.2.2.stable.official [15073afe3]

System information

Windows 10.0.22631 - Vulkan (Forward+) - dedicated AMD Radeon RX 7700 XT (Advanced Micro Devices, Inc.; 32.0.11021.1011) - AMD Ryzen 7 5700X3D 8-Core Processor (16 Threads)

Issue description

When I delete a file in the root folder using the filesystem dock, the dock selects res:// and scrolls all the way to the top. Deleting a file in a subfolder acts the same as deleting a node in the scene tree - it leaves the selection empty and the scroll position isn't changed.

This bugs me because I don't want to scroll back down to continue what I was doing.

Steps to reproduce

  • Open MRP
  • Set window size so that the filesystem dock scrolls
  • Scroll filesystem dock to the bottom
  • Delete a file

Minimal reproduction project (MRP)

delete-from-root.zip

anniryynanen avatar Jul 27 '24 11:07 anniryynanen

I'll try to fix this.

anniryynanen avatar Jul 27 '24 11:07 anniryynanen

Sounds related to https://github.com/godotengine/godot/issues/92652.

akien-mga avatar Jul 27 '24 19:07 akien-mga

Possibly... although I think this scrolling is coming from FileSystemDock::_create_tree. If that's the root cause it's not the same one. I wrote some details about it in the contributor chat editor channel.

anniryynanen avatar Jul 27 '24 19:07 anniryynanen

When you delete a file i res:// it selects the res:// folder.

But when you delete a file in a subfolder it doesn't select any of the files (focus is on the container?) so if you navigate with keyboard and press down it scrolls back to the top.

Screencast_20240728_005030.webm

Maybe its the same cause? And would it be better if it selected the next file below or above, so scroll stays at same place and you can navigate with keyboard where you was too.

Giganzo avatar Jul 27 '24 23:07 Giganzo

Maybe its the same cause? And would it be better if it selected the next file below or above, so scroll stays at same place and you can navigate with keyboard where you was too.

It's kind of the same cause. It always clears the selection, it's just that in the case of res:// it also selects the root.

I think selecting a file next to the deleted one could be nice, but I'm guessing that would need to be a proposal. Clearing selection on deletion seems to be the standard way to do things across the editor.

anniryynanen avatar Jul 28 '24 06:07 anniryynanen