Skip to content

KSN: search fix, infinite home grid, MangaDex proxy and cache - #46

Merged
codebend3r merged 1 commit into
mainfrom
search-fix-plus
Nov 8, 2026
Merged

codebend3r merged 1 commit into
mainfrom
search-fix-plus

Conversation

@codebend3r

@codebend3r codebend3r commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner
  • search also matches catalog titles, so mapped series AniList ranks past page one still show ("attack" had Attack on Titan at KSN: dedupe drifted detail-route components #21, so "Mapped only" came back empty)
  • catalog matches and the AniList search share one request under the same genre and tag exclusions; the catalog page is skipped with @include when nothing matches, so there is one query and no branch
  • home: 10 columns at laptop width, infinite scroll via useLatestAnime and a useInfiniteScroll hook, one HomeToolbar with the heading, "Mapped only" and "Filter genres" on one row; the filter panel stays open when the toolbar moves between search and grid
  • home: scrolling goes compact through HeaderWordmark, hides search, filters and headings, pins the Footer
  • series: the franchise column is gone end to end (component, hook, API call, query, type); Movies section collapsed by default, with aria-expanded
  • series: counts prefer AniList totals over MangaDex's hosted counts
  • MangaDex proxy: /_mdx/* and /_mdx-covers/* served by a Netlify edge function with a non-browser User-Agent, since MangaDex bot-challenges browser UAs and a rewrite cannot override the header. src/data/mangadexRoutes.ts is the one source of paths, hosts and UA; the client, the edge function, Metro and e2e/serve.ts all read it, and nothing in src/ imports from scripts/
  • MangaDex cache: migration adds mangadex_series (public read-only under RLS, titles and covers as jsonb); bun run mangadex:refresh fills it with the service role in one upsert per series; useMangaDex reads the cache first and falls back to the live lookup
  • data: isRecord defined once in data/guards.ts; staleness windows move to data/time.ts
  • build: Node 24 on Netlify and in CI (metro.config.js requires TypeScript modules, which Node 20 cannot load; this is what broke the deploy preview)
  • after merge: apply 20261108120000_mangadex_cache.sql to production, then run bun run mangadex:refresh with SUPABASE_SERVICE_ROLE_KEY in scripts/.env.local
  • e2e: 20 popular-series searches paced under AniList's 30/min limit, Movies collapsed on Naruto, cover decodes through /_mdx-covers

@netlify

netlify Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kasane-guide ready!

Name Link
🔨 Latest commit e95fff6
🔍 Latest deploy log https://app.netlify.com/projects/kasane-guide/deploys/6af0ecae3e937168677b16c7
😎 Deploy Preview https://deploy-preview-46--kasane-guide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codebend3r codebend3r changed the title KSN: fix empty search, collapse movies, add popular-search e2e KSN: search fix, infinite home grid, MangaDex proxy and cache Nov 8, 2026
@codebend3r
codebend3r force-pushed the search-fix-plus branch 2 times, most recently from 68f1556 to cd79247 Compare November 8, 2026 21:35
- search matches catalog titles locally, so mapped series ranked past AniList's first page still show; `searchWithCatalog` fetches the page and catalog matches in one request, skipping the catalog page with `@include` when there are no ids
- add `matchCatalogTitles`, `catalogMediaIds`, `mergeSearchResults` in `src/data/catalogSearch.ts`; key `useSearch` on matched catalog ids
- home: 10 columns at laptop width via `RELEASE_COLUMNS`; `LatestReleases` owns its feed through `useLatestAnime` (`useInfiniteQuery`), trimming to whole rows while paging; `useInfiniteScroll` owns the scroll geometry and hands back no props when disabled
- home: one `HomeToolbar` puts the heading, `MappedOnlyToggle` and `GenreFilterButton` on one row; the screen owns its filter-panel state so it survives the move between search and grid; tagline removed
- home: `useHomeChrome` owns immersive mode and its enter/exit hysteresis via `trackOffset`; `HeaderWordmark` goes compact, search, filters and headings hide, the `Footer` pins
- series: remove the franchise column end to end (`FranchiseSeasons`, `useFranchise`, `getAnimeFranchise`, `AnimeFranchise`); collapse `SeriesMovies` by default behind an accessible count toggle
- series: counts prefer AniList totals over MangaDex's hosted counts
- proxy: `src/data/mangadexRoutes.ts` is the one source of the MangaDex hosts, the `/_mdx` and `/_mdx-covers` paths and the non-browser `User-Agent`; `webMangaDexClient`, `nativeMangaDexClient` and `scriptMangaDexClient` read from it
- proxy: Netlify edge function `netlify/edge-functions/mangadex.ts` replaces the rewrite, which cannot override `User-Agent`
- proxy: `scripts/mangadexProxy.ts` is the import-free Node handler that `metro.config.js` and `e2e/serve.ts` hand the routes to
- cache: migration adds `mangadex_series`, public read-only under RLS, with `titles` and `covers` as jsonb so a refresh is one upsert
- cache: `scripts/refresh-mangadex.ts` (`bun run mangadex:refresh`) fills it with the service role, skipping rows under 7 days old
- cache: `useMangaDex` reads `fetchCachedMangaDex` first and falls back to `getMangaDexSnapshot` on a miss or error, then resolves covers with `snapshotToInfo` under the app client's covers base; `coverUrl` and the converters live in `data/mangadexSnapshot.ts`
- data: `isRecord` lives once in `data/guards.ts`; staleness windows move from `queries/shared.ts` to `data/time.ts`
- anilist: `getMediaByIds` batches at the page limit through `inPages`, shared with `getCoversByIds`
- build: Node 24 on Netlify and in CI, since `metro.config.js` requires TypeScript modules; `engines.node` records it
- e2e: `smoke` and `popular-search` specs paced under AniList's rate limit, cover decode through `/_mdx-covers`
- test script also covers `scripts/`; ignore Supabase CLI state, `.netlify/` and `deno.lock`; `@scripts/*` alias for e2e and script tests only
@codebend3r
codebend3r merged commit 77835a0 into main Nov 8, 2026
8 checks passed
@codebend3r
codebend3r deleted the search-fix-plus branch November 8, 2026 23:52
codebend3r added a commit that referenced this pull request Nov 8, 2026
- Set `package.json` and `app.json` to 1.3.5
- Add the 1.3.5 entry to `CHANGELOG.md`
- Patch: dev server against local or production Supabase (#45), catalog-aware search, infinite home grid, MangaDex proxy and cache (#46)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant