From ec3f2c587e01aa3136ad88e8137b5321e24cb26b Mon Sep 17 00:00:00 2001 From: Fendy Date: Tue, 8 Sep 2026 13:08:46 +0800 Subject: [PATCH] feat(reader): remove admin delete button from reader header; shelf card hover remains the only delete entry --- docs/CHANGELOG_web.md | 5 +++++ frontend/src/components/icons.tsx | 6 ------ frontend/src/pages/Reader.tsx | 31 +++---------------------------- 3 files changed, 8 insertions(+), 34 deletions(-) diff --git a/docs/CHANGELOG_web.md b/docs/CHANGELOG_web.md index 31b5625..a2eac5c 100644 --- a/docs/CHANGELOG_web.md +++ b/docs/CHANGELOG_web.md @@ -36,6 +36,11 @@ The format loosely follows Keep a Changelog and can be adapted to the team's hab - Whole UI restyled to a warm library palette (stone surfaces + amber accents, replacing cool zinc + emerald): warmer dark chrome, amber primary buttons/links, hover/press feedback on shelf cards (cover lift + glow), reader header with format badge and blur, pill-style CBZ page indicator, EPUB spread centered like a book page. - 全站换为暖色「书房」配色(stone 深灰面 + amber 琥珀强调,替代冷色 zinc + emerald):书架封面悬停上浮高亮、阅读器顶栏带格式徽章与毛玻璃、CBZ 页码改为悬浮胶囊、EPUB 页面居中成书卷感,主按钮/链接统一琥珀色并补齐悬停/焦点反馈。 +### Removed / 移除 + +- The admin 删除 button is gone from the reader header: deleting books now lives only in the shelf cover-card hover action, so a destructive tap can't happen one step away from the page-turn zone while reading. +- 阅读器顶栏右上角不再提供 admin「删除」按钮:删除入口仅保留在书架封面卡片的悬停操作中,避免阅读时误触翻页区旁的破坏性删除。 + ### Fixed / 修复 - Comic continuous-scroll mode is contiguous again on phones: the size observer used to miss the scroll container (it was attached while the reader still showed "loading", so the box didn't exist), leaving page geometry computed from a stale 480px default width while pages rendered at the real (e.g. 390px) width — every page gained a constant dead gap. The observer now attaches when the box actually mounts; additionally, mobile address-bar show/hide no longer rebuilds the scroll geometry in continuous/whole-page modes, which used to wipe measured page heights and re-trigger a burst of image requests. diff --git a/frontend/src/components/icons.tsx b/frontend/src/components/icons.tsx index 8a0782c..a5a678c 100644 --- a/frontend/src/components/icons.tsx +++ b/frontend/src/components/icons.tsx @@ -55,12 +55,6 @@ export const IconX = (p: P) => ( ); -export const IconTrash = (p: P) => ( - - - -); - export const IconLogout = (p: P) => ( diff --git a/frontend/src/pages/Reader.tsx b/frontend/src/pages/Reader.tsx index d4854c2..2454315 100644 --- a/frontend/src/pages/Reader.tsx +++ b/frontend/src/pages/Reader.tsx @@ -1,11 +1,9 @@ -import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { useQuery } from "@tanstack/react-query"; import { Suspense, lazy, useCallback, useMemo, useState, type ComponentType, type LazyExoticComponent } from "react"; -import { Link, useNavigate, useParams } from "react-router-dom"; +import { Link, useParams } from "react-router-dom"; import { api } from "../api/client"; import type { Format } from "../api/types"; -import { useAuth } from "../auth/AuthContext"; -import { IconArrowLeft, IconTrash } from "../components/icons"; -import { toast } from "../components/Toaster"; +import { IconArrowLeft } from "../components/icons"; import { btn, btnGhost, formatBadge } from "../components/ui"; import type { ReaderProps } from "../lib/useProgress"; @@ -20,9 +18,6 @@ const READERS: Partial setChromeOn((v) => !v), []); @@ -31,15 +26,6 @@ export default function Reader() { const bookQ = useQuery({ queryKey: ["book", id], queryFn: () => api.getBook(id), enabled: Number.isFinite(id) }); const progQ = useQuery({ queryKey: ["progress"], queryFn: api.listProgress }); - const del = useMutation({ - mutationFn: () => api.deleteBook(id), - onSuccess: () => { - toast("ok", "已删除"); - qc.invalidateQueries({ queryKey: ["books"] }); - nav("/"); - }, - onError: (e) => toast("err", e instanceof Error ? e.message : "删除失败"), - }); const book = bookQ.data; const body = (() => { @@ -81,17 +67,6 @@ export default function Reader() { {Math.round(book.percent * 100)}% )} - {isAdmin && book && ( - - )}
}>{body}