Report scoped imports as destination coverage, and carry want-to-read across - #48
Merged
Merged
Conversation
…cross The first real import of a split read like a failure: "32 matched, 244 unmatched", for a destination that holds 32 series, every one of which matched. A split exports the whole old library and imports it into one of several new ones, so most file series are meant to miss, and calling them unmatched said the opposite of what happened. A scoped import now reports coverage of the destination: how many series and books the selected libraries hold, and how many of those received state. The matched side counts distinct destination series and books, because two file series can resolve to one destination series by name and counting file matches can report more than the destination holds. The totals go through the same visibility filter as matching, so a series hidden from the reader does not make the import look incomplete. Unscoped there is no destination to measure against, so the plain counts stay and "unmatched" keeps meaning nothing was found. The book count needed splitting, not just relabelling. `booksUnmatched` mixes books whose whole series belongs elsewhere with books missed inside a series that did match. Calling all of it "other libraries" would have hidden real misses behind the reassuring wording, so the summary counts the first group separately and the page shows the remainder as missed. Want-to-read now travels in the file, on the series or book it flags. The export seeds queued series and books into its sets: a queued series is usually one never started, and with no reading state nothing else would have put it in the file. On import the queue is global but the file is grouped by series and applied a series at a time, so every entry is ranked by its original position once, up front, and offset past the reader's existing queue. Each series transaction then writes entries whose positions are already fixed, so restored entries follow the existing queue in their original order, and nothing already queued moves. The original queued date is kept, so the newest and oldest sorts still mean what they did. A checkbox turns it off. The settings test fixture had stayed in snake_case since the wire format became camelCase. Test files are excluded from the type check and nothing asserted a rendered count, so it passed while the component read undefined. It is rebuilt as a typed builder, and the new tests assert the numbers that render.
Deploying codex with
|
| Latest commit: |
c2747fb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://893ac7cc.codex-asm.pages.dev |
| Branch Preview URL: | https://feat-transfer-report-and-wan.codex-asm.pages.dev |
API contract changesCompared against Report |
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.
Follow-up to #47, from the first real import of a library split.
The report read like a failure
…for a destination holding 32 series, all of which matched. A split exports the whole old library and imports it into one of several new ones, so most file series are meant to miss. Calling them "unmatched" said the opposite of what happened.
A scoped import now reads:
Relabel rather than a point-of-view toggle. A toggle makes you go looking for the reassuring view after the alarming one has landed; correct wording means the first reading is right.
Distinct counts. Two file series can resolve to one destination series by name, so counting file matches could report "33 of 32". Coverage counts distinct destination series and books.
Visibility-aware denominator. In-scope totals go through the same filter as matching, so a series hidden from the reader doesn't make an import look incomplete.
Books needed splitting, not just relabelling.
booksUnmatchedmixes books whose whole series lives elsewhere with books missed inside a series that matched. Labelling all of it "other libraries" would hide real misses behind reassuring wording. NewbooksInUnmatchedSeriesseparates them; the page shows the remainder as missed. (This one wasn't in the plan — it surfaced while building the UI.)Unscoped imports keep the plain counts: there's no destination to measure against, and "unmatched" really does mean nothing was found.
Want-to-read travels with the export
On the series or book it flags, with its original position and queued date.
Not reusing
WantToReadRepository::add_series: it needs a plain connection where the importer holds a transaction, stamps the current time, and rescans the whole queue per call.A stale fixture from #46
The settings test fixture had stayed in snake_case since the wire format became camelCase.
tsconfig.app.jsonexcludes*.test.tsxfromtsc -b, and nothing asserted a rendered count, so it passed while the component readundefined. Rebuilt as a typed builder; the new tests assert the numbers that render. Worth considering separately whether test files should be type-checked at all.Tests
Backend: coverage of the destination; distinct counting when two file series land on one; no totals when unscoped; books missed inside a matched series kept apart; a queued-but-unstarted series exported; a queued book exported with its series; restored entries following the existing queue in original order with the original date; re-import adding nothing; the flag off; dry run counting without writing. Plus a unit test pinning queue ranking and tie-breaks across series and books.
Web: scoped wording, the "missed" count staying visible, unscoped wording unchanged, and the checkbox reaching the request in both states.
Verification
cargo clippy --all-targets -- -D warningsexit 0,tsc -bclean, biome cleanAdditive fields only, so the document format stays at version 1: older files import with the fields absent, and the document has no
deny_unknown_fields.