Skip to content

RUM-16362: Fix interop wireframe positioning in Compose windows#3611

Merged
jonathanmos merged 2 commits into
developfrom
jmoskovich/fix-compose-positioning
Jul 15, 2026
Merged

RUM-16362: Fix interop wireframe positioning in Compose windows#3611
jonathanmos merged 2 commits into
developfrom
jmoskovich/fix-compose-positioning

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Jul 6, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Fixes Session Replay rendering embedded Compose content at the top of its scroll container instead of its actual scrolled position. When a ComposeView is nested inside an XML ScrollView/NestedScrollView (a common pattern during incremental Compose migration), SemanticsNode.positionInRoot is relative to the AndroidComposeView, not the screen — so wireframe coordinates never accounted for where the ComposeView itself sits on screen. This went unnoticed for full-screen Compose because the root AndroidComposeView sits at roughly (0, statusBarHeight), making positionInRoot coincidentally line up with screen coordinates. ComposeViewMapper and AndroidComposeViewMapper now resolve the host view's on-screen position via getLocationOnScreen() and translate the resulting wireframes by that offset, so scrolled/embedded Compose content is captured at its true position. Since getLocationOnScreen() reflects the current scroll offset at capture time, this fixes all scroll positions without special-casing ScrollView.

One visible side effect: on typical full-screen (non-edge-to-edge) activities, this now correctly shifts Compose content down by the status bar height, which exposes a plain background-colored strip where the status bar sits. The strip was previously invisible because content incorrectly extended up into it under the old bug. This is a pre-existing SR limitation becoming visible in a new place, not a regression from this fix, and is out of scope here.

Motivation

What inspired you to submit this pull request?

Additional Notes

Interop wireframes (Android Views embedded via AndroidView inside Compose) are already screen-absolute, so they're tracked separately (ComposeWireframeEntry.Compose vs .Interop) and excluded from the new offset to avoid double-counting. Touch-privacy override areas are offset the same way to stay aligned with the corrected wireframe positions.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@jonathanmos
jonathanmos force-pushed the jmoskovich/fix-compose-positioning branch from 6cc86c8 to 30fb155 Compare July 7, 2026 08:33
@jonathanmos jonathanmos changed the title Fix interop wireframe positioning in Compose windows RUM-16362: Fix interop wireframe positioning in Compose windows Jul 7, 2026
@codecov-commenter

codecov-commenter commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.01%. Comparing base (fbb4569) to head (0979bba).
⚠️ Report is 147 commits behind head on develop.

Files with missing lines Patch % Lines
...ernal/mappers/semantics/RootSemanticsNodeMapper.kt 84.21% 1 Missing and 2 partials ⚠️
...eplay/compose/internal/utils/BackgroundResolver.kt 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3611      +/-   ##
===========================================
+ Coverage    72.89%   73.01%   +0.12%     
===========================================
  Files          975      976       +1     
  Lines        35277    35291      +14     
  Branches      5972     5970       -2     
===========================================
+ Hits         25712    25765      +53     
+ Misses        7905     7858      -47     
- Partials      1660     1668       +8     
Files with missing lines Coverage Δ
...d/sessionreplay/compose/internal/data/UiContext.kt 100.00% <100.00%> (ø)
...l/mappers/semantics/AbstractSemanticsNodeMapper.kt 76.92% <100.00%> (ø)
...rnal/mappers/semantics/AndroidComposeViewMapper.kt 100.00% <100.00%> (+7.14%) ⬆️
...nal/mappers/semantics/ButtonSemanticsNodeMapper.kt 80.00% <100.00%> (ø)
...l/mappers/semantics/CheckboxSemanticsNodeMapper.kt 93.08% <100.00%> (ø)
.../internal/mappers/semantics/ComposeHiddenMapper.kt 92.86% <100.00%> (ø)
...se/internal/mappers/semantics/ComposeViewMapper.kt 100.00% <100.00%> (+16.67%) ⬆️
.../mappers/semantics/ContainerSemanticsNodeMapper.kt 86.67% <100.00%> (ø)
...rnal/mappers/semantics/ImageSemanticsNodeMapper.kt 90.91% <100.00%> (ø)
...appers/semantics/RadioButtonSemanticsNodeMapper.kt 89.66% <100.00%> (+0.37%) ⬆️
... and 9 more

... and 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos
jonathanmos marked this pull request as ready for review July 7, 2026 09:35
@jonathanmos
jonathanmos requested review from a team as code owners July 7, 2026 09:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30fb155af6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jonathanmos
jonathanmos marked this pull request as draft July 7, 2026 11:44
@jonathanmos
jonathanmos force-pushed the jmoskovich/fix-compose-positioning branch from 30fb155 to 150da26 Compare July 7, 2026 13:35
@jonathanmos
jonathanmos force-pushed the jmoskovich/fix-compose-positioning branch from 150da26 to d7017e7 Compare July 9, 2026 08:37
@jonathanmos
jonathanmos marked this pull request as ready for review July 12, 2026 11:05
@sbarrio
sbarrio requested a review from satween July 13, 2026 07:05
ambushwork
ambushwork previously approved these changes Jul 15, 2026
@jonathanmos
jonathanmos merged commit ad5310d into develop Jul 15, 2026
27 checks passed
@jonathanmos
jonathanmos deleted the jmoskovich/fix-compose-positioning branch July 15, 2026 09:37
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.

4 participants