chore: add zoom diagnostic to embedded browser

Logs the WebView's current scale, density, and pixel widths on page finish, to
confirm whether the 400% zoom is a density/viewport mismatch from streaming the
WebView through SurfaceControlViewHost. Temporary, alongside the touch/session
diagnostics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MgMpRcWj6y82LxLiwcuzmN
This commit is contained in:
Claude
2026-06-23 21:03:17 +00:00
parent 0b5d7925fe
commit 2115129a72
@@ -242,7 +242,14 @@ class NappletBrowserService : Service() {
override fun onPageFinished(
view: WebView,
url: String,
) = pushUrl(view)
) {
// DIAGNOSTIC (zoom): a responsive page rendering too large points to a density/viewport
// mismatch from streaming the WebView through SurfaceControlViewHost. scale≈4 confirms 400%.
val dm = view.resources.displayMetrics
@Suppress("DEPRECATION")
Log.w(TAG, "DIAG zoom: scale=${view.scale} density=${dm.density} dmWidthPx=${dm.widthPixels} webViewWidthPx=${view.width}")
pushUrl(view)
}
}
private fun pushUrl(view: WebView) {