Skip to content

Conversation

@infifox
Copy link

@infifox infifox commented Nov 1, 2025

Issues addressed

This PR attempts to address the following issues:

It is also a replacement for this unmerged PR:

User interface changes

This PR adds an option for the user to configure how they would like to generate thumbnails:

image

The default is the current behavior, where thumbnails are generated only for local files. The user will also be able to choose to generate thumbnails for remote files, or to generate no thumbnails.

Technical details

This PR replaces #1224 with a setting that controls both the option to always generate thumbnails, as well as the option to never generate them. I think it makes sense to have both of these options combined into a single setting, and sets up possibility of adding more complex options in the future.

In order to make this change, I've modified the existing behaviour which preloads the thumbnail_opt property for an Item struct with a Some(ItemThumbnail::NotImage) value to prevent the thumbnail from being generated. Instead, I now include a new item_location property which keeps track of whether the item is local, remote, or in the trash. This allows the decision on whether or not to generate a thumbnail to be made within the Tab, avoiding the need to pass the new thumbnail_mode value all the way through the file scanning process.

I've also added a new method item.allow_generate_thumbnail to collect all the logic for whether or not a thumbnail should be generated in a single place, so it should be easier to expand this logic in the future.

A new message tab::Message::ThumbConfig has been added to the Tab, to enable changes to this setting to be immediately propagated to open tabs.

@jackpot51 jackpot51 requested review from a team November 12, 2025 02:06
Copy link
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I set this to Show for local and network files, it makes folders on an SFTP mount load slightly slower, but it's not showing thumbnails for images in the SFTP mount (e.g. screenshots of the same format that have thumbnails shown locally). Watching the network activity in System Monitor, it doesn't look like it's receiving enough data to really be trying to thumbnail everything in the SFTP mount's folders when it's enabled.

Also, I'm wondering if the "always show" and "never show" should be on opposite ends, with "show on local only" between them, since that would be the logical spectrum. The only reason to have "show on local only" on one end is because it's the default. That's a @pop-os/ux question.

@maria-komarova
Copy link
Contributor

Also, I'm wondering if the "always show" and "never show" should be on opposite ends, with "show on local only" between them, since that would be the logical spectrum. The only reason to have "show on local only" on one end is because it's the default. That's a @pop-os/ux question.

I think the setting might be better as the dropdown rather than a whole section with radio buttons. I also wonder if "File preview" might be easier to understand than "Thumbnails". I'm fine with changing the order of the options to "Local and network files, Local files only, Never.
image

@jacobgkau
Copy link
Member

I just had network thumbnails start working after leaving the setting on that for a while. Investigating what I did to trigger it.

@jacobgkau
Copy link
Member

@maria-komarova Would "file preview" not be ambiguous with the spacebar gallery previewer?


I did notice that if I have this set to Show for local and network files, then I change it to Show for local files only, thumbnails that were already generated over the network still show up. This doesn't match the behavor for local directories; if I change from Show for local files only to Never show, then thumbnails in a local folder disappear immediately.

I'm observing thumbnails not working on the network mount again after turning them to Show for local and network files again-- I've tried navigating out of the SFTP mount and back in, unmounting and re-mounting the SFTP mount, and completely killing/quitting and re-launching COSMIC Files, and completely rebooting, and none of that gets thumbnails working on the SFTP mount immediately.

@maria-komarova
Copy link
Contributor

Would "file preview" not be ambiguous with the spacebar gallery previewer?

Maybe. But I can't yet think of a better way to describe the thumbnails. And thumbnails could be understood as an icon as well as a render so also ambiguous.

@maria-komarova
Copy link
Contributor

maria-komarova commented Nov 12, 2025

It's fine if we stick with "Show file thumbnails" and a dropdown at the end of the list item. Maybe I'm overthinking that one.

@jacobgkau
Copy link
Member

Merriam-Webster and Wikipedia both indicate the word "thumbnail" is specifically a miniature representation of an image, and the word "thumbnail" also exists outside of the computing world in art contexts. I think there's less chance of getting thumbnails mixed up with non-thumbnail icons (which are just called icons) than the file previews terminology, personally.

@maria-komarova
Copy link
Contributor

Yes, I checked the definitions as well. Let's go with "Show file thumbnails" followed by a dropdown.

@infifox
Copy link
Author

infifox commented Nov 12, 2025

Cool, I'll change the setting to a dropdown, and look into the SFTP issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants