fix(dual-screen): show the online friends above Steam chat's group chat list

Steam gives its group chat list a fixed 114 px height plus an empty-list
note, which covered the online friends in the bottom-screen chat. The list
now shrinks to its rows (at most a quarter of the panel) and the note is
hidden; the GROUP CHATS bar and its + button stay.
This commit is contained in:
The412Banner committed 2026-10-31 19:49:46 +00:00
1 parent 5045002de1
commit 995cbc411c
2 files changed
+12 -2

No files matched your search

@@ -69,7 +69,9 @@ internal fun desktopUserAgent(webView: String?): String {
/**
* At the panel's own scale Steam's desktop chat gets about 600x300 CSS pixels and its friends list collapses, so the
* page is laid out [cssWidth] wide and drawn at [scale]. Steam's site header (the rows before .chat_main_flex; its
* class name is generated) is hidden to leave the height to the friends list and the chat.
* class name is generated) is hidden to leave the height to the friends list and the chat. The group chat list keeps
* a fixed 114 px height and an empty-list note that cover the online friends, so it shrinks to its rows (at most a
* quarter of the panel) and the note is hidden.
*/
internal fun steamChatFitScript(cssWidth: Int, scale: Float): String {
val zoom = "%.2f".format(java.util.Locale.US, scale)
@@ -81,7 +83,9 @@ internal fun steamChatFitScript(cssWidth: Int, scale: Float): String {
"window.dispatchEvent(new Event('resize'));})()"
}
internal const val STEAM_CHAT_FIT_CSS = ".chat_main>:has(~.chat_main_flex){display:none!important}"
internal const val STEAM_CHAT_FIT_CSS = ".chat_main>:has(~.chat_main_flex){display:none!important}" +
".ChatRoomList_Empty{display:none!important}" +
".chatRoomListContainer{height:auto!important;max-height:25vh!important}"
@Composable
fun BottomChatPage() {
@@ -29,6 +29,12 @@ class BottomChatPageTest {
}
}
@Test fun theGroupChatListLeavesRoomForTheOnlineFriends() {
assertTrue(STEAM_CHAT_FIT_CSS.contains(".ChatRoomList_Empty{display:none!important}"))
assertTrue(STEAM_CHAT_FIT_CSS.contains(".chatRoomListContainer{height:auto!important;max-height:25vh!important}"))
assertTrue(STEAM_CHAT_FIT_CSS.contains(".chat_main>:has(~.chat_main_flex){display:none!important}"))
}
@Test fun desktopAgentKeepsTheWebViewChromeVersion() {
val ua = desktopUserAgent("Mozilla/5.0 (Linux; Android 15; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.122 Mobile Safari/537.36")
assertEquals("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.122 Safari/537.36", ua)