From 6d8ef7d694b0019b46887dc5c25404ad97daecb5 Mon Sep 17 00:00:00 2001 From: Kelsey White Date: Fri, 16 Oct 2026 13:09:32 -0300 Subject: [PATCH 1/3] Fix for issue 903: Crop tool now moves page focus to top after use --- src/js/logic/crop-pdf-page.ts | 4 +++- src/tests/crop-pdf-page.test.ts | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/tests/crop-pdf-page.test.ts diff --git a/src/js/logic/crop-pdf-page.ts b/src/js/logic/crop-pdf-page.ts index b1d5b58e..20570122 100644 --- a/src/js/logic/crop-pdf-page.ts +++ b/src/js/logic/crop-pdf-page.ts @@ -415,7 +415,7 @@ async function performFlatteningCrop( return newPdfDoc.save(); } -function resetState() { +export function resetState() { if (cropperState.cropper) { cropperState.cropper.destroy(); cropperState.cropper = null; @@ -438,4 +438,6 @@ function resetState() { const cropBtn = document.getElementById('crop-button') as HTMLButtonElement; if (cropBtn) cropBtn.disabled = true; + + window.scrollTo({ top: 0, behavior: 'smooth' }); } diff --git a/src/tests/crop-pdf-page.test.ts b/src/tests/crop-pdf-page.test.ts new file mode 100644 index 00000000..678f01e3 --- /dev/null +++ b/src/tests/crop-pdf-page.test.ts @@ -0,0 +1,18 @@ +import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { resetState } from '../js/logic/crop-pdf-page.ts'; + +// Test resetState function for cropping +describe('resetState', () => { + beforeEach(() => { + vi.spyOn(window, 'scrollTo').mockImplementation(() => {}); + }); + + it('scrolls the page to the top after resetting', () => { + resetState(); + + expect(window.scrollTo).toHaveBeenCalledWith({ + top: 0, + behavior: 'smooth', + }); + }); +}); From a25c6511cee99d824a93c0ae7a2a891017f90d5d Mon Sep 17 00:00:00 2001 From: Kelsey White Date: Fri, 16 Oct 2026 13:19:17 -0300 Subject: [PATCH 2/3] Signed ICLA.md --- ICLA.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ICLA.md b/ICLA.md index c80debbf..c7c95d92 100644 --- a/ICLA.md +++ b/ICLA.md @@ -85,16 +85,16 @@ This Agreement shall be governed by and construed in accordance with the laws of By submitting a pull request or other Contribution to the Project, and by typing your name and date below (or by signing electronically via CLA Assistant), you agree to the terms of this Individual Contributor License Agreement. -**Full Legal Name:** Stephan Paternotte +**Full Legal Name:** Kelsey White -**GitHub Username:** Stephan-P +**GitHub Username:** kelseyjmw -**Email Address:** stephan@paternottes.net +**Email Address:** kelsey.white@dal.ca -**Date:** 20-12-2025 +**Date:** 16-10-2026 -**Signature:** ___________________________ +**Signature:** ************\_\_\_************ --- -*This CLA is based on the Apache Individual Contributor License Agreement and has been adapted for BentoPDF's dual licensing model.* +_This CLA is based on the Apache Individual Contributor License Agreement and has been adapted for BentoPDF's dual licensing model._ From 6dca41aeb4fa5f221b8742fecb27a71be7b2fa52 Mon Sep 17 00:00:00 2001 From: alam00000 Date: Sat, 31 Oct 2026 16:26:50 +0530 Subject: [PATCH 3/3] revert ICLA.md changes --- ICLA.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ICLA.md b/ICLA.md index c7c95d92..c80debbf 100644 --- a/ICLA.md +++ b/ICLA.md @@ -85,16 +85,16 @@ This Agreement shall be governed by and construed in accordance with the laws of By submitting a pull request or other Contribution to the Project, and by typing your name and date below (or by signing electronically via CLA Assistant), you agree to the terms of this Individual Contributor License Agreement. -**Full Legal Name:** Kelsey White +**Full Legal Name:** Stephan Paternotte -**GitHub Username:** kelseyjmw +**GitHub Username:** Stephan-P -**Email Address:** kelsey.white@dal.ca +**Email Address:** stephan@paternottes.net -**Date:** 16-10-2026 +**Date:** 20-12-2025 -**Signature:** ************\_\_\_************ +**Signature:** ___________________________ --- -_This CLA is based on the Apache Individual Contributor License Agreement and has been adapted for BentoPDF's dual licensing model._ +*This CLA is based on the Apache Individual Contributor License Agreement and has been adapted for BentoPDF's dual licensing model.*