debug: add article open + webView load timing to Reader logging
All checks were successful
Security Checks / dependency-audit (push) Successful in 12s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s

This commit is contained in:
Yusuf Suleman
2026-04-04 23:07:55 -05:00
parent dbddf126f9
commit 4461689251
2 changed files with 11 additions and 1 deletions

View File

@@ -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)")
}
}
}

View File

@@ -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