Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
feat(repository): lazy loading, range selection + fix(repository): fix endless force delete #838
Lazy loading for thumbnails in repository (image browser)
On websites with a large amount of images (1000+) the image browser by default loads all thumbnails. This takes a lot of times and blocks further web requests until all images are loaded. To prevent this, I implemented lazy loading. Now only the thumbnails for currently visible images are loaded. Once the user resizes the window, scrolls it, uses the search function or uploads a new image, additional thumbnails are loaded on demand.
For reference see #800
Allow selecting of multiple images/files in repository (image browser) when holding the shift key
Sometimes you need to delete many images at once and selecting them one by one would take a lot of time. I added the possibility to select many images at once when holding the SHIFT key. A short demo is available here: http://recordit.co/UlMSj0cORr
Fix force-delete of images/files in repository (image browser)
The default delete function of the repository component supports deleting of multiple files and can handle the situation when one or multiple of the requested files could not be deleted for some reason. The user is then prompted to force delete the file, however, instead of requesting the deleting of only failed files, the repository component sends the whole list, including already deleted files to the server. This causes an endless loop as the server will always fail to delete some files as they have been removed in a previous request. I fixed this by filtering the file list sent to the server on force delete.
Unfortunately no one reviewed the previous commit, so I pushed more changes.
Of course, currently it is possible to select multiple files. The point here is that at the moment you need to click on each individual file to select it. Try selecting 100+ files like this and you will wish to have the possibility to select ranges of files by holding the shift key. You can have a look at the video I recorded to demonstrate the change.
The change doesn't break the old logic. You still are able to select multiple files by clicking on each of them. The range selection is just an additional feature.