mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-04-22 23:08:53 +02:00
## Description Adds an explicit **“Save As”** button to the desktop viewer so users can always save a copy of the current PDF to a different location, even if the original file already has a local path. This complements the existing smart **Save/Download** behavior: - The existing download button continues to either save back to the original path (when available) or prompt for a path when needed. - The new **Save As** button always opens a save dialog to choose a location/name for a new copy. ## Changes - **RightRail (viewer controls)** - Added a new **Save As** action icon in the right rail settings section. - The button: - Uses `viewerContext.exportActions.saveAsCopy()` to get the current viewer state as a PDF. - Calls `downloadFile` without a `localPath`, ensuring the desktop app shows a **Save As** dialog. - Picks the first selected file (if any) or the first active file as the source for the filename. - **Desktop / Web behavior** - In the desktop app (Tauri), clicking **Save As**: - Opens a native save dialog so the user can choose a different folder and filename. - Writes a new copy without changing the existing file’s `localFilePath` or dirty state. - In the web app, the button behaves like a standard download of a copy (browser-controlled save dialog / download). ## Motivation - Users often want to apply operations on a PDF while **keeping the original unmodified**. - The existing smart Save behavior chooses between Save and Save As automatically, but there was no way to explicitly request **Save As**. - This change gives desktop users a clear, dedicated **“Save As”** control while preserving the current Save/Download behavior. ## Notes - No backend changes. - No changes to the existing Save / Download button behavior. - The new button uses existing viewer export and download utilities, minimizing new logic. --------- Co-authored-by: James Brunton <james@stirlingpdf.com>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
"@mantine/hooks": "^8.3.1",
|
||||
"@mui/icons-material": "^7.3.2",
|
||||
"@mui/material": "^7.3.2",
|
||||
"@posthog/react": "^1.8.2",
|
||||
"@reactour/tour": "^3.8.0",
|
||||
"@stripe/react-stripe-js": "^4.0.2",
|
||||
"@stripe/stripe-js": "^7.9.0",
|
||||
@@ -63,7 +64,6 @@
|
||||
"license-report": "^6.8.0",
|
||||
"pdfjs-dist": "^5.4.149",
|
||||
"peerjs": "^1.5.5",
|
||||
"@posthog/react": "^1.8.2",
|
||||
"posthog-js": "^1.268.0",
|
||||
"qrcode.react": "^4.2.0",
|
||||
"react": "^19.1.1",
|
||||
@@ -174,8 +174,8 @@
|
||||
"postcss-preset-mantine": "^1.18.0",
|
||||
"postcss-simple-vars": "^7.0.1",
|
||||
"puppeteer": "^24.25.0",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "^5.9.2",
|
||||
"tsx": "^4.19.4",
|
||||
"typescript-eslint": "^8.44.1",
|
||||
"vite": "^7.1.7",
|
||||
"vite-plugin-static-copy": "^3.1.4",
|
||||
|
||||
Reference in New Issue
Block a user