You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: declare state properties read outside render() - #47
Declare circularCrop, outputMimeType and outputQuality on ImageCropElement so image-crop.tsx type-checks under strict. They're defined at runtime by useState() and read via this. outside render(); declare emits no class field, so runtime behavior is unchanged.
This adds type declarations only and does not change runtime behavior. Merge risk is minimal.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
Issue #45 requires that the source in image-crop.tsx compile. The PR adds declare statements for circularCrop, outputMimeType, and outputQuality on ImageCropElement (verified at reviewed hea…
Provide the result of a TypeScript type-check of src/main/resources/META-INF/frontend/src/image-crop.tsx under strict at the reviewed head, showing no error TS2769 for the makeAspectCrop call. Alternatively, provide the build output f…
Passed checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix: declare state properties read outside render()" matches the changeset. The PR adds TypeScript declare properties for circularCrop, outputMimeType, and outputQuality on ImageCropEleme…
Out of Scope Changes check
The PR summary reports +8/-0 lines in image-crop.tsx. The added lines match the declare block with its explanatory comment and the three property declarations (verified at reviewed head). These li…
Full details: Title check
Explanation
The title "fix: declare state properties read outside render()" matches the changeset. The PR adds TypeScript declare properties for circularCrop, outputMimeType, and outputQuality on ImageCropElement in image-crop.tsx, so the type checker accepts reads of state values outside render() without emitting class fields that could shadow hooks.useState() values. The title names the main change and follows a conventional commit style. It does not mention the strict type-checking motivation, which is an acceptable omission.
Full details: Out of Scope Changes check
Explanation
The PR summary reports +8/-0 lines in image-crop.tsx. The added lines match the declare block with its explanatory comment and the three property declarations (verified at reviewed head). These lines directly implement the strict type-checking objective of #45. No unrelated change is identified in the evidence available. The whole-PR diff blob was unavailable, so the base comparison relies on the PR summary and the head file content.
Full details: Linked Issues check
Explanation
Issue #45 requires that the source in image-crop.tsx compile. The PR adds declare statements for circularCrop, outputMimeType, and outputQuality on ImageCropElement (verified at reviewed head). Static reading of the head file also shows the makeAspectCrop call in applyAspect passes a literal { unit: "%", ... } object, which matches the overload quoted in the issue. The issue itself states this was not compiled. The PR description does not report a build or type-check result. No compile or test evidence is available, and the whole-PR diff blob could not be read, so compliance with the strict type-check requirement cannot be confirmed.
Resolution
Provide the result of a TypeScript type-check of src/main/resources/META-INF/frontend/src/image-crop.tsx under strict at the reviewed head, showing no error TS2769 for the makeAspectCrop call. Alternatively, provide the build output for the project's frontend compilation.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Declare
circularCrop,outputMimeTypeandoutputQualityonImageCropElementsoimage-crop.tsxtype-checks understrict. They're defined at runtime byuseState()and read viathis.outsiderender();declareemits no class field, so runtime behavior is unchanged.Close #45
Summary by CodeRabbit