diff --git a/ios/Platform/Platform/Features/Reader/Views/ArticleView.swift b/ios/Platform/Platform/Features/Reader/Views/ArticleView.swift index 577e6cd..0459a82 100644 --- a/ios/Platform/Platform/Features/Reader/Views/ArticleView.swift +++ b/ios/Platform/Platform/Features/Reader/Views/ArticleView.swift @@ -59,12 +59,16 @@ struct ArticleView: View { } } .task { + let t0 = CFAbsoluteTimeGetCurrent() let entryId = entry.id + print("[READER-DBG] 📄 article OPEN id=\(entryId) initContent=\(articleContent.count)") + if let idx = vm.entries.firstIndex(where: { $0.id == entryId }), !vm.entries[idx].isRead { vm.entries[idx].status = "read" } currentEntry = vm.entries.first(where: { $0.id == entryId }) ?? currentEntry + print("[READER-DBG] 📄 markRead done +\(Int((CFAbsoluteTimeGetCurrent()-t0)*1000))ms") Task { let api = ReaderAPI() @@ -74,10 +78,12 @@ struct ArticleView: View { do { let fullEntry = try await ReaderAPI().getEntry(id: entryId) + print("[READER-DBG] 📄 getEntry +\(Int((CFAbsoluteTimeGetCurrent()-t0)*1000))ms contentLen=\(fullEntry.articleHTML.count)") let fullHTML = fullEntry.articleHTML if !fullHTML.isEmpty && fullHTML.count > articleContent.count { articleContent = fullHTML + print("[READER-DBG] 📄 content upgraded +\(Int((CFAbsoluteTimeGetCurrent()-t0)*1000))ms") } var merged = fullEntry @@ -86,7 +92,10 @@ struct ArticleView: View { merged.starred = local.starred } currentEntry = merged - } catch {} + print("[READER-DBG] 📄 article READY +\(Int((CFAbsoluteTimeGetCurrent()-t0)*1000))ms") + } catch { + print("[READER-DBG] 📄 article FAILED +\(Int((CFAbsoluteTimeGetCurrent()-t0)*1000))ms error=\(error)") + } } } diff --git a/ios/Platform/Platform/Features/Reader/Views/ArticleWebView.swift b/ios/Platform/Platform/Features/Reader/Views/ArticleWebView.swift index 90e6378..a619b6e 100644 --- a/ios/Platform/Platform/Features/Reader/Views/ArticleWebView.swift +++ b/ios/Platform/Platform/Features/Reader/Views/ArticleWebView.swift @@ -100,6 +100,7 @@ struct ArticleWebView: UIViewRepresentable { // Only reload if content meaningfully changed guard context.coordinator.lastHTML != newHTML else { return } + print("[READER-DBG] 🌐 webView load htmlLen=\(newHTML.count) isUpgrade=\(context.coordinator.lastHTML != nil)") let isUpgrade = context.coordinator.lastHTML != nil context.coordinator.lastHTML = newHTML