ReadViewSDK/.planning/milestones/v1.0-REQUIREMENTS.md

84 lines
5.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 需求归档ReadViewSDK v1.0
**归档日期:** 2026-05-22
**核心价值:** 稳定可用的 EPUB/TXT 阅读体验
## 结果说明
本归档按 milestone close 生成。v1.0 的实现与运行时证据整体达成,但由于 close-out 前未完全回写 requirement bookkeeping以下需求状态分为
- `Validated`实现、phase verification、summary metadata 三者一致
- `Delivered with accepted gaps`:实现和运行时证据存在,但 requirement bookkeeping 未完全对齐,作为已接受的归档缺口保留
## v1 Requirements
### 渲染内核重构Reflowable EPUB
- [x] **REND-01**:直接重构当前 `.textReflowable` 路径,使 reflowable EPUB 不再依赖当前“简单 `DTCoreText` renderer + `pageRanges` 切页”模式,而是具备 WXRead 风格的页面级原生排版能力
- [x] **REND-02**:在旧引擎基础上引入 WXRead 风格的 CSS 分层策略(`default / replace / dark / epub / user`),并让样式作用于章节级 HTML → `NSAttributedString` 转换过程
- [x] **REND-03**:在旧引擎基础上引入自定义 DTCoreText 属性体系与页面级 `NSAttributedString` 元数据,能够承载分页、块元素、图片、页面语义等布局信息
- [x] **REND-04**:将当前简单的 CoreText 切页逻辑升级为具备页面语义的复杂分页器,具备与 `WRCoreTextLayouter / WRCoreTextLayoutFrame` 核心能力等价的分页与页面布局控制能力
### 兼容性与主流程
- [x] **COMP-01**`RDURLReaderController` / `RDEPUBReaderController` 作为公开入口继续可用,`.epub` / `.txt` 打开主流程不回归
- [x] **COMP-02**Fixed Layout EPUB 与交互式 EPUB 继续使用 `WKWebView`,行为不因本次改造产生回归
- [x] **COMP-03**reflowable EPUB 的阅读位置映射、高亮/选区、搜索结果定位、字号/行高/主题切换后的重新分页在新内核下继续可用
- [x] **COMP-04**:当前翻页代码(`RDReaderView` 及现有 page curl / horizontal scroll / vertical scroll 交互逻辑)不做修改,新内核必须适配既有翻页容器
### 稳定性与验证
- [x] **STAB-01**:至少 3 类样本书验证通过:纯文本/小说类、含图片与复杂段落样式的章节、含外链与多个 CSS 文件引用的章节
- [x] **STAB-02**:以上样本在新内核下不出现崩溃、白屏、无限加载、严重错页或关键交互链路失效
## Requirement Outcomes
| Requirement | Archived Outcome | Notes |
|-------------|------------------|-------|
| REND-01 | Delivered with accepted gaps | Phase 2 established renderer/context path; audit still flagged bookkeeping incompleteness. |
| REND-02 | Delivered with accepted gaps | Phase 2 verification marked it satisfied; archive accepts missing checkbox sync. |
| REND-03 | Delivered with accepted gaps | Phase 3 implemented page metadata; requirement-level verification mapping was missing. |
| REND-04 | Delivered with accepted gaps | Phase 3 delivered stronger pagination semantics; requirement bookkeeping remained orphaned. |
| COMP-01 | Delivered with accepted gaps | Phase 4 restored reader main flow, but requirement mapping was not backfilled. |
| COMP-02 | Validated | Phase 1 fully documented and verified the `WKWebView` retention boundary. |
| COMP-03 | Delivered with accepted gaps | Phase 4 runtime evidence supports compatibility, though close-out evidence chain was incomplete. |
| COMP-04 | Delivered with accepted gaps | `RDReaderView` remained untouched across the milestone, but requirement metadata was not reconciled. |
| STAB-01 | Delivered with accepted gaps | Phase 5 5-book matrix covers required categories. |
| STAB-02 | Delivered with accepted gaps | Phase 5 runtime/UI evidence shows no sampled crash/blank-page regression. |
## Out of Scope
| 功能 | 原因 |
|---|---|
| Fixed Layout EPUB 改为原生渲染 | 本次明确保留 `WKWebView` 路径以控制风险 |
| 交互式 EPUB 改为原生渲染 | 交互能力JS/音视频/表单/iframe/外链/bridge更适配 `WKWebView`,本次不改 |
| 修改当前翻页代码(`RDReaderView` / 现有翻页模式与交互逻辑) | 本次只重构 reflowable 渲染内核,不把翻页容器一起纳入改造 |
| 直接拷贝使用读书私有 JS/CSS/私有实现代码 | 只能参考设计与行为,不直接搬运私有实现 |
| 同时保留两套 reflowable 原生引擎 | 本次要求直接演进旧引擎,不维护双轨 |
## Traceability
| Requirement | Phase | Final Status |
|-------------|-------|--------------|
| REND-01 | Phase 2 | Delivered with accepted gaps |
| REND-02 | Phase 2 | Delivered with accepted gaps |
| REND-03 | Phase 3 | Delivered with accepted gaps |
| REND-04 | Phase 3 | Delivered with accepted gaps |
| COMP-01 | Phase 4 | Delivered with accepted gaps |
| COMP-02 | Phase 1 | Validated |
| COMP-03 | Phase 4 | Delivered with accepted gaps |
| COMP-04 | Phase 4 | Delivered with accepted gaps |
| STAB-01 | Phase 5 | Delivered with accepted gaps |
| STAB-02 | Phase 5 | Delivered with accepted gaps |
**Coverage:**
- v1 requirements: 10 total
- Archived as shipped: 10
- Strict audit passed without gaps: 1
- Archived with accepted evidence gaps: 9
---
*Requirements defined: 2026-05-21*
*Archived: 2026-05-22 after milestone close with accepted audit gaps*