chore(crop): Remove invalid crop area message and related validation logic - #7160
Merged
Conversation
balazs-szucs
requested review from
ConnorYoh,
EthanHealy01,
Frooodle and
jbrunton96
as code owners
July 25, 2026 14:39
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the crop UI “out-of-bounds” validation/alert path (which could incorrectly trigger on initial open) and introduces a new “default” inset crop-area helper, while also deleting the now-unused crop.error.invalidArea translation key across locales.
Changes:
- Removed the crop-area validation alert from
CropSettingsand relaxed crop-area validity checks in the crop parameters hook. - Added
createDefaultCropArea(10% inset) and exposedresetToDefaultCropAreaon the crop parameters hook. - Removed
crop.error.invalidAreafrom many locale TOMLs.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 44 comments.
| File | Description |
|---|---|
| frontend/editor/src/core/utils/cropCoordinates.ts | Adds a new helper to generate an inset “default” crop area. |
| frontend/editor/src/core/hooks/tools/crop/useCropParameters.ts | Adjusts crop-area validation and adds a new reset helper for the inset default. |
| frontend/editor/src/core/components/tools/crop/CropSettings.tsx | Removes the invalid-area alert from the crop UI. |
| frontend/editor/public/locales/*/translation.toml | Removes the crop.error.invalidArea key from en-US and many non-en-US locales. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+33
to
36
| /** Reset to default inset crop area inside PDF bounds */ | ||
| resetToDefaultCropArea: (pdfBounds: PDFBounds) => void; | ||
| /** Reset to full PDF dimensions */ | ||
| resetToFullPDF: (pdfBounds: PDFBounds) => void; |
Comment on lines
3315
to
3316
| [crop.error] | ||
| failed = "Obrezovanje PDF-ja ni uspelo" |
Comment on lines
3315
to
3316
| [crop.error] | ||
| failed = "Nije uspelo isecanje PDF-a" |
Comment on lines
3315
to
3316
| [crop.error] | ||
| failed = "Det gick inte att beskära PDF" |
Ludy87
previously approved these changes
Aug 4, 2026
# Conflicts: # frontend/editor/src/core/components/tools/crop/CropSettings.tsx
Frooodle
approved these changes
Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
On the crop UI, you cannot select outside the PDF. As this is the default behavior the validation and error is unnecessary on the FE. Also resolve a bug when you opened the PDF with the "default" crop area it showed out-of-bounds error.
No functional change expected
Changes:
0 <= x <= actualWidth,0 <= y <= actualHeight).Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)
task checkto verify linters, typechecks, and tests pass