feat(ja.mangarawjp): add sort filter for updated and ranking orderings - #677
Merged
Merged
Conversation
kkantan
requested changes
Aug 5, 2026
kkantan
left a comment
Contributor
There was a problem hiding this comment.
I think, rather than listings, it would be better to have a sort filter that is hidden while searching. it's nicer to have a single page for the source instead of separating the search and listings, and since filters are saved locally, people can set a default sort.
kkantan
requested changes
Aug 6, 2026
kinboy56
force-pushed
the
ja.mangarawjp_update
branch
from
August 7, 2026 11:56
162b3f8 to
330b019
Compare
kkantan
approved these changes
Aug 7, 2026
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.
Summary
Adds a sort filter to
ja.mangarawjp. The browse tab previously had no way to reach anything by order — it was hardwired to the site's empty-search endpoint, which returns the catalogue in the site's own default order, so finding something popular or recently updated meant already knowing its name.res/filters.jsonwith a sort filter: 最近の更新 and ランキング, defaulting to the formerget_search_manga_listmaps the selected option to its own pathconfig.hidesFiltersWhileSearchingset, since the search endpoint cannot take an orderingparse_listing_page, shared by search and browseversionbumped 1 → 2Implementation notes
The site has no sort parameter — each order is served from a separate path:
/page/N//ranking/N/?s=<query>&page=NA few things worth a reviewer's attention:
hidesFiltersWhileSearchinghides the filter, and a non-empty query takes precedence over whatever sort value is still stored. An empty query is not treated as a search and falls through to the ordering paths.test_query_takes_precedence_over_sortguards the first case andtest_empty_query_falls_through_to_the_sortthe second.div.post-listblocks with no distinguishing class: updates, ranking, and one per featured genre (Ecchi / オトナ). Selecting.post-list > athere returns 84 entries from all four blocks with 7 duplicates, instead of the 24 that actually belong to page 1. Entries are therefore scoped to the first.post-listonly. Every other page —/page/2/onwards,/ranking/N/, and the search endpoint — has exactly one such block, so the narrower selector is correct everywhere, not just on the home page.test_updated_page_1_holds_only_the_updates_blockasserts both no-duplicate-keys and a page-size bound so this can't regress silently. The home page is unavoidable here: the "もっと" link on the updates block points at/page/2/, so there is no dedicated URL serving page 1 of that ordering..post-listis an error, not an empty page. An exhausted listing still renders the block with nothing inside it (/page/9999/returns 200 with an empty block), so the two cases are distinguishable: no block at all means the page didn't load. Returning an empty list there would be indistinguishable from the end of pagination, and in the app it leaves the previous list on screen — which reads as the ordering having been ignored.abs:.Manga.keyis the site-relative path (/manga-raw/...), which is exactly what the href already holds, so reading it directly avoids resolving to an absolute URL only to strip the base back off. Covers do need absolute URLs and are joined ontoBASE_URL, readingdata-srconly — the plainsrcis a base64 placeholder until the page's lazy loader runs, so falling back to it would yield a data URI./page/1/is used rather than/even though they serve identical content, to keep one URL shape per ordering instead of special-casing the first page. Same for/ranking/1/, which the site redirects to from/ranking/1.Test plan
cargo test --release— 12 tests against the live site, all passing: both orderings return entries, they return different leading keys (so the filter is provably not a no-op), a query beats a stored sort value while an empty query does not, updates page 2 paginates, keys stay site-relative and covers absolute, out-of-range pages end pagination cleanly, the sort index falls back to the first option when the app sends no filter value, and the home-page block-mixing regression guard.post-list > aand confirmingtest_updated_page_1_holds_only_the_updates_blockfails (84 entries, 77 unique), then restoringtest_query_takes_precedence_over_sortverified by disabling the query branch and confirming it fails, then restoring — asserting on titles alone would not have caught the fallback, since the query is also the top ranking entrycargo fmt --check— cleancargo clippy --release— no warningsaidoku package+aidoku verify—source.json,filters.jsonand the icon (128×128, fully opaque) pass schema validationChecklist
cargo fmthas been run before submissioncargo clippyoutputs no lint warningsManga.key/Chapter.keyunchanged — no migration needed, so nobreakingChangeVersionversionincremented