feat(web): cbz reader — virtual scroll with height correction, prefetch, progress restore

This commit is contained in:
2026-09-07 15:58:01 +08:00
parent 052b94bb6a
commit 654e4febf1
4 changed files with 242 additions and 2 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { Suspense, type ComponentType, type LazyExoticComponent } from "react";
import { Suspense, lazy, type ComponentType, type LazyExoticComponent } from "react";
import { Link, useNavigate, useParams } from "react-router-dom";
import { api } from "../api/client";
import type { Format } from "../api/types";
@@ -9,7 +9,9 @@ import { btn } from "../components/ui";
import type { ReaderProps } from "../lib/useProgress";
// reader 任务逐个往里加:Task 7 cbz → Task 8 txt/md → Task 9 pdf → Task 10 epub
const READERS: Partial<Record<Format, LazyExoticComponent<ComponentType<ReaderProps>>>> = {};
const READERS: Partial<Record<Format, LazyExoticComponent<ComponentType<ReaderProps>>>> = {
cbz: lazy(() => import("../readers/CbzReader")),
};
export default function Reader() {
const { id: idStr } = useParams();