Enhance batch archive extraction and improve navigation UX - #385
Open
ScottRFrost wants to merge 4 commits into
Open
Enhance batch archive extraction and improve navigation UX#385ScottRFrost wants to merge 4 commits into
ScottRFrost wants to merge 4 commits into
Conversation
Refactor archive extraction to improve performance and UX: introduce ExtractEntriesAsync (and an ExtractEntryAsync wrapper) to extract multiple entries with a single archive open, and make PrepareArchiveAsync return ordered entry keys for staged extraction. NavigationService now shows a loading indicator, seeds the iterator with up to 10 extracted files for immediate viewing, and extracts the rest in the background. ImageTitleFormatter guards FileInfo.Exists before accessing Length. Update and add tests for the new extraction flow and navigation behavior.
Adds archive extraction progress tracking and background extraction scheduling for archive content loading. The navigation and file watcher flow now waits for newly extracted files and updates navigation state while archive imports are in progress. File picker and save operations are guarded against missing UI/storage providers, and several tests were serialized to avoid interference in headless/parallel execution.
The archive navigation flow now stages the first extracted item(s) for immediate viewing while background extraction continues, and navigation checks allow moving past the final extracted entry during staged extraction. Cleanup logic was tightened to avoid canceling the active extraction token when deleting old temp directories, and the UI progress indicator now follows the actual archive progress text instead of the raw extraction state. Tests cover both the full-archive and staged-archive paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I was pretty happy with the new 'Navigation > Always uncompress entire archive folder' feature I added in my last PR, but I wanted to improve it further. In the last version, when you had the new option checked it would extract the whole archive, but the UI would block with a spinner while it was extracting. In the new version, it now uncompresses the first 10 images, then unblocks the UI so you can start viewing them while the remaining images are uncompressed in batches of 10 with a small status indicator in the bottom right corner.
Obviously up to @Ruben2776 but I think this feature is ready to be enabled by default, as it makes image archive / comic viewing a much better experience.
Motivation and Context
The primary motivation was that waiting for the entire archive to uncompress made the user wait unnecessarily. With the new batch decompression, the user can begin viewing the images in the archive almost immediately, while the rest of the archive decompresses in the background.
How Has This Been Tested?
All tests were updated to work with the new logic. New tests were added to cover. I also ensured that the default path (with the Always uncompress entire archive folder option disabled) was unaffected and worked the same as before.
Screenshots (if appropriate):
Types of changes
Checklist: