v0.1: Fixed replies icons

This commit is contained in:
Akshay Kolli
2026-06-11 18:34:41 -07:00
parent a75582584a
commit 472198d39c
9 changed files with 132 additions and 14 deletions

View File

@@ -559,6 +559,7 @@ final class AppState: NSObject, ObservableObject {
annotations = []
return
}
hideReplyMarkers(in: document)
annotations = AnnotationReader.snapshots(in: document)
}
@@ -854,6 +855,22 @@ final class AppState: NSObject, ObservableObject {
pdfView.go(to: selection)
}
private func hideReplyMarkers(in document: PDFDocument) {
var changedPages = Set<PDFPage>()
for pageIndex in 0..<document.pageCount {
guard let page = document.page(at: pageIndex) else { continue }
for annotation in page.annotations where AnnotationKeys.isReply(annotation) {
AnnotationFactory.hideReplyMarker(annotation, on: page)
changedPages.insert(page)
}
}
for page in changedPages {
pdfView?.annotationsChanged(on: page)
}
}
private func navigate(to page: PDFPage, pageIndex: Int) {
guard let pdfView else { return }