From e9f0c601c276392bf1b08aa4f107bc7efa6065a8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Jul 2026 19:33:01 +0000 Subject: [PATCH] feat: make unread-dot and selected-reaction highlight follow the accent The new-item unread dot and the selected-reaction box were built from static Modifier vals whose fill was baked from the purple ColorPalette at class load, so they stayed purple under every accent. Split the color-free geometry into pre-built vals and apply the live scheme role (primary for the dot, secondaryContainer for the reaction box) in the getters, so both now track the selected accent. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01D1F9jXNwRGTP8qmsV3Wd69 --- .../vitorpamplona/amethyst/ui/theme/Theme.kt | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt index 5d10ddd218..86c8cf0451 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt @@ -284,21 +284,14 @@ val LightMaxWidthWithBackground = .fillMaxWidth() .background(LightColorPalette.background) -val DarkSelectedReactionBoxModifier = +// Geometry only — no color. The fill is applied live from the scheme's secondaryContainer in +// the selectedReactionBoxModifier getter so the selected-reaction highlight follows the accent +// instead of freezing to the purple palette captured at class load. +val SelectedReactionBoxOuterModifier = Modifier .padding(horizontal = 5.dp, vertical = 5.dp) .size(Size40dp) .clip(shape = SmallBorder) - .background(DarkColorPalette.secondaryContainer) - .padding(5.dp) - -val LightSelectedReactionBoxModifier = - Modifier - .padding(horizontal = 5.dp, vertical = 5.dp) - .size(Size40dp) - .clip(shape = SmallBorder) - .background(LightColorPalette.secondaryContainer) - .padding(5.dp) val DarkChannelNotePictureModifier = Modifier @@ -348,17 +341,13 @@ val lightLargeProfilePictureModifier = .clip(shape = CircleShape) .border(3.dp, LightColorPalette.onBackground, CircleShape) -val darkNewItemBubbleModifier = +// Geometry only — no color. The fill is applied live from the scheme's primary in the +// newItemBubbleModifier getter so the unread dot follows the accent (matching its sibling +// newItemBackgroundColor) instead of freezing to the purple palette captured at class load. +val NewItemBubbleShapeModifier = Modifier .size(10.dp) .clip(shape = CircleShape) - .background(DarkColorPalette.primary) - -val lightNewItemBubbleModifier = - Modifier - .size(10.dp) - .clip(shape = CircleShape) - .background(LightColorPalette.primary) val darkBlackTagModifier = Modifier @@ -613,7 +602,7 @@ val ColorScheme.relayIconModifier: Modifier @Suppress("ModifierFactoryExtensionFunction") val ColorScheme.selectedReactionBoxModifier: Modifier - get() = if (isLight) LightSelectedReactionBoxModifier else DarkSelectedReactionBoxModifier + get() = SelectedReactionBoxOuterModifier.background(secondaryContainer).padding(5.dp) @Suppress("ModifierFactoryExtensionFunction") val ColorScheme.largeProfilePictureModifier: Modifier @@ -621,7 +610,7 @@ val ColorScheme.largeProfilePictureModifier: Modifier @Suppress("ModifierFactoryExtensionFunction") val ColorScheme.newItemBubbleModifier: Modifier - get() = if (isLight) lightNewItemBubbleModifier else darkNewItemBubbleModifier + get() = NewItemBubbleShapeModifier.background(primary) @Suppress("ModifierFactoryExtensionFunction") val ColorScheme.blackTagModifier: Modifier