Skip to content

fix(compose): Detect lazy layout scrolls on Compose foundation 1.10+ - #6548

Merged
0xadam-brown merged 3 commits into
mainfrom
fix/compose-scrollable-area-element
Nov 11, 2026
Merged

0xadam-brown merged 3 commits into
mainfrom
fix/compose-scrollable-area-element

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

📜 Description

ComposeGestureTargetLocator now also treats androidx.compose.foundation.ScrollableAreaElement as a scroll target, and sentry-compose/proguard-rules.pro keeps that class name so the check still matches in R8-minified apps.

💡 Motivation and Context

Compose foundation 1.10.0 removed ScrollingContainerElement. LazyColumn, LazyRow, lazy grids, staggered grids and Pager now apply ScrollableAreaElement. The locator didn't know that class, and the ScrollBy semantics fallback misses lazy layouts too, because LazyLayoutSemanticsModifier is a node element rather than a SemanticsModifier. So on foundation ≥ 1.10, every lazy-layout scroll logged Unable to find scroll target. No breadcrumb captured., tagged or not. verticalScroll/horizontalScroll still apply ScrollingLayoutElement and keep working. The ScrollingContainerElement check stays for apps on foundation 1.8–1.9.

💚 How did you test it?

  • Added detects scrollable via ScrollableAreaElement modifier to ComposeGestureTargetLocatorTest, using a stub class like the existing modifier tests.
  • :sentry-compose:testReleaseUnitTest --tests '*ComposeGestureTargetLocatorTest*' (19/19 pass) and :sentry-compose:spotlessCheck pass locally.
  • Checked the foundation-android AARs on Google Maven: ScrollingContainerElement exists through 1.9.5 and is gone from 1.10.0 through 1.12.1, and the 1.12.0 lazy list, grid, staggered grid and pager classes reference ScrollableAreaElement.
  • Not yet verified on a device against real Compose ≥ 1.10. The unit tests use stubs, and the SDK still compiles against Compose 1.9.5.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

  • Verify on a device, or with an instrumented test in sentry-uitest-android, built against foundation ≥ 1.10.
  • Consider building or testing sentry-compose against a newer Compose so future modifier renames get caught.

via gene.wright.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 11, 2026 00:43
Compose foundation 1.10 replaced ScrollingContainerElement with
ScrollableAreaElement, so the gesture target locator no longer found
LazyColumn/LazyRow/LazyGrid/Pager as scroll targets and dropped the
scroll breadcrumb. Match ScrollableAreaElement and keep its class name
under R8.

Fixes #6547

Co-Authored-By: Gene Wright <gene.wright@sentry.io>
Co-Authored-By: Gene Wright <gene.wright@sentry.io>
@sentry

sentry Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.63.0 (1) release

⚙️ sentry-android Build Distribution Settings

@markushi
markushi marked this pull request as ready for review November 11, 2026 08:15
@markushi
markushi requested review from a team and adinauer as code owners November 11, 2026 08:15
@markushi
markushi requested review from markushi and romtsn and removed request for a team November 11, 2026 08:15

@0xadam-brown 0xadam-brown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My clanker verified this works on my emulator:

Test Result
Android sample on emulator-5554, built with Compose 1.10.2 Tested the PR against real Compose layouts.
LazyColumn, LazyRow, horizontal/vertical grids, horizontal/vertical staggered grids, and horizontal/vertical Pager All 8 visibly scrolled and produced a ui.swipe breadcrumb with the correct layout tag.
Control build with the new ScrollableAreaElement match removed The same swipe logged Unable to find scroll target. No breadcrumb captured.
R8-minified release sample The vertical grid still produced the tagged breadcrumb; R8 preserved the class name.

@0xadam-brown
0xadam-brown merged commit ba3bad3 into main Nov 11, 2026
47 of 48 checks passed
@0xadam-brown
0xadam-brown deleted the fix/compose-scrollable-area-element branch November 11, 2026 09:26
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.

Lazy list scrolls not captured on Compose foundation 1.10+

2 participants