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>
This commit is contained in:
@@ -17,6 +17,7 @@ final class AsyncChapterLoadingTests: XCTestCase {
|
||||
|
||||
private let app = XCUIApplication()
|
||||
private let largeBook = "凡人修仙传"
|
||||
private let singlePageOpeningBook = "宝山辽墓"
|
||||
|
||||
override func setUpWithError() throws {
|
||||
continueAfterFailure = false
|
||||
@@ -106,6 +107,25 @@ final class AsyncChapterLoadingTests: XCTestCase {
|
||||
|
||||
// MARK: - 3. Cross-chapter page turning in scroll mode
|
||||
|
||||
func testSinglePageOpeningChapterIncludesImmediateLookaheadPages() throws {
|
||||
app.launchAndOpenSampleBook(
|
||||
bookTitleQuery: singlePageOpeningBook,
|
||||
displayType: "scroll",
|
||||
resetsReaderState: true
|
||||
)
|
||||
app.waitForReader(timeout: 20)
|
||||
|
||||
let initialState = app.waitForDemoReaderState(timeout: 15, description: "首开局部分页可立即前翻") { state in
|
||||
state.mode == "bookPageMap" && state.knownPages != nil
|
||||
}
|
||||
|
||||
XCTAssertGreaterThan(
|
||||
initialState.knownPages ?? 0,
|
||||
1,
|
||||
"首章只有 1 页时,首开局部分页也应补充前瞻页,避免停留在总页数=1"
|
||||
)
|
||||
}
|
||||
|
||||
func testCrossChapterPageTurningInScrollMode() throws {
|
||||
// Swipes forward across a chapter boundary in horizontal scroll mode,
|
||||
// verifying continuous page number increments.
|
||||
|
||||
Reference in New Issue
Block a user