Commit Graph
2 Commits
Author SHA1 Message Date
hectorqin 2d7e858ecc refactor(web): drop Mantine; one ActionMenu for every ⋯ menu
- Replace every Mantine component with the toolkit (Button, Callout, IconButton) or plain markup; remove MantineProvider, its stylesheet and the --mantine variable bridge; keep its form-font reset in reader.css. Uninstall @mantine/core and @mantine/hooks.
- ActionMenu/ActionSheet (ui/action-menu.tsx): the file manager's Mantine Menu, the shelf pick dialog and the media <details> menus (catalog, narrators, detail, libraries, library rows, folders, chapters, queue, resource panel, favorites filter) are one compact Sheet menu.
- Toolkit Callout for page-level messages; operation failures go to FloatingNotice; .page-state for whole-page loading/error.
- Shared SourcesHeader and SourceBookDetailSheet; source editor and credentials pages rebuilt without Mantine, deleting a source now asks first.
- Remove dead code: SettingsPage (unrouted), MiniPlayer, ui/dom.ts (formatters moved to lib/format.ts), the unused metadata form dialog, useAppThemeDark.
- ui:review react-app passes again: fixed stale steps (/settings, mini player, login race, missing-edition detail).
2026-10-21 11:38:12 +08:00
CodeBuddy d0a475919d feat(web): H5 客户端,精排 epub 渲染 + 多格式阅读
用户的三个问题在这里落地:

1. 「H5 是一个完整的客户端」——同一份构建产物既由服务端托管(`/` 直接
   就是完整阅读器),也可被 Android 外壳打进 assets 复用,两种宿主只差
   一个 serverUrl。

2. 「纯 H5 时 epub 等资源是否需要 iframe 或 shadow DOM」——用 shadow DOM,
   但不是为了隔离出版方样式(那做不到也不该做:书必须能给自己排版)。
   它挡的是反方向:客户端自身的 CSS 不会漏进书里。iframe 只在 PDF 那一处
   用,因为 PDF 需要自己的浏览上下文,理由写在 render/container.ts 里。

3. 「Android 端 epub 用 H5 渲染,其他类型用原生」——按 kind 分流,
   capabilities() 明确声明:reflowable 走 WebView,paged/document 在
   Android 交回原生。理由写进 reader-view.ts:WebView 每页一个合成层,
   300MB 的画册在一台中端机上就是 OOM。

服务端同步配合的两处:
- 资源流式下发 + HTTP Range
- epub 按包内路径寻址、items/manifest 分窗

前端无框架:渲染热路径是命令式 DOM 操作,引框架只会把"最小覆盖 CSS"
的策略搞复杂;最终产物 35KB(gzip 10.7KB)。
2026-09-16 14:45:04 +08:00