feat(walkthrough): post-download loop — download more without restarting (#163)#166
Merged
Merged
Conversation
de6bebe to
0af5082
Compare
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.
What this PR does
After a download completes, the walkthrough no longer exits. It offers:
Why it exists
The walkthrough was one-shot: downloading another volume of the same manga meant restarting the CLI, re-typing the title, re-searching, and reloading the whole chapter list. Painful for multi-volume downloads.
How it works internally
runWalkthroughresolvessource, auth (checkAuth/doRefresh), andadapteronce outside an outer loop. A per-mangaChapterListingCache { chapters, volumes }holds the resolved listing.pickRangegained optionalpreloadedChapters/preloadedVolumesand returns{ bundles, chapters?, volumes? }, fetching (listChapters/listVolumes) only when the needed slice is absent — so "same manga" reuses the cache and a mode switch (chapter↔volume) fetches only the missing listing once. "New manga" resetshit/cacheto null; source/auth/adapter persist.Partial-failure resilient:
runDownloadFlowreads{ failed }and emitswalkthrough.download_summary_failedwhenfailed > 0, but the loop still offers next-action.What did not change
executeWalkthroughsignature unchanged.src/index.tsreturn handling (cancelledvs ok) unchanged; loop returns the final iteration's result (per-iteration outputs are logged byexecuteWalkthrough).Test checklist
bun test— 513 pass, 0 failbun run typecheck— cleanbun run check— cleansearch/listChapterseach called exactly once across iterations (asserted)Reviewer notes
title ?? ""on the same-manga branch (unreachable), minor test duplication.src/walkthrough/index.ts. Recommend merging feat(downloader): progress indicator for long-running fetches #108 first, then rebasing this. Changes here are the loop restructure; feat(downloader): progress indicator for long-running fetches #108's are additive progress plumbing.Closes
Closes #163
✅ Checklist
docs/(if applicable)