From 2115129a72a0d7fd83b42fdcdbead93d3f274b39 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 23 Jun 2026 21:03:17 +0000 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01MgMpRcWj6y82LxLiwcuzmN --- .../amethyst/napplethost/NappletBrowserService.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserService.kt b/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserService.kt index 4ed48584bc..dac4bc828e 100644 --- a/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserService.kt +++ b/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserService.kt @@ -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) {