shenlei
|
2fa58b1026
|
diag: 总页数未更新问题 — 增加Reconciliation诊断日志 + 修复keepCurrentWindow后pending不移除
1. RDEPUBPageMapReconciliationCoordinator: 在evaluateTakeover、
evaluateSegmentTakeover、evaluateFullPageMapTakeover的每个返回点
增加RDEPUBBackgroundTrace日志,记录关键决策参数:
- currentSpineIndex、candidateChapters/pages、currentChapters/pages
- hasPrev/hasNext、lastBuildableSpineIndex
- jumpSession protected coverage ratio
用于确认fullMap被拒绝的具体原因
2. RDEPUBPresentationRuntime: .keepCurrentWindow分支增加
removePendingPageMapUpdate(at: index),防止被拒绝的
reconcileFullMap update无限期留在pending队列中不被消费。
之前return false不移除,导致:
- 后续commitPendingPageMapUpdateIfNeeded重试时条件不变
仍然keepCurrentWindow,形成无效循环
- 如果用户不再翻页,总页数永远不更新
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-25 17:33:16 +08:00 |
|
shenlei
|
c555329948
|
fix: pageCurl翻页后偶尔刷新回章节第一页
根因:.extendPartial pageMap更新提交时使用了异步扩展开始时捕获的
currentPageNumber/currentLocation,在pageCurl模式下用户可能已经翻了几页,
导致过时值通过transitionToPage把用户拉回旧位置。
修复三点:
1. PresentationRuntime: .extendPartial fallback不再使用捕获的
currentPageNumber,改用readerView.currentPage实时值
2. ChapterWarmupOrchestrator: 异步加载完成回调中使用实时位置
(readerView.currentPage + locationCoordinator.currentVisibleLocation())
而非异步开始时捕获的旧值
3. PresentationRuntime: rebindVisiblePage在pageCurl模式下,
如果正在翻页动画中(isPageCurlTransitioning),延迟到动画结束后
再用实时currentPage执行transitionToPage,避免在pageNum回调栈
内同步触发transitionToPage导致重入
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-25 16:52:38 +08:00 |
|
shenlei
|
d15f20b097
|
feat: 交互协调器拆分、附件提示、暗色图片适配、选区放大镜及文档清理
- 拆分 ContentDelegates/TextContentView 为独立协调器(InteractionCoordinator、LocationResolution、ExternalLinks、AttachmentTooltip)
- 新增 RDEPUBAttachmentTooltipView/OverlayView 附件气泡提示
- 新增 RDEPUBDarkImageAdjuster 暗色模式图片亮度适配
- 新增 RDEPUBSelectionLoupeView 选区放大镜
- 新增 MetadataParseWorker/CancellationController 元数据解析取消机制
- 重构 PresentationRuntime/PaginationCoordinator 精简职责
- 优化 ChapterLoader/WarmupOrchestrator 异步章节加载
- CFI 模块微调与 NoteModels 更新
- 清理冗余文档,更新架构/UML/业务逻辑文档
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-24 17:47:24 +08:00 |
|
shen
|
7de661eb54
|
feat: 架构整改 — Context拆分、Runtime拆分、异步章节加载、UI测试覆盖
Phase 1: Context 拆分
- 新增 RDEPUBReaderState/RDEPUBReaderEnvironment/RDEPUBReaderServices
- RDEPUBReaderContext 改为过渡门面,代理到 State/Environment/Services
Phase 2: Runtime 拆分
- 新增 RDEPUBPresentationRuntime 处理分页状态管理
- 新增 RDEPUBChapterWarmupOrchestrator 处理章节预热与加载编排
- RDEPUBReaderRuntime 从 1277 行收缩,公共 API 转发到新 facade
Phase 0.5: 性能优化
- prepareOnDemandChapter 支持异步模式(allowSynchronousLoad: false)
- extendPartialBookPageMapIfNeeded 改为 DispatchGroup 并发加载
- RDEPUBChapterOffsetMap.cfiMap 加 NSLock 保护数据竞争
- CFI Map 构建延迟到后台队列(scheduleDeferredCFIMapBuildIfNeeded)
- RDEPUBTextPageRenderView 引入静态位图缓存
- RDEPUBTextContentView 新增 loadingSpinner 占位页
Phase 3: 状态机
- 新增 RDEPUBNavigationStateMachine(含 DEBUG 合法转换校验)
- 新增 RDEPUBPaginationState 记录分页来源
Review 修复
- makeSummary 重复方法合并
- ensureNavigationTargetAvailable 同步路径加注释标记
UI 测试
- 新增 AsyncChapterLoadingTests(20 个测试,覆盖全部架构整改场景)
- 跨章节翻页、延迟 CFI、状态机、内存警告、预加载、位置恢复等
|
2026-06-23 08:17:08 +08:00 |
|