From eebe3d69e43fa0e54bea0dadbefc9b5275b0bc72 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 3 Jul 2026 11:47:28 +0000 Subject: [PATCH] Fix unreadable light-on-amber elements in the dark theme The dark color scheme painted the amber accent containers (primary buttons, selected filter chips, the selected sidebar row, the account avatar) with the default light on-colors, so their text was light-on-amber and barely legible. Pair every amber container/accent with a dark on-color in both schemes, and let the selected sidebar row's shortcut hint inherit that dark color instead of the muted grey variant. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01YQTVwy8RBj7spdEK3aEc3i --- .../greenart7c3/nostrsigner/desktop/ui/App.kt | 8 +++++++- .../greenart7c3/nostrsigner/desktop/ui/Theme.kt | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/App.kt b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/App.kt index 4bac1f7f..0a25bde1 100644 --- a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/App.kt +++ b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/App.kt @@ -245,7 +245,13 @@ private fun SidebarItem( Text( shortcut, style = MaterialTheme.typography.labelSmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, + // On the selected (amber) row inherit the container's dark + // on-color; otherwise use the muted variant. + color = if (selected) { + MaterialTheme.colorScheme.onSecondaryContainer.copy(alpha = 0.7f) + } else { + MaterialTheme.colorScheme.onSurfaceVariant + }, maxLines = 1, softWrap = false, ) diff --git a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/Theme.kt b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/Theme.kt index 8a6bcb86..0727323a 100644 --- a/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/Theme.kt +++ b/desktop/src/main/kotlin/com/greenart7c3/nostrsigner/desktop/ui/Theme.kt @@ -27,21 +27,35 @@ val primaryVariant = Color(0xFFC8541A) val secondaryColor = Color(0xFFFFCA62) val orange = Color(0xFFFF6B00) +// The accent (amber / orange) is light, so anything painted on top of it — +// primary buttons, selected chips, the selected sidebar row — must use dark +// text. The default dark scheme pairs these containers with light on-colors, +// which is what produced the unreadable light-on-amber elements. +private val onAccent = Color(0xFF201A0B) + private val DarkColorPalette = darkColorScheme( primary = primaryColor, - onPrimary = Color.White, + onPrimary = onAccent, secondary = primaryVariant, + onSecondary = Color.White, tertiary = secondaryColor, + onTertiary = onAccent, primaryContainer = secondaryColor, + onPrimaryContainer = onAccent, secondaryContainer = secondaryColor, + onSecondaryContainer = onAccent, ) private val LightColorPalette = lightColorScheme( primary = primaryColor, + onPrimary = onAccent, secondary = primaryVariant, tertiary = secondaryColor, + onTertiary = onAccent, primaryContainer = secondaryColor, + onPrimaryContainer = onAccent, secondaryContainer = secondaryColor, + onSecondaryContainer = onAccent, surface = Color(0xFFFFDE9E), surfaceContainer = Color(0xFFFFDE9E), )