Skip to content

fix(demo): remove no-op max-width on upload crop dialog - #46

Open
paodb wants to merge 1 commit into
masterfrom
fix/demo-dialog-max-width
Open

paodb wants to merge 1 commit into
masterfrom
fix/demo-dialog-max-width

Conversation

@paodb

@paodb paodb commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

The upload demo called dialog.setMaxWidth(dialog.getHeight()), but the dialog's height is never set, so getHeight() returns null and the call has no effect. The overlay already defaults to max-width: 100%, so the line is removed.

Close #44

Summary by CodeRabbit

  • Bug Fixes
    • Corrected crop dialog sizing so its maximum width is no longer tied to its current height. This allows the dialog’s width to be determined independently of its height.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The upload demo no longer sets the crop dialog’s maximum width from its current height.

Changes

Upload demo dialog

Layer / File(s) Summary
Remove the maximum-width assignment
src/test/java/com/flowingcode/vaadin/addons/imagecrop/UploadImageCropDemo.java
The demo no longer calls setMaxWidth with the dialog’s current height.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Refactor · Severity of issue fixed: Low

Merge Risk: Minimal · up to 8c185

This removes a no-op line from the upload crop demo. It should not change how the demo behaves, and nothing in the change affects the library itself. The merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: removing a no-op max-width call from the upload crop dialog in the demo. The raw summary confirms the only change is removing dialog.setMaxWidth(dialog.getHeight()) in Uplo…
Linked Issues check Passed Issue #44 is the only active directly linked issue. Its expected behavior allows either setting a real max-width or removing the line. The PR removes dialog.setMaxWidth(dialog.getHeight()) from `Upl…
Out of Scope Changes check Passed The only change in the whole-PR diff (mergeBase 73551f5 to head 8c18576) is the removal of one line in src/test/java/com/flowingcode/vaadin/addons/imagecrop/UploadImageCropDemo.java. This line is th…
Full details: Title check

Explanation

The title names the change: removing a no-op max-width call from the upload crop dialog in the demo. The raw summary confirms the only change is removing dialog.setMaxWidth(dialog.getHeight()) in UploadImageCropDemo.openCropDialog. The objectives say getHeight() returns null because the height is unset, so the call has no effect, and the overlay keeps its default max-width of 100%. The title matches the main change and is specific enough for a reviewer scanning history.

Full details: Linked Issues check

Explanation

Issue #44 is the only active directly linked issue. Its expected behavior allows either setting a real max-width or removing the line. The PR removes dialog.setMaxWidth(dialog.getHeight()) from UploadImageCropDemo.openCropDialog, as shown in the whole-PR summary (+0/-1). The call no longer runs with a null argument, so the ineffective behavior is removed. The issue requires no automated test, and the PR adds none. The issue's claim that the overlay keeps its default max-width: 100% was not verified by building or running tests in this review. That claim does not change the outcome, because the issue accepts removal as a valid fix.

Full details: Out of Scope Changes check

Explanation

The only change in the whole-PR diff (mergeBase 73551f5 to head 8c18576) is the removal of one line in src/test/java/com/flowingcode/vaadin/addons/imagecrop/UploadImageCropDemo.java. This line is the exact line named in #44. No unrelated files or declarations changed. The raw summary reports no changes to exported or public declarations.

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c4d7b2c-85f3-4fa2-ad6f-51c1ab77ce5e
Commits

Reviewing files that changed from the base of the PR and between 73551f5 and 8c18576.

Files selected for processing: 1

  • src/test/java/com/flowingcode/vaadin/addons/imagecrop/UploadImageCropDemo.java
Files with no reviewable changes: 1

  • src/test/java/com/flowingcode/vaadin/addons/imagecrop/UploadImageCropDemo.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@paodb
paodb marked this pull request as ready for review November 16, 2026 19:18
@paodb
paodb requested a review from scardanzan November 16, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

Upload demo: dialog.setMaxWidth(dialog.getHeight()) has no effect

1 participant