Files
test/source
Philipp Oeser adcea77c49 Fix #140257: Asset Browser Frame Selected wrong after a search
Also true (and reported) for the general File Browser.

In the implementation from 5a67407d5a it was noted that including the
active file was desirable(next to `FileSelection` `first` and `last` of
course).

`FileSelection` indices get correctly updated after search is altered/
cleared (by `file_current_selection_range_get`), the `FileSelectParams`
`active_file` however isnt.

This makes the framing go wrong when search is altered or cleared (it
uses an index from the previous/outdated filter result).
I case of the Asset Browser (in main) this was also obvious when you
looked at an active asset in the sidebar -> clearing a search (after
having selected something while searching) for example would make a
"completely different" asset active.

Since keeping track of a "previous" `active_file` (and trying to update
to an updated/correct index) turned out to be quite hairy, this PR goes
the route of actually clearing the `active_file` on search updates. Like
mentioned, this is still not ideal (at least for the Asset Browser, it
looses the "active" of something selected), but at least now you can
easily frame it again -- and is is better than in main (where "active"
would point to something completely unrelated and you could not even
frame it to click-activate it again).

Pull Request: https://projects.blender.org/blender/blender/pulls/140365
2025-06-17 16:31:40 +02:00
..