Skip to content

Build your personal knowledge base with Trilium Notes

chore(pdf): remove grouping annotations by page

Elian Dorand976076ae512
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 2afcc3e356..45adf144f7 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2424,8 +2424,7 @@
"pages_alt": "Page {{pageNumber}}",
"pages_loading": "Loading...",
"annotations_one": "{{count}} annotation",
- "annotations_other": "{{count}} annotations",
- "annotations_page": "Page {{page}}"
+ "annotations_other": "{{count}} annotations"
},
"platform_indicator": {
"available_on": "Available on {{platform}}"
diff --git a/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.css b/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.css
index c514a4ed4a..67473e2252 100644
--- a/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.css
+++ b/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.css
@@ -2,16 +2,6 @@
width: 100%;
}
-.pdf-annotations-page-header {
- padding: 4px 12px;
- font-size: 11px;
- font-weight: 600;
- color: var(--muted-text-color);
- text-transform: uppercase;
- letter-spacing: 0.5px;
- background-color: var(--accented-background-color);
- border-bottom: 1px solid var(--main-border-color);
-}
.pdf-annotation-item {
display: flex;
diff --git a/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.tsx b/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.tsx
index 36ee247855..ae4b15a0c9 100644
--- a/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.tsx
+++ b/apps/client/src/widgets/sidebar/pdf/PdfAnnotations.tsx
@@ -36,35 +36,15 @@ export default function PdfAnnotations() {
return null;
}
- // Group annotations by page
- const byPage = new Map<number, PdfAnnotationInfo[]>();
- for (const ann of annotationsData.annotations) {
- let list = byPage.get(ann.pageNumber);
- if (!list) {
- list = [];
- byPage.set(ann.pageNumber, list);
- }
- list.push(ann);
- }
-
- const pages = [...byPage.entries()].sort((a, b) => a[0] - b[0]);
-
return (
<RightPanelWidget id="pdf-annotations" title={t("pdf.annotations", { count: annotationsData.annotations.length })}>
<div className="pdf-annotations-list">
- {pages.map(([pageNumber, annotations]) => (
- <div key={pageNumber} className="pdf-annotations-page-group">
- <div className="pdf-annotations-page-header">
- {t("pdf.annotations_page", { page: pageNumber })}
- </div>
- {annotations.map((annotation) => (
- <PdfAnnotationItem
- key={annotation.id}
- annotation={annotation}
- onNavigate={annotationsData.scrollToAnnotation}
- />
- ))}
- </div>
+ {annotationsData.annotations.map((annotation) => (
+ <PdfAnnotationItem
+ key={annotation.id}
+ annotation={annotation}
+ onNavigate={annotationsData.scrollToAnnotation}
+ />
))}
</div>
</RightPanelWidget>