Switching view causes forced reload
Affected version
- Nightly flatpak: Yes
- Other: All up until 44
Steps to reproduce
- Open a folder with a large number of items (e.g. /usr/bin)
- Toggle the list/grid view button.
- Toggle it again.
Current behavior
When view is toggled, the folder ir reloaded from scratch. Even when toggling back to the previous view, it still reloads from scratch.
Expected behavior
Switching view mode should be fast because it's just a different layout for the same content that's already loaded.
Additional information
This issue has been around since forever, but it has never been directly reported. I even searched the bugzilla and mailing list archives, but could only find a brief mention in a comment from 2006. I have a couple of hypothesis for this:
- the issue is too technical and abstract; it would contribute to the multiple "nautilus is slow" nonspecific reports, without anyone ever putting their finger on it;
- this issue becomes more visible when it exacerbates other performance issues, so spotlight would be on the other performance issues instead;
- people rarely switch view modes so the issue is less relevant -- or, reversing causality, users subconsciously avoid switching mode because they know it's slow and thus wastes time.
Regardless, I believe there are a few reasons why we should address this issue now:
- Make Files feel fast. It also resonates well with other performance improvements for version 45.
- Prevent workflow disruption. View mode is per-window, not per-folder, in order to avoids visual disruption when traversing the folder hierarchy; this design decision is grounded on the expectation that switching mode is itself simple, fast and non-disruptive.
- Prepare for adaptive list mode. In the near future we may want to switch to an alternative list view at small window sizes (#2448); triggering a full reload because of a window resize would be terrible.