From 9b5590f322f58f64ae12136fca8b94df53b8c7d6 Mon Sep 17 00:00:00 2001 From: EthanHealy01 Date: Wed, 12 Nov 2025 13:48:02 +0000 Subject: [PATCH] small snags --- frontend/public/locales/en-GB/translation.json | 2 +- frontend/public/locales/en-US/translation.json | 2 +- .../src/core/components/tools/compare/CompareDocumentPane.tsx | 4 ---- .../core/components/tools/compare/CompareWorkbenchView.tsx | 4 ++-- frontend/src/core/data/useTranslatedToolRegistry.tsx | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/public/locales/en-GB/translation.json b/frontend/public/locales/en-GB/translation.json index 0da194f7f..3e50f5cee 100644 --- a/frontend/public/locales/en-GB/translation.json +++ b/frontend/public/locales/en-GB/translation.json @@ -2203,7 +2203,7 @@ "pageNotReadyTitle": "Page not rendered yet", "pageNotReadyBody": "Some pages are still rendering. Navigation will snap once they are ready.", "rendering": "rendering", - "inProgress": "One or both of these PDFs are very large, scrolling won't be smooth until the rendering is complete", + "inProgress": "At least one of these PDFs are very large, scrolling won't be smooth until the rendering is complete", "pagesRendered": "pages rendered", "complete": "Page rendering complete" }, diff --git a/frontend/public/locales/en-US/translation.json b/frontend/public/locales/en-US/translation.json index 0556795ee..8c787ee61 100644 --- a/frontend/public/locales/en-US/translation.json +++ b/frontend/public/locales/en-US/translation.json @@ -2488,7 +2488,7 @@ "pageNotReadyTitle": "Page not rendered yet", "pageNotReadyBody": "Some pages are still rendering. Navigation will snap once they are ready.", "rendering": "rendering", - "inProgress": "One or both of these PDFs are very large, scrolling won't be smooth until the rendering is complete", + "inProgress": "At least one of these PDFs are very large, scrolling won't be smooth until the rendering is complete", "pagesRendered": "pages rendered", "complete": "Page rendering complete" }, diff --git a/frontend/src/core/components/tools/compare/CompareDocumentPane.tsx b/frontend/src/core/components/tools/compare/CompareDocumentPane.tsx index 4c35439a1..5df9a63a0 100644 --- a/frontend/src/core/components/tools/compare/CompareDocumentPane.tsx +++ b/frontend/src/core/components/tools/compare/CompareDocumentPane.tsx @@ -53,7 +53,6 @@ const CompareDocumentPane = ({ // Track which page images have finished loading to avoid flashing between states const imageLoadedRef = useRef>(new Map()); - const [, forceRerender] = useState(0); const visiblePageRafRef = useRef(null); const lastReportedVisiblePageRef = useRef(null); const pageNodesRef = useRef(null); @@ -70,7 +69,6 @@ const CompareDocumentPane = ({ useEffect(() => { if (zoom <= 1) { pagePanRef.current.clear(); - forceRerender(v => v + 1); } }, [zoom]); @@ -222,7 +220,6 @@ const CompareDocumentPane = ({ const candY = dragRef.current.startPanY - dy; const next = { x: Math.max(0, Math.min(maxX, candX)), y: Math.max(0, Math.min(maxY, candY)) }; pagePanRef.current.set(page.pageNumber, next); - forceRerender(v => v + 1); e.preventDefault(); }} onMouseUp={(e) => { @@ -255,7 +252,6 @@ const CompareDocumentPane = ({ onLoad={() => { if (!imageLoadedRef.current.get(page.pageNumber)) { imageLoadedRef.current.set(page.pageNumber, true); - forceRerender(v => v + 1); } }} /> diff --git a/frontend/src/core/components/tools/compare/CompareWorkbenchView.tsx b/frontend/src/core/components/tools/compare/CompareWorkbenchView.tsx index 7cd200dae..b7006ae3d 100644 --- a/frontend/src/core/components/tools/compare/CompareWorkbenchView.tsx +++ b/frontend/src/core/components/tools/compare/CompareWorkbenchView.tsx @@ -218,7 +218,7 @@ const CompareWorkbenchView = ({ data }: CompareWorkbenchViewProps) => { if (!progressToastIdRef.current) { const id = alert({ alertType: 'neutral', - title: t('compare.rendering.inProgress', "One or both of these PDFs are very large, scrolling won't be smooth until the rendering is complete"), + title: t('compare.rendering.inProgress', "At least one of these PDFs are very large, scrolling won't be smooth until the rendering is complete"), body: `${countsText} ${t('compare.rendering.pagesRendered', 'pages rendered')}`, location: 'bottom-right' as ToastLocation, isPersistentPopup: true, @@ -229,7 +229,7 @@ const CompareWorkbenchView = ({ data }: CompareWorkbenchViewProps) => { progressToastIdRef.current = id; } else { updateToast(progressToastIdRef.current, { - title: t('compare.rendering.inProgress', "One or both of these PDFs are very large, scrolling won't be smooth until the rendering is complete"), + title: t('compare.rendering.inProgress', "At least one of these PDFs are very large, scrolling won't be smooth until the rendering is complete"), body: `${countsText} ${t('compare.rendering.pagesRendered', 'pages rendered')}`, location: 'bottom-right' as ToastLocation, isPersistentPopup: true, diff --git a/frontend/src/core/data/useTranslatedToolRegistry.tsx b/frontend/src/core/data/useTranslatedToolRegistry.tsx index e392b4dec..82c02b233 100644 --- a/frontend/src/core/data/useTranslatedToolRegistry.tsx +++ b/frontend/src/core/data/useTranslatedToolRegistry.tsx @@ -779,7 +779,7 @@ export function useTranslatedToolCatalog(): TranslatedToolCatalog { description: t("home.compare.desc", "Compare two PDF documents and highlight differences"), categoryId: ToolCategoryId.RECOMMENDED_TOOLS, subcategoryId: SubcategoryId.GENERAL, - maxFiles: -1, + maxFiles: 2, operationConfig: undefined, automationSettings: null, synonyms: getSynonyms(t, "compare"),