diff --git a/docs/CHANGELOG_web.md b/docs/CHANGELOG_web.md index 4f8054b..d89b824 100644 --- a/docs/CHANGELOG_web.md +++ b/docs/CHANGELOG_web.md @@ -8,6 +8,11 @@ The format loosely follows Keep a Changelog and can be adapted to the team's hab ## [Unreleased] +### Changed / 变更 + +- Reader UI cleanup: the legacy style helpers (ui.ts / icons.tsx) and all rd-* classes are gone; every reader surface now uses the shared design tokens and components. +- 阅读器 UI 清理:旧样式助手(ui.ts / icons.tsx)与全部 rd-* 类删除;所有阅读器表面统一使用共享设计 token 与组件。 + ### Added / 新增 - The shelf page gains a reading stats card (this week's time, streak days, expandable 7-day bar chart); reading time is tracked on-device while a book is open. diff --git a/frontend/src/auth/AuthContext.tsx b/frontend/src/auth/AuthContext.tsx index c6cafc5..ee23081 100644 --- a/frontend/src/auth/AuthContext.tsx +++ b/frontend/src/auth/AuthContext.tsx @@ -78,7 +78,7 @@ export function RequireAuth({ children }: { children: ReactNode }) { const { user, ready } = useAuth(); const loc = useLocation(); if (!getToken()) return ; - if (!ready || !user) return
加载中…
; + if (!ready || !user) return
加载中…
; return <>{children}; } diff --git a/frontend/src/components/Cover.tsx b/frontend/src/components/Cover.tsx index e46fea7..4499647 100644 --- a/frontend/src/components/Cover.tsx +++ b/frontend/src/components/Cover.tsx @@ -1,7 +1,8 @@ import { useEffect, useState } from "react"; import type { Book } from "../api/types"; import { fetchObjectUrl } from "../lib/authImage"; -import { btn, formatBadge } from "./ui"; +import { FormatBadge } from "./format-badge"; +import { Button } from "./ui/button"; import { TriangleAlert } from "lucide-react"; export function useAuthedImage(url: string | undefined): { src: string; failed: boolean; retry: () => void } { @@ -44,12 +45,17 @@ export function Cover({ book, className }: { book: Book; className?: string }) { {Array.from(book.title)[0] ?? "?"} - {book.format} + {failed && ( - + )} ); diff --git a/frontend/src/components/ErrorBoundary.tsx b/frontend/src/components/ErrorBoundary.tsx index 977340b..ed35c20 100644 --- a/frontend/src/components/ErrorBoundary.tsx +++ b/frontend/src/components/ErrorBoundary.tsx @@ -13,9 +13,9 @@ export class ErrorBoundary extends Component<{ children: ReactNode }, { err: Err

页面出错了

-

{String(this.state.err)}

+

{String(this.state.err)}

); - if (!src) return
; + if (!src) return
; return ( 页索引加载中…
; + return
页索引加载中…
; if (countQ.isError || !book.page_url_fmt) return ( -
+
无法解析页索引:{countQ.error instanceof Error ? countQ.error.message : "缺 page_url_fmt"}
); @@ -396,7 +396,7 @@ export default function CbzReader({ book, initialLocator, initialPercent, chrome style={{ top: ph.offset(w.end) - anchor, height: vh }} > {w.end >= count ? ( - — 全书完 — + — 全书完 — ) : (