Update: working prototype + source code
I have continued experimenting with this idea and now have a working prototype based on Nautilus 50.3, tested on Fedora 44 / GTK 4.22.
The prototype is now available on GitHub:
Source code:
https://github.com/Jvia-code/nautilus-collapsible-groups
Current experimental release:
https://github.com/Jvia-code/nautilus-collapsible-groups/releases/tag/v3.3.2
I have also added screenshots showing the behavior in both list and grid views.
Current behavior
The implementation currently provides:
- grouping files by type;
- collapsible / expandable group headers;
- normal Nautilus sorting preserved inside each group;
- support for both list view and grid view;
- collapsed/expanded state remembered per directory;
- the same collapsed state reused when switching between list and grid views.
For example, Downloads can remember that some file types are collapsed while others remain expanded, independently from another directory.
Implementation notes
The prototype does not replace the system Nautilus installation. It uses a separate application ID and a private installation prefix so it can be tested alongside the Fedora-provided Nautilus.
The grouping layer is implemented on top of the Nautilus view model, while the existing sorting criterion remains responsible for ordering files inside each group.
For the list view, groups are represented as collapsible section rows.
The grid view required a different approach. A single flat GtkGridView does not naturally guarantee that a new logical group starts on a new visual row.
The current implementation therefore uses a vertical collection of groups, with each expanded group displaying its items through a GtkFlowBox.
Conceptually:
Group A
[ file ] [ file ] [ file ] [ file ]
[ file ] [ file ]
Group B
[ file ] [ file ] [ file ]
Group C
[ file ] [ file ]
This allows each group to wrap independently when the window is resized while ensuring that two different groups never share the same visual row.
Persistence
Collapsed groups are stored using a prototype-specific per-directory metadata key.
The experimental metadata and settings are kept separate from the normal Nautilus configuration.
Current grouping strategy
The prototype currently uses relatively specific file-type / MIME-based groups.
I think a more polished UX might instead use broader semantic categories such as:
- Folders
- Images
- Videos
- Audio
- PDF
- Documents
- Archives
- Other
This is one of the areas where feedback would be especially useful.
Repository
The GitHub repository contains:
- the Nautilus 50.3 patch;
- installation/uninstallation scripts;
- regression tests;
- reconstruction/development tools;
- screenshots;
- development notes.
The full upstream Nautilus source tree is intentionally not committed.
A packaged experimental snapshot is available from the GitHub Releases page.
Feedback
This is still a proof of concept, not an upstream-ready patch.
I would especially appreciate feedback from Nautilus maintainers regarding:
- whether collapsible grouping fits Nautilus’ UX direction;
- whether grouping should use MIME types or broader semantic categories;
- where grouping should live in the Nautilus model/view architecture;
- what approach would be preferred for sectioned grid layouts;
- whether per-directory persistence of collapsed groups makes sense.
The prototype has already made the original use case quite tangible for me: large mixed directories such as Downloads are much easier to scan while retaining the normal sort order inside each category.
I would be happy to adapt the prototype if there is interest in exploring the feature further.