From 0c6ec43a8dd3a62bc8d77104bdd040204513aa7b Mon Sep 17 00:00:00 2001 From: another-simple-pixel Date: Sat, 16 May 2026 11:54:26 -0700 Subject: [PATCH] Section + Theme: lighten LIGHT canvas to 0.97; revert custom hover overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User feedback: the off-white canvas at 0.95 (#F2F2F2) read as too dark. Two coordinated changes: - canvasColorForCurrentTheme LIGHT branch: 0.95f → 0.97f. Canvas now #F7F7F7 (3% darker than white, was 5%). Still distinct from pure white card but lighter. - Drop the custom sectionItemHover Modifier helper (and its hoverable + InteractionSource + background machinery). The reason for the custom hover was that the default Material 0.04-alpha ripple hover (#F5F5F5 on white card) blended with the old #F2F2F2 canvas. With the lighter canvas at #F7F7F7 the default hover #F5F5F5 is now visibly darker than canvas (2 units delta) — visible enough at Material default without our custom override. Removed unused MutableInteractionSource and collectIsHoveredAsState imports. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../chat/simplex/common/ui/theme/Theme.kt | 2 +- .../simplex/common/views/helpers/Section.kt | 22 ------------------- 2 files changed, 1 insertion(+), 23 deletions(-) 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 313e2d07b5..ab02ee5401 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.95f) + DefaultTheme.LIGHT -> c.background.mixWith(c.onBackground, 0.97f) 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 58e4926cd1..4884e2543c 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 @@ -1,6 +1,4 @@ import androidx.compose.foundation.* -import androidx.compose.foundation.interaction.MutableInteractionSource -import androidx.compose.foundation.interaction.collectIsHoveredAsState import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.* @@ -35,23 +33,6 @@ val CARD_ITEM_PADDING = CARD_PADDING - 1.dp // standalone usage (alerts, pickers, custom contexts) unaffected. private val LocalInSectionCard = staticCompositionLocalOf { false } -// Modern hover overlay for section card items (replaces deprecated RippleTheme -// override). Adds its own hover-state background so the hovered row is visible -// against the off-white LIGHT canvas (where the default 0.04-alpha ripple hover -// blends in). Click ripple is still provided by Modifier.clickable's own -// indication — this only handles the persistent hover overlay. -// `enabled = false` suppresses hover for disabled items. -// `clickable = false` suppresses hover for rows whose action is an inline -// control (switch, dropdown) rather than navigating the whole row — those -// rows aren't "interactive as a whole", so hover feedback is misleading. -@Composable -private fun Modifier.sectionItemHover(enabled: Boolean = true, clickable: Boolean = true): Modifier { - if (!enabled || !clickable || !LocalInSectionCard.current) return this - val interactionSource = remember { MutableInteractionSource() } - val isHovered by interactionSource.collectIsHoveredAsState() - val hoverColor = if (isHovered) MaterialTheme.colors.onBackground.copy(alpha = 0.05f) else Color.Transparent - return this.hoverable(interactionSource).background(hoverColor) -} @Composable private fun Modifier.sectionItemDivider(): Modifier { @@ -204,7 +185,6 @@ fun SectionItemView( val modifier = Modifier .fillMaxWidth() .sizeIn(minHeight = minHeight) - .sectionItemHover(enabled = !disabled, clickable = click != null) .sectionItemDivider() Row( if (click == null || disabled) modifier.padding(padding) else modifier.clickable(onClick = click).padding(padding), @@ -245,7 +225,6 @@ fun SectionItemViewLongClickable( val modifier = Modifier .fillMaxWidth() .sizeIn(minHeight = minHeight) - .sectionItemHover(enabled = !disabled) .sectionItemDivider() Row( if (disabled) { @@ -271,7 +250,6 @@ fun SectionItemViewSpaceBetween( val modifier = Modifier .fillMaxWidth() .sizeIn(minHeight = minHeight) - .sectionItemHover(enabled = !disabled, clickable = click != null) .sectionItemDivider() Row( if (click == null || disabled) modifier.padding(padding).padding(vertical = DEFAULT_MIN_SECTION_ITEM_PADDING_VERTICAL) else modifier