From 633e0f41406c9f50b9af315f29567452a9943dc2 Mon Sep 17 00:00:00 2001 From: another-simple-pixel Date: Sat, 16 May 2026 12:48:34 -0700 Subject: [PATCH] Section + ChatListNavLink.android: align in-card chat row divider with desktop; canvas to 0.94 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two changes: 1) Theme.kt LIGHT canvas: 0.97f → 0.94f (#F0F0F0). User wants more contrast against cards. With Material's default 0.04-alpha hover (#F5F5F5) this puts hover LIGHTER than canvas by 5 units — unusual direction but it's the user's call; they'll evaluate visually. 2) ChatListNavLinkView.android: when rendered inside a SectionView card (e.g. contact list inside NewChatSheet after the forEach-into-card refactor), use SectionDivider() — same 2dp full-width canvas-color divider as desktop. Outside a card (main chat list), fall back to the original Material `Divider(Modifier.padding(horizontal = 8.dp))` so unchanged for that context. 3) LocalInSectionCard made `internal` so the android-specific file can read it. Same pattern as LocalAppColors etc. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../common/views/chatlist/ChatListNavLinkView.android.kt | 8 +++++++- .../kotlin/chat/simplex/common/ui/theme/Theme.kt | 2 +- .../kotlin/chat/simplex/common/views/helpers/Section.kt | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.android.kt b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.android.kt index 9a3d9e5e4f..4de6261872 100644 --- a/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.android.kt +++ b/apps/multiplatform/common/src/androidMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.android.kt @@ -1,5 +1,6 @@ package chat.simplex.common.views.chatlist +import SectionDivider import androidx.compose.foundation.* import androidx.compose.foundation.layout.* import androidx.compose.material.Divider @@ -8,6 +9,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import chat.simplex.common.platform.onRightClick +import chat.simplex.common.views.helpers.LocalInSectionCard import chat.simplex.common.views.helpers.* @Composable @@ -38,5 +40,9 @@ actual fun ChatListNavLinkLayout( DefaultDropdownMenu(showMenu, dropdownMenuItems = dropdownMenuItems) } } - Divider(Modifier.padding(horizontal = 8.dp)) + if (LocalInSectionCard.current) { + SectionDivider() + } else { + Divider(Modifier.padding(horizontal = 8.dp)) + } } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/ui/theme/Theme.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/ui/theme/Theme.kt index ab02ee5401..13969a923d 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/ui/theme/Theme.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/ui/theme/Theme.kt @@ -607,7 +607,7 @@ fun canvasColorForCurrentTheme(): Color { val theme = CurrentColors.value val c = theme.colors return when (theme.base) { - DefaultTheme.LIGHT -> c.background.mixWith(c.onBackground, 0.97f) + DefaultTheme.LIGHT -> c.background.mixWith(c.onBackground, 0.94f) DefaultTheme.SIMPLEX -> c.background.darker(0.4f) else -> c.background } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/Section.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/Section.kt index 448e3f2457..072e6d84d0 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/Section.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/Section.kt @@ -31,7 +31,7 @@ val CARD_ITEM_PADDING = CARD_PADDING - 1.dp // Set to true by SectionView around its inner Column. SectionItemView reads it // to decide whether to draw the 2dp bottom divider. False default keeps // standalone usage (alerts, pickers, custom contexts) unaffected. -private val LocalInSectionCard = staticCompositionLocalOf { false } +internal val LocalInSectionCard = staticCompositionLocalOf { false } @Composable