diff --git a/README.md b/README.md index 804346223..a75ae1046 100644 --- a/README.md +++ b/README.md @@ -122,11 +122,11 @@ Stirling-PDF currently supports 40 languages! | Catalan (Català) (ca_CA) | ![38%](https://geps.dev/progress/38) | | Croatian (Hrvatski) (hr_HR) | ![35%](https://geps.dev/progress/35) | | Czech (Česky) (cs_CZ) | ![39%](https://geps.dev/progress/39) | -| Danish (Dansk) (da_DK) | ![35%](https://geps.dev/progress/35) | +| Danish (Dansk) (da_DK) | ![34%](https://geps.dev/progress/34) | | Dutch (Nederlands) (nl_NL) | ![34%](https://geps.dev/progress/34) | | English (English) (en_GB) | ![100%](https://geps.dev/progress/100) | | English (US) (en_US) | ![100%](https://geps.dev/progress/100) | -| French (Français) (fr_FR) | ![96%](https://geps.dev/progress/96) | +| French (Français) (fr_FR) | ![95%](https://geps.dev/progress/95) | | German (Deutsch) (de_DE) | ![97%](https://geps.dev/progress/97) | | Greek (Ελληνικά) (el_GR) | ![39%](https://geps.dev/progress/39) | | Hindi (हिंदी) (hi_IN) | ![39%](https://geps.dev/progress/39) | @@ -136,14 +136,14 @@ Stirling-PDF currently supports 40 languages! | Italian (Italiano) (it_IT) | ![97%](https://geps.dev/progress/97) | | Japanese (日本語) (ja_JP) | ![72%](https://geps.dev/progress/72) | | Korean (한국어) (ko_KR) | ![39%](https://geps.dev/progress/39) | -| Norwegian (Norsk) (no_NB) | ![37%](https://geps.dev/progress/37) | +| Norwegian (Norsk) (no_NB) | ![36%](https://geps.dev/progress/36) | | Persian (فارسی) (fa_IR) | ![38%](https://geps.dev/progress/38) | | Polish (Polski) (pl_PL) | ![41%](https://geps.dev/progress/41) | | Portuguese (Português) (pt_PT) | ![39%](https://geps.dev/progress/39) | | Portuguese Brazilian (Português) (pt_BR) | ![97%](https://geps.dev/progress/97) | | Romanian (Română) (ro_RO) | ![33%](https://geps.dev/progress/33) | | Russian (Русский) (ru_RU) | ![96%](https://geps.dev/progress/96) | -| Serbian Latin alphabet (Srpski) (sr_LATN_RS) | ![43%](https://geps.dev/progress/43) | +| Serbian Latin alphabet (Srpski) (sr_LATN_RS) | ![42%](https://geps.dev/progress/42) | | Simplified Chinese (简体中文) (zh_CN) | ![98%](https://geps.dev/progress/98) | | Slovakian (Slovensky) (sk_SK) | ![29%](https://geps.dev/progress/29) | | Slovenian (Slovenščina) (sl_SI) | ![40%](https://geps.dev/progress/40) | diff --git a/frontend/public/locales/en-GB/translation.json b/frontend/public/locales/en-GB/translation.json index 783b66905..76a498d2d 100644 --- a/frontend/public/locales/en-GB/translation.json +++ b/frontend/public/locales/en-GB/translation.json @@ -1,9 +1,10 @@ { - "unsavedChanges": "You have unsaved changes to your PDF. What would you like to do?", + "unsavedChanges": "You have unsaved changes to your PDF.", + "areYouSure": "Are you sure you want to leave?", "unsavedChangesTitle": "Unsaved Changes", "keepWorking": "Keep Working", - "discardChanges": "Discard Changes", - "applyAndContinue": "Apply & Continue", + "discardChanges": "Discard & Leave", + "applyAndContinue": "Save & Leave", "exportAndContinue": "Export & Continue", "language": { "direction": "ltr" diff --git a/frontend/src/components/fileEditor/FileEditor.tsx b/frontend/src/components/fileEditor/FileEditor.tsx index 7f0fb0cad..626eaab4f 100644 --- a/frontend/src/components/fileEditor/FileEditor.tsx +++ b/frontend/src/components/fileEditor/FileEditor.tsx @@ -391,7 +391,7 @@ const FileEditor = ({ - + {activeStirlingFileStubs.length === 0 && !zipExtractionProgress.isExtracting ? ( @@ -490,7 +490,7 @@ const FileEditor = ({ onSelectFiles={handleLoadFromStorage} /> - + ); diff --git a/frontend/src/components/layout/Workbench.tsx b/frontend/src/components/layout/Workbench.tsx index 8089d1a44..f0f9a542e 100644 --- a/frontend/src/components/layout/Workbench.tsx +++ b/frontend/src/components/layout/Workbench.tsx @@ -146,10 +146,12 @@ export default function Workbench() { } > {/* Top Controls */} - + {activeFiles.length > 0 && ( + + )} {/* Dismiss All Errors Button */} @@ -159,6 +161,7 @@ export default function Workbench() { className="flex-1 min-h-0 relative z-10 workbench-scrollable " style={{ transition: 'opacity 0.15s ease-in-out', + paddingTop: activeFiles.length > 0 ? '3.5rem' : '0', }} > {renderMainContent()} diff --git a/frontend/src/components/pageEditor/PageEditor.tsx b/frontend/src/components/pageEditor/PageEditor.tsx index ee77d142d..0cab1f947 100644 --- a/frontend/src/components/pageEditor/PageEditor.tsx +++ b/frontend/src/components/pageEditor/PageEditor.tsx @@ -662,7 +662,7 @@ const PageEditor = ({ const displayedPages = displayDocument?.pages || []; return ( - + {!mergedPdfDocument && !globalProcessing && activeFileIds.length === 0 && ( diff --git a/frontend/src/components/shared/NavigationWarningModal.tsx b/frontend/src/components/shared/NavigationWarningModal.tsx index b1b935738..8188be435 100644 --- a/frontend/src/components/shared/NavigationWarningModal.tsx +++ b/frontend/src/components/shared/NavigationWarningModal.tsx @@ -1,25 +1,19 @@ -import { Modal, Text, Button, Group, Stack } from '@mantine/core'; -import { useNavigationGuard } from '../../contexts/NavigationContext'; -import { useTranslation } from 'react-i18next'; +import { Modal, Text, Button, Group, Stack } from "@mantine/core"; +import { useNavigationGuard } from "../../contexts/NavigationContext"; +import { useTranslation } from "react-i18next"; +import ArrowBackIcon from "@mui/icons-material/ArrowBack"; +import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline"; +import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline"; interface NavigationWarningModalProps { onApplyAndContinue?: () => Promise; onExportAndContinue?: () => Promise; } -const NavigationWarningModal = ({ - onApplyAndContinue, - onExportAndContinue -}: NavigationWarningModalProps) => { - +const NavigationWarningModal = ({ onApplyAndContinue, onExportAndContinue }: NavigationWarningModalProps) => { const { t } = useTranslation(); - const { - showNavigationWarning, - hasUnsavedChanges, - cancelNavigation, - confirmNavigation, - setHasUnsavedChanges - } = useNavigationGuard(); + const { showNavigationWarning, hasUnsavedChanges, cancelNavigation, confirmNavigation, setHasUnsavedChanges } = + useNavigationGuard(); const handleKeepWorking = () => { cancelNavigation(); @@ -38,13 +32,14 @@ const NavigationWarningModal = ({ confirmNavigation(); }; - const handleExportAndContinue = async () => { + const _handleExportAndContinue = async () => { if (onExportAndContinue) { await onExportAndContinue(); } setHasUnsavedChanges(false); confirmNavigation(); }; + const BUTTON_WIDTH = "10rem"; if (!hasUnsavedChanges) { return null; @@ -56,55 +51,53 @@ const NavigationWarningModal = ({ onClose={handleKeepWorking} title={t("unsavedChangesTitle", "Unsaved Changes")} centered - size="xl" - closeOnClickOutside={false} - closeOnEscape={false} + size="auto" + closeOnClickOutside={true} + closeOnEscape={true} > - - - {t("unsavedChanges", "You have unsaved changes to your PDF. What would you like to do?")} + + + + {t("unsavedChanges", "You have unsaved changes to your PDF.")} + + {t("areYouSure", "Are you sure you want to leave?")} + + - - - - - - - - {onExportAndContinue && ( - - )} - + + {onApplyAndContinue && ( - )} + + {/* Mobile layout: centered stack of 4 buttons */} + + + + {onApplyAndContinue && ( + + )} + ); diff --git a/frontend/src/components/viewer/LocalEmbedPDF.tsx b/frontend/src/components/viewer/LocalEmbedPDF.tsx index c0ef68990..bc65c5557 100644 --- a/frontend/src/components/viewer/LocalEmbedPDF.tsx +++ b/frontend/src/components/viewer/LocalEmbedPDF.tsx @@ -274,7 +274,7 @@ export function LocalEmbedPDF({ file, url, enableAnnotations = false, onSignatur e.preventDefault()}