From 60b522f1bedcd9b5d16061434ddd0f05495a0f92 Mon Sep 17 00:00:00 2001 From: Ludy Date: Mon, 3 Nov 2025 17:14:44 +0100 Subject: [PATCH] fix(ui): correct CSS `visibility` typo; clean up spelling/grammar across codebase (#4661) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description of Changes **What was changed** - Fixed a CSS typo in `imageHighlighter.css` (`visbility` → `visibility`) to restore the intended transition behavior. - Corrected spelling/grammar in logs, comments, and console messages: - `PdfUtils.java`: log message “overlayed” → “overlaid”. - `CustomPDFDocumentFactoryTest.java`: comment typo “neeed” → “need”. - `FlattenController.java`: comment “readd” → “re-add”. - `PdfContainer.js`: console log “Hidding” → “Hiding”. - `navbar.js`: clarified tooltip comment wording. - `languages.html`: corrected Vietnamese label to “Tiếng Việt”. - `ConvertWebsiteToPdfTest.java`: converted/de-duplicated comments to clear English and improved assertion messages. - No functional code paths altered except the CSS fix; the rest are non-functional text improvements (logs/comments/tests/labels). **Why the change was made** - The CSS typo prevented the `visibility` transition from working as intended. - Consistent, correct wording improves developer experience, test readability, and UI polish (language list). --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Reece Browne <74901996+reecebrowne@users.noreply.github.com> --- .../java/stirling/software/common/util/PdfUtils.java | 2 +- .../common/service/CustomPDFDocumentFactoryTest.java | 2 +- .../SPDF/controller/api/misc/FlattenController.java | 2 +- .../src/main/resources/static/css/imageHighlighter.css | 2 +- .../main/resources/static/js/multitool/PdfContainer.js | 2 +- app/core/src/main/resources/static/js/navbar.js | 2 +- .../main/resources/templates/fragments/languages.html | 2 +- .../api/converters/ConvertWebsiteToPdfTest.java | 10 +++++----- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/common/src/main/java/stirling/software/common/util/PdfUtils.java b/app/common/src/main/java/stirling/software/common/util/PdfUtils.java index 842baffcb..360cd1f05 100644 --- a/app/common/src/main/java/stirling/software/common/util/PdfUtils.java +++ b/app/common/src/main/java/stirling/software/common/util/PdfUtils.java @@ -567,7 +567,7 @@ public class PdfUtils { PDImageXObject image = PDImageXObject.createFromByteArray(document, imageBytes, ""); // Draw the image onto the page at the specified x and y coordinates contentStream.drawImage(image, x, y); - log.info("Image successfully overlayed onto PDF"); + log.info("Image successfully overlaid onto PDF"); if (!everyPage && i == 0) { break; } diff --git a/app/common/src/test/java/stirling/software/common/service/CustomPDFDocumentFactoryTest.java b/app/common/src/test/java/stirling/software/common/service/CustomPDFDocumentFactoryTest.java index b54fdb923..b97e10384 100644 --- a/app/common/src/test/java/stirling/software/common/service/CustomPDFDocumentFactoryTest.java +++ b/app/common/src/test/java/stirling/software/common/service/CustomPDFDocumentFactoryTest.java @@ -117,7 +117,7 @@ class CustomPDFDocumentFactoryTest { } } - // neeed to add password pdf + // need to add password pdf // @Test // void testLoadPasswordProtectedPdfFromInputStream() throws IOException { // try (InputStream is = getClass().getResourceAsStream("/protected.pdf")) { diff --git a/app/core/src/main/java/stirling/software/SPDF/controller/api/misc/FlattenController.java b/app/core/src/main/java/stirling/software/SPDF/controller/api/misc/FlattenController.java index 6a187936c..7a23ac84d 100644 --- a/app/core/src/main/java/stirling/software/SPDF/controller/api/misc/FlattenController.java +++ b/app/core/src/main/java/stirling/software/SPDF/controller/api/misc/FlattenController.java @@ -62,7 +62,7 @@ public class FlattenController { return WebResponseUtils.pdfDocToWebResponse( document, Filenames.toSimpleFileName(file.getOriginalFilename())); } else { - // flatten whole page aka convert each page to image and readd it (making text + // flatten whole page aka convert each page to image and re-add it (making text // unselectable) PDFRenderer pdfRenderer = new PDFRenderer(document); PDDocument newDocument = diff --git a/app/core/src/main/resources/static/css/imageHighlighter.css b/app/core/src/main/resources/static/css/imageHighlighter.css index 397c0c548..ed4faa941 100644 --- a/app/core/src/main/resources/static/css/imageHighlighter.css +++ b/app/core/src/main/resources/static/css/imageHighlighter.css @@ -8,7 +8,7 @@ align-items: center; justify-content: center; transition: - visbility 0.1s linear, + visibility 0.1s linear, background-color 0.1s linear; } diff --git a/app/core/src/main/resources/static/js/multitool/PdfContainer.js b/app/core/src/main/resources/static/js/multitool/PdfContainer.js index 0b4494c08..a3fa4c116 100644 --- a/app/core/src/main/resources/static/js/multitool/PdfContainer.js +++ b/app/core/src/main/resources/static/js/multitool/PdfContainer.js @@ -731,7 +731,7 @@ class PdfContainer { this.showButton(selectIcon, true); } } else { - console.log("Page Select off. Hidding buttons"); + console.log("Page Select off. Hiding buttons"); this.showButton(selectIcon, false); this.showButton(deselectIcon, false); } diff --git a/app/core/src/main/resources/static/js/navbar.js b/app/core/src/main/resources/static/js/navbar.js index be9d2df12..4f1c8a5f7 100644 --- a/app/core/src/main/resources/static/js/navbar.js +++ b/app/core/src/main/resources/static/js/navbar.js @@ -110,7 +110,7 @@ function tooltipSetup() { element.addEventListener("mousemove", (event) => updateTooltipPosition(event, tooltipText)); element.addEventListener("mouseleave", hideTooltip); - // in case UI moves and mouseleave is not triggered, tooltip is readded when mouse is moved over the element + // in case UI moves and mouseleave is not triggered, the tooltip is re-added when the mouse is moved over the element element.addEventListener("click", hideTooltip); }); }; diff --git a/app/core/src/main/resources/templates/fragments/languages.html b/app/core/src/main/resources/templates/fragments/languages.html index bf11d91b2..78914ad65 100644 --- a/app/core/src/main/resources/templates/fragments/languages.html +++ b/app/core/src/main/resources/templates/fragments/languages.html @@ -38,7 +38,7 @@
-
+
\ No newline at end of file diff --git a/app/core/src/test/java/stirling/software/SPDF/controller/api/converters/ConvertWebsiteToPdfTest.java b/app/core/src/test/java/stirling/software/SPDF/controller/api/converters/ConvertWebsiteToPdfTest.java index d3850bc6e..8b5c38055 100644 --- a/app/core/src/test/java/stirling/software/SPDF/controller/api/converters/ConvertWebsiteToPdfTest.java +++ b/app/core/src/test/java/stirling/software/SPDF/controller/api/converters/ConvertWebsiteToPdfTest.java @@ -225,8 +225,8 @@ public class ConvertWebsiteToPdfTest { UrlToPdfRequest request = new UrlToPdfRequest(); request.setUrlInput("https://example.com"); - Path preCreatedTemp = java.nio.file.Files.createTempFile("test_output_", ".pdf"); - Path htmlTemp = java.nio.file.Files.createTempFile("test_input_", ".html"); + Path preCreatedTemp = Files.createTempFile("test_output_", ".pdf"); + Path htmlTemp = Files.createTempFile("test_input_", ".html"); try (MockedStatic gu = Mockito.mockStatic(GeneralUtils.class); MockedStatic pe = Mockito.mockStatic(ProcessExecutor.class); @@ -271,12 +271,12 @@ public class ConvertWebsiteToPdfTest { assertNotNull(resp, "Response should not be null"); assertEquals(HttpStatus.OK, resp.getStatusCode()); assertTrue( - java.nio.file.Files.exists(preCreatedTemp), + Files.exists(preCreatedTemp), "Temp file should still exist despite delete IOException"); } finally { try { - java.nio.file.Files.deleteIfExists(preCreatedTemp); - java.nio.file.Files.deleteIfExists(htmlTemp); + Files.deleteIfExists(preCreatedTemp); + Files.deleteIfExists(htmlTemp); } catch (IOException ignore) { } }