Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inspector overlay #784

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

filip131311
Copy link
Collaborator

This PR resolves a visual misalignment issue observed with the inspector overlay on Android, which was not correctly displaying the inspected component. The root cause of this problem was the method in which the application measured the component's position relative to the window. On Android devices, this calculation is shifted by the status bar displacing the window.

To address this, we have shifted the overlay rendering logic from the WebView to the application wrapper. Within the wrapper, the corrected coordinates provided by the inspector ensure that the overlay aligns accurately with inspected component component.

However, there is still an issue of accurately identifying the component to be inspected, as we are restricted to using the mouse position data obtained from the WebView.

###Testing:

  • Running the react-native-76 test-app on Android devices with and without the status bar.

Copy link

vercel bot commented Nov 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 0:20am

Copy link
Member

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

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

I wonder why can't we just use StatusBar.current height to apply the correct offset when sending touch coordinates and later when sending back frame position?

@filip131311 filip131311 marked this pull request as draft January 9, 2025 09:58
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