diff --git a/app/src/main/java/com/droiddeck/launcher/ui/BottomChatPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/BottomChatPage.kt index 6bdf35651..40219d4dc 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/BottomChatPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/BottomChatPage.kt @@ -36,6 +36,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.compose.ui.viewinterop.AndroidView import com.droiddeck.launcher.R +import com.droiddeck.launcher.session.SessionEvents import com.droiddeck.launcher.session.SessionService import com.droiddeck.launcher.session.SessionState import com.droiddeck.launcher.session.SteamWebLogin @@ -82,6 +83,28 @@ internal const val STEAM_CHAT_FIT_CSS = "html,body,#friendslist-container,.chat_main,.chat_main_flex,.friendsListContainer,.friendlist{height:100%!important}" + ".chat_main>:has(~.chat_main_flex){display:none!important}" +// Test builds only: records the chat's element tree under .chat_main (tags, ids, classes, sizes, flex settings; no +// text) to see what still limits the friends column. Remove once the layout is fixed. It goes to the session's +// events.jsonl because the Retroid Pocket Duo's logcat drops app lines below error level. +private const val CHAT_LAYOUT_PROBE = "(function(){" + + "function m(v){return String(v).replace(/\\d{6,}/g,'#');}" + + "function d(e){var r=e.getBoundingClientRect(),c=getComputedStyle(e);" + + "var k=typeof e.className==='string'&&e.className.trim()?'.'+e.className.trim().split(/\\s+/).slice(0,4).join('.'):'';" + + "return m(e.tagName.toLowerCase()+(e.id?'#'+e.id:'')+k)+' y='+Math.round(r.top)+' h='+Math.round(r.height)+" + + "' css='+c.height+' min='+c.minHeight+' max='+c.maxHeight+' disp='+c.display+' dir='+c.flexDirection+" + + "' flex='+c.flex+' pos='+c.position+' ov='+c.overflowY+(e.style.height?' inline='+e.style.height:'');}" + + "var out=[];function t(e,n){if(!e||out.length>=220)return;out.push(n+' '+d(e));" + + "if(n<12)for(var i=0;i + SessionEvents.record("chat.layout", mapOf("round" to round, "layout" to json)) + } +} + @Composable fun BottomChatPage() { val context = LocalContext.current @@ -178,6 +201,9 @@ private fun SteamChatView(onStopped: () -> Unit) { override fun onPageFinished(view: WebView, url: String) { val scale = view.resources.displayMetrics.density * CHAT_PAGE_SCALE if (view.width > 0) view.evaluateJavascript(steamChatFitScript((view.width / scale).roundToInt(), CHAT_PAGE_SCALE), null) + SessionEvents.record("chat.page_finished", mapOf("url" to url.substringBefore('?'), "view" to "${view.width}x${view.height}")) + view.postDelayed({ logChatLayout(view, 1) }, 4_000L) + view.postDelayed({ logChatLayout(view, 2) }, 12_000L) } // Android ends the page's renderer once DroidDeck goes to picture-in-picture ("isolated not needed"