Page MenuHome

New autoscrolling after renaming in the File Browser works weird
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Linux-5.13.0-0.rc6.45.fc35.x86_64-x86_64-with-glibc2.33.9000 64 Bits
Graphics card: NVIDIA GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 465.31

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-07-23 07:04, hash: rBf23b14091f60
Was introduced in rB6b0869039a40: File Browser: Select files and directories after renaming like this

Short description of error
New autoscrolling after renamin in the File Browser works weird (does not scroll to the item created/renamed)

Exact steps for others to reproduce the error
in the FileBrowser:

  • go to a directory with many files/folders
  • create a new folder or rename an existing folder
  • watch it scroll somewhere else

Event Timeline

Philipp Oeser (lichtwerk) renamed this task from New autoscrolling after renamin in the File Browser works weird to New autoscrolling after renaming in the File Browser works weird.Jul 23 2021, 4:24 PM
Philipp Oeser (lichtwerk) triaged this task as High priority.Jul 23 2021, 4:27 PM

Since this can get really annoying, I consider this a regression (before the commit - and with sorting by Date Modified you could at least make sure the new/renamed entry and focus would stay on top, now it always scrolls away) and will dare setting this to High prio.

We didn't change the scrolling logic, which I think was quite broken in master already. At least I know of cases where it didn't work either. This change exposes it much more though.

Aaron Carlisle (Blendify) changed the subtype of this task from "Report" to "Bug".Sep 27 2021, 7:48 PM
Aaron Carlisle (Blendify) moved this task from Backlog to bcon3: Bugs on the BF Blender (3.0) board.

Since I set this to High prio (it is still bugging me every day), will have a look.

The smooth auto scrolling (which isn't new functionality) has always had issues like that. It was entirely reworked at some point to address such issues, but without success. Think one of the main problems is that after actions like renaming, it is executed immediately, but the file list is first cleared and then rebuilt. So there is a moment where the scrolling may operate on an empty list, which messes things up.

So I think at this point we should simply remove the smooth auto scrolling, and just ensure the active file is in view bounds after loading using file_ensure_inside_viewbounds(). We can later port this to use UI_view2d_smooth_view(), and make sure that doesn't have conflicts with rebuilding the file list.

I think the problem is the deselection/selection in the code from rB6b0869039a40 [which resorts], not sure if you meant that?
Seems like getting the correct file again after resorting will fix this though, Diff incoming...

There might be situations where there is an empty list (havent run into this though I think), but the clear regression from the culprit commit should still be fixed?