From 1d341661863b133f76bfadfd4573224bdf953c47 Mon Sep 17 00:00:00 2001
From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr>
Date: Wed, 1 Mar 2023 18:05:33 +0100
Subject: [PATCH] Improve searching, changing mirador comportent

---
 src/components/CanvasAnnotations.js             | 5 +++++
 src/components/WindowSideBarAnnotationsPanel.js | 4 ----
 src/containers/CanvasAnnotations.js             | 9 +++++++++
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/components/CanvasAnnotations.js b/src/components/CanvasAnnotations.js
index 0fa2f787b..f32a6cc72 100644
--- a/src/components/CanvasAnnotations.js
+++ b/src/components/CanvasAnnotations.js
@@ -88,6 +88,8 @@ export class CanvasAnnotations extends Component {
       annotations = filterAnnotation(annotations, inputSearch);
     }
 
+    const annotationCount = annotations.length;
+
     return (
       <>
         <div className={classes.form}>
@@ -163,6 +165,9 @@ export class CanvasAnnotations extends Component {
             </MenuItem>
             )}
         </MenuList>
+        <div className={classes.footerAnnotationPanel}>
+          <Typography component="p" variant="subtitle2">{t('showingNumAnnotations', { count: annotationCount, number: annotationCount })}</Typography>
+        </div>
       </>
     );
   }
diff --git a/src/components/WindowSideBarAnnotationsPanel.js b/src/components/WindowSideBarAnnotationsPanel.js
index f5182e644..177f0f23e 100644
--- a/src/components/WindowSideBarAnnotationsPanel.js
+++ b/src/components/WindowSideBarAnnotationsPanel.js
@@ -34,10 +34,6 @@ export class WindowSideBarAnnotationsPanel extends Component {
         otherRef={this.containerRef}
         titleControls={<AnnotationSettings windowId={windowId} />}
       >
-        <div className={classes.section}>
-          <Typography component="p" variant="subtitle2">{t('showingNumAnnotations', { count: annotationCount, number: annotationCount })}</Typography>
-        </div>
-
         {canvasIds.map((canvasId, index) => (
           <CanvasAnnotations
             canvasId={canvasId}
diff --git a/src/containers/CanvasAnnotations.js b/src/containers/CanvasAnnotations.js
index d4b90c976..a3a07135c 100644
--- a/src/containers/CanvasAnnotations.js
+++ b/src/containers/CanvasAnnotations.js
@@ -73,8 +73,17 @@ const styles = theme => ({
     position: 'absolute',
     right: 0,
   },
+  footerAnnotationPanel: {
+    background: theme.palette.background.paper,
+    bottom: 0,
+    position: 'sticky',
+  },
   form: {
+    background: theme.palette.background.paper,
     padding: theme.spacing(0, 1, 0, 1),
+    position: 'sticky',
+    top: 0,
+    zIndex: 10,
   },
   grow: {
     flexGrow: 1,
-- 
GitLab