Skip to content

Apply effectiveMaxWidth for the size compatibilities#950

Merged
skydoves merged 1 commit intomainfrom
fix/ui-compa
Mar 6, 2026
Merged

Apply effectiveMaxWidth for the size compatibilities#950
skydoves merged 1 commit intomainfrom
fix/ui-compa

Conversation

@skydoves
Copy link
Owner

@skydoves skydoves commented Mar 6, 2026

Apply effectiveMaxWidth for the size compatibilities.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Refined balloon width constraint handling to ensure consistent and accurate sizing across all layout configurations. Improved calculation logic now properly manages width boundaries in fixed-width mode, bounded constraints, and unbounded scenarios, delivering more predictable and reliable sizing behavior regardless of screen size or configuration.

@skydoves skydoves self-assigned this Mar 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1f91a685-6ee2-45ea-af33-86886df1f13d

📥 Commits

Reviewing files that changed from the base of the PR and between d661075 and 891de5b.

📒 Files selected for processing (1)
  • balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/BalloonModifier.kt

Walkthrough

The change refactors width constraint logic in BalloonModifier by replacing an empty-layout short-circuit with a computed effectiveMaxWidth that handles three distinct cases: fixed-width mode, unbounded width, and bounded non-fixed scenarios. This ensures consistent width constraints across different modes.

Changes

Cohort / File(s) Summary
Width Constraint Calculation
balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/BalloonModifier.kt
Introduced effectiveMaxWidth variable to replace short-circuit logic, handling fixed mode (uses screenWidth), unbounded width (uses screenWidth), and bounded non-fixed scenarios (clamps to constraints.maxWidth). Updated maxContentWidth and targetWidth computations to reference effectiveMaxWidth instead of direct screenWidth or constrained values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through widths constrained,
No more short circuits cause refrain,
Three cases now are understood—
Fixed, unbounded, and bounded good! ✨
Width flows freely, as it should!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ui-compa

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@skydoves skydoves merged commit 351363a into main Mar 6, 2026
3 of 5 checks passed
@skydoves skydoves deleted the fix/ui-compa branch March 6, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant