Skip to content

Conversation

@skydoves
Copy link
Owner

@skydoves skydoves commented Dec 21, 2025

Migrate to Subcompose layout to measure layout sizes. (#786)

Summary by CodeRabbit

  • Refactor
    • Optimized balloon content measurement and positioning system for improved layout reliability and consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@skydoves skydoves self-assigned this Dec 21, 2025
@skydoves skydoves merged commit 237f480 into main Dec 21, 2025
3 of 4 checks passed
@skydoves skydoves deleted the compose/subcompose branch December 21, 2025 03:38
@coderabbitai
Copy link

coderabbitai bot commented Dec 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR refactors the balloon composable's internal measurement and layout system, replacing Popup-based positioning with SubcomposeLayout while maintaining string formatting consistency in the demo activity. No public API changes are introduced.

Changes

Cohort / File(s) Summary
Demo Activity Formatting
app/src/main/kotlin/com/skydoves/balloondemo/ComposeActivity.kt
Split two Text string literals into multiple concatenated strings; no behavioral changes.
Balloon Layout Architecture
balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/Balloon.kt
Replaced Popup-based measurement and placement with SubcomposeLayout-driven approach; introduced custom content measurement via subcompose with computed maxContentWidth; moved layout and sizing logic into SubcomposeLayout scope; removed PopupProperties dependencies; added onSizeChanged anchor handling.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • SubcomposeLayout measurement logic and maxContentWidth calculation accounting for widthRatio, maxWidthRatio, and padding/margins
  • Content placement accuracy and positioning relative to anchor view within SubcomposeLayout scope
  • onSizeChanged behavior and anchor sizing interactions
  • Removal of Popup-related side effects and invalidation logic
  • Verification that BalloonLayout continues to render correctly within the new SubcomposeLayout framework

Poem

🎈 A popup's flight is now redesigned,
With SubcomposeLayout's measured mind,
Balloon content dances free,
No longer chained by Popup's decree,
Precise placement, clean and kind! 🐰✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch compose/subcompose

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ff0006 and 30629f5.

📒 Files selected for processing (2)
  • app/src/main/kotlin/com/skydoves/balloondemo/ComposeActivity.kt (1 hunks)
  • balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/Balloon.kt (2 hunks)

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.

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.

2 participants