Skip to content

Add thumbnail mode option - #1341

Open
infifox wants to merge 2 commits into
pop-os:masterfrom
infifox:thumbnail-config
Open

Add thumbnail mode option#1341
infifox wants to merge 2 commits into
pop-os:masterfrom
infifox:thumbnail-config

Conversation

@infifox

@infifox infifox commented Nov 1, 2025

Copy link
Copy Markdown

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

@jacobgkau jacobgkau left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

maria-komarova commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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

@infifox

infifox commented Nov 12, 2025

Copy link
Copy Markdown
Author

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

@johnnyq

johnnyq commented Dec 16, 2025

Copy link
Copy Markdown

I think this option can be merged sftp is a separate issue and it is related to large file counts

@jacobgkau

Copy link
Copy Markdown
Member

@johnnyq The other feedback still needs to be addressed, and if the option for network thumbnails is present, then it needs to work.

Lcstyle added a commit to Lcstyle/cosmic-files that referenced this pull request Jan 27, 2026
@infifox

infifox commented Feb 8, 2026

Copy link
Copy Markdown
Author

Sorry, I didn't get a chance to work on this. I ended up switching back to Windows because there's some software I need there.

Feel free to either close this or hand it over to someone, I won't be able to finish it unfortunately.

@Ihungry744

Copy link
Copy Markdown

Sorry, I didn't get a chance to work on this. I ended up switching back to Windows because there's some software I need there.

Feel free to either close this or hand it over to someone, I won't be able to finish it unfortunately.

How unfortunate. I hope someone can take over for this.

@Levo75

This comment was marked as off-topic.

@KodeBarista

KodeBarista commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The feature implementation seems to be working great but I found a couple of bugs which were fixed, as if this branch is based on older codebase.

  • Doesn't load system theme (even with v1 theme import & no frost applied)
  • Ctrl+Tab to switch between tabs doesn't properly work
  • The above operation also cause icons to zoom in & out during scroll
  • Uses mono font for dialog titles & outdated message
  • Sidebar entries become bold when right-clicked
image

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.

8 participants