From bced238db4e7bf1d8fbd504f56adbb5a88f8f835 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Jul 2026 13:46:27 +0000 Subject: [PATCH] fix: give the notification panel a Surface so its text follows the theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The panel's Column sat in a bare Row with no Surface above it, so LocalContentColor fell back to Color.Black and the header label was invisible on the dark theme — the same trap DisappearingScaffold documents for its own root. The Surface provides the container color and onBackground content color for everything inside the panel. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01RHSoAVvYioihaJeSumX8J7 --- .../notifications/NotificationSidePanel.kt | 77 ++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSidePanel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSidePanel.kt index d40dd9db6c..737c9439c9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSidePanel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationSidePanel.kt @@ -36,6 +36,7 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -90,48 +91,54 @@ fun NotificationSidePanel( WatchAccountForNotifications(notifFeedContentState, accountViewModel) - Column( - modifier - .width(NotificationPanelWidth) - .fillMaxHeight() - .windowInsetsPadding( + // The Surface provides the Material container color + onBackground as LocalContentColor; + // in a bare Row the default text color falls back to Color.Black and is invisible on the + // dark theme (same reason DisappearingScaffold roots itself in a Surface). + Surface( + modifier = modifier.width(NotificationPanelWidth).fillMaxHeight(), + color = MaterialTheme.colorScheme.background, + contentColor = MaterialTheme.colorScheme.onBackground, + ) { + Column( + Modifier.windowInsetsPadding( WindowInsets.systemBars.only( WindowInsetsSides.Top + WindowInsetsSides.Bottom + WindowInsetsSides.End, ), ), - ) { - Row( - modifier = - Modifier - .fillMaxWidth() - .clickable { nav.nav(Route.Notification()) } - .padding(horizontal = Size16dp, vertical = Size12dp), - verticalAlignment = Alignment.CenterVertically, ) { - Icon( - symbol = MaterialSymbols.Notifications, - contentDescription = null, - modifier = Size22Modifier, - tint = MaterialTheme.colorScheme.onBackground, - ) - Spacer(modifier = StdHorzSpacer) - Text( - text = stringRes(R.string.route_notifications), - style = MaterialTheme.typography.titleMedium, - ) - } + Row( + modifier = + Modifier + .fillMaxWidth() + .clickable { nav.nav(Route.Notification()) } + .padding(horizontal = Size16dp, vertical = Size12dp), + verticalAlignment = Alignment.CenterVertically, + ) { + Icon( + symbol = MaterialSymbols.Notifications, + contentDescription = null, + modifier = Size22Modifier, + tint = MaterialTheme.colorScheme.onBackground, + ) + Spacer(modifier = StdHorzSpacer) + Text( + text = stringRes(R.string.route_notifications), + style = MaterialTheme.typography.titleMedium, + ) + } - HorizontalDivider(thickness = DividerThickness) + HorizontalDivider(thickness = DividerThickness) - Box(Modifier.weight(1f).fillMaxWidth()) { - SingleNotificationsBody( - notifFeedContentState = notifFeedContentState, - notifPolls = accountViewModel.feedStates.notificationsOpenPolls, - scrollToEventId = null, - accountViewModel = accountViewModel, - nav = nav, - scrollStateKey = scrollStateKey, - ) + Box(Modifier.weight(1f).fillMaxWidth()) { + SingleNotificationsBody( + notifFeedContentState = notifFeedContentState, + notifPolls = accountViewModel.feedStates.notificationsOpenPolls, + scrollToEventId = null, + accountViewModel = accountViewModel, + nav = nav, + scrollStateKey = scrollStateKey, + ) + } } } }