You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a folder with hundreds of files. Loading hasn't finished in Files. I select a file. It is previewed. After a few seconds, it changes to another picture. Then, it changes again.
changed the title [-]Image preview should not update when nothing changes[/-][+]Bug: Details should not keep changing as items are still loading[/+]on Jan 14, 2024
Powershell script to collect all images into c:\temp\full
$sourcePath="B:\"# Update this path$destinationPath="C:\temp\full"# Define the minimum free space required$minFreeSpace=1000MB# Search for .jpg files and process each file immediately when foundGet-ChildItem-Path $sourcePath-Recurse -Filter "*.jpg"|ForEach-Object {
# Calculate the current available space on the destination drive$driveInfo=Get-PSDrive-Name (Get-Item$destinationPath).PSDrive.Name
$availableSpace=$driveInfo.Free# Check if the available space is below the thresholdif ($availableSpace-le$minFreeSpace+$_.Length) {
Write-Host"Available space is below threshold. Stopping the copy process."break
}
$destinationFile=Join-Path-Path $destinationPath-ChildPath $_.Name# Check if the file already exists at the destinationif (Test-Path-Path $destinationFile) {
Write-Host"File already exists, skipping: $destinationFile"return# Skip this file and move to the next one
}
# Copy the file to the destinationCopy-Item-Path $_.FullName-Destination $destinationFileWrite-Host"Copied: $($_.FullName) to $destinationPath"
}
Write-Host"Copy operation completed."
Now it is very different. While loading the directory contents, it jumps away from the selected image. Meaning: I click on an image, then the selection moves away...
Should I open a new issue for that or should we discuss on this issue?
I think the actual issue is that sorting items clears the selection (items are sorted after they are finished loading). You can confirm by selecting an item and changing the sort direction.
changed the title [-]Bug: Details should not keep changing as items are still loading[/-][+]Bug: Changing sort option clears selected items[/+]on Oct 13, 2024
Now it is very different. While loading the directory contents, it jumps away from the selected image. Meaning: I click on an image, then the selection moves away...
Perhaps I was a bit hasty in editing the issue details 🙂
Now it is very different. While loading the directory contents, it jumps away from the selected image. Meaning: I click on an image, then the selection moves away...
Can you clarify where the selection moves to?
It moves down... I think, the tool gets the files in some random order, but displayes it in alphabetical order.
Hi, I'd like to work on this one if it's still open. From reading the code, it looks like re-sorting rebuilds the list in one reset, which drops the selection. I'll confirm on a current build and restore the selection after the sort, and check the group-by options too since they take the same path.
Got it, thanks for letting me know. I'd already traced it, so here's what I found in case it saves whoever picks this up some time.
In ShellViewModel.cs (around line 500), all 4 sort handlers end in ApplyFilesAndFoldersChangesAsync. That clears the list and re-adds every item in one bulk operation (line 1157), so the ListView gets a single Reset. The Reset is what drops the selection.
The fix looks small. The ListedItem objects stay the same references after OrderFileList, so I'd copy SelectedItems in BaseShellPage.cs before the update and call ItemManipulationModel.SetSelectedItems afterwards. Grouping probably has the same bug, since GroupPreferenceUpdatedAsync in BaseLayoutPage.cs also ends in a bulk reset.
One caveat: I haven't run this on a build yet. Treat it as a lead. PR #2883 tried the same thing back in 2021 and was closed when its author went quiet, so it might be worth a look too.
Activity
Josh65-2201 commentedon Dec 17, 2023
Thanks for the report, Do you mean the image that is selected changes or the preview reload the same image?
koppor commentedon Dec 19, 2023
No. The selected images stays the same.
The preview reloads every few seconds with another image.
[-]Image preview should not update when nothing changes[/-][+]Bug: Details should not keep changing as items are still loading[/+]yair100 commentedon Jan 14, 2024
How many items are in the folder?
koppor commentedon Jan 15, 2024
Maybe 1500 on a Samba file share. Could be 2500.
yair100 commentedon Jan 15, 2024
Is this only an issue on the Samba share or can you repro it on a local drive as well?
yair100 commentedon Feb 22, 2024
@koppor
koppor commentedon Mar 5, 2024
As of today, its even worse. I click a file. preview is there. Then it is deselected and I have endless loading:
(image removed)
The app is totally unresponsive.
Test setting: Folder with 88.000 images.
In comparison, Windows Explorer loads every fast:
(image removed)
yair100 commentedon Mar 5, 2024
koppor commentedon Mar 5, 2024
C:\temp\full with 80.000 files (shown above) is in a locally attached M2 disk. NTFS formatted. No Samba share.
One can see the local path in the Files Screenshot.
I promise, I did not create a symlink and that it is really a local directory.
koppor commentedon Mar 6, 2024
Update:
Powershell script to collect all images into
c:\temp\fullyair100 commentedon Oct 1, 2024
Is this still an issue in the preview version? https://files.community/download/preview
koppor commentedon Oct 13, 2024
Now it is very different. While loading the directory contents, it jumps away from the selected image. Meaning: I click on an image, then the selection moves away...
Should I open a new issue for that or should we discuss on this issue?
yair100 commentedon Oct 13, 2024
I think the actual issue is that sorting items clears the selection (items are sorted after they are finished loading). You can confirm by selecting an item and changing the sort direction.
[-]Bug: Details should not keep changing as items are still loading[/-][+]Bug: Changing sort option clears selected items[/+]koppor commentedon Oct 13, 2024
The blue selection arrow moved down while loading - no selection clearing was made.
yair100 commentedon Oct 13, 2024
Perhaps I was a bit hasty in editing the issue details 🙂
Can you clarify where the selection moves to?
koppor commentedon Oct 13, 2024
It moves down... I think, the tool gets the files in some random order, but displayes it in alphabetical order.
yair100 commentedon Oct 13, 2024
To the next file? Are you able to upload a screen recording (you can upload directly to GitHub)?
koppor commentedon Oct 14, 2024
I need to create a script to create random images (because I don't want to share my private images here on GitHub using a video).
After the second run, it seemed to keep the positoin. However, after switching back to the application after 2 hours, it just hangs:
h-sane commentedon Nov 30, 2026
Hi, I'd like to work on this one if it's still open. From reading the code, it looks like re-sorting rebuilds the list in one reset, which drops the selection. I'll confirm on a current build and restore the selection after the sort, and check the group-by options too since they take the same path.
yair100 commentedon Nov 30, 2026
@h-sane due to an increase in AI generated PRs, we're currently only accepting PRs from previous contributors.
h-sane commentedon Nov 30, 2026
Got it, thanks for letting me know. I'd already traced it, so here's what I found in case it saves whoever picks this up some time.
In ShellViewModel.cs (around line 500), all 4 sort handlers end in ApplyFilesAndFoldersChangesAsync. That clears the list and re-adds every item in one bulk operation (line 1157), so the ListView gets a single Reset. The Reset is what drops the selection.
The fix looks small. The ListedItem objects stay the same references after OrderFileList, so I'd copy SelectedItems in BaseShellPage.cs before the update and call ItemManipulationModel.SetSelectedItems afterwards. Grouping probably has the same bug, since GroupPreferenceUpdatedAsync in BaseLayoutPage.cs also ends in a bulk reset.
One caveat: I haven't run this on a build yet. Treat it as a lead. PR #2883 tried the same thing back in 2021 and was closed when its author went quiet, so it might be worth a look too.