From 962d129bd9837c1b085c10db14c200998d6bdc85 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 21 Sep 2026 12:09:09 +0000 Subject: [PATCH] fix(ui): make the last five FABs circular Audited all 76 FloatingActionButton call sites: 65 already passed shape = CircleShape, five did not and inherited Material3's defaults -- RoundedCornerShape(16.dp) for a regular FAB, 12.dp for a small one. Both read as rounded squares, which this app uses nowhere. MarkdownToolbar x2 SmallFloatingActionButton, the long-form editor's whole toolbar row, which is where they are most visible BuzzCanvasScreen x2 plain FABs, no shape home/NewChessGameButton plain FAB, no shape The convention was only ever held together by copy-paste -- nothing enforced it, so a FAB written from the Material3 API rather than from a neighbouring file came out square. That is exactly how the geocaching one went wrong too. home/NewChessGameButton appears to be an unreferenced duplicate: ChessLobbyScreen resolves to the same-package chess/ copy, which was already circular. Its shape is fixed here rather than deleting the file, which is a maintainer's call. The ten ExtendedFloatingActionButtons are deliberately untouched -- those are correctly pill-shaped, and a first pass nearly flagged them because the naive grep matches FloatingActionButton as a substring. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01WG7T9hAHDMKPaHsWvqySEr --- .../amethyst/ui/screen/loggedIn/buzz/BuzzCanvasScreen.kt | 4 +++- .../amethyst/ui/screen/loggedIn/home/NewChessGameButton.kt | 6 ++++++ .../commons/nip23LongContent/ui/editor/MarkdownToolbar.kt | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/buzz/BuzzCanvasScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/buzz/BuzzCanvasScreen.kt index 9b380f4366..6df759f919 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/buzz/BuzzCanvasScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/buzz/BuzzCanvasScreen.kt @@ -26,6 +26,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.foundation.verticalScroll import androidx.compose.material3.CircularProgressIndicator @@ -158,7 +159,7 @@ fun BuzzCanvasScreen( }, floatingActionButton = { if (canEdit) { - FloatingActionButton(onClick = { editing = true }) { + FloatingActionButton(onClick = { editing = true }, shape = CircleShape) { Icon(symbol = MaterialSymbols.Edit, contentDescription = stringRes(Res.string.buzz_canvas_edit)) } } @@ -236,6 +237,7 @@ private fun CanvasEditor( }, floatingActionButton = { FloatingActionButton( + shape = CircleShape, onClick = { val relay = RelayUrlNormalizer.normalizeOrNull(relayUrl) ?: run { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/NewChessGameButton.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/NewChessGameButton.kt index 9443a0555e..9c009dc3fe 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/NewChessGameButton.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/NewChessGameButton.kt @@ -21,7 +21,9 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.home import androidx.activity.compose.LocalActivity +import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.FloatingActionButton +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -38,6 +40,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.chess.ChessViewModelFactory import com.vitorpamplona.amethyst.ui.screen.loggedIn.chess.ChessViewModelNew import com.vitorpamplona.amethyst.ui.stringRes +import com.vitorpamplona.amethyst.ui.theme.Size55Modifier /** * Floating action button for creating new chess game challenges @@ -58,6 +61,9 @@ fun NewChessGameButton( FloatingActionButton( onClick = { showDialog = true }, + modifier = Size55Modifier, + shape = CircleShape, + containerColor = MaterialTheme.colorScheme.primary, ) { Icon( symbol = MaterialSymbols.Add, diff --git a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip23LongContent/ui/editor/MarkdownToolbar.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip23LongContent/ui/editor/MarkdownToolbar.kt index 67b5fd7745..185acec8d4 100644 --- a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip23LongContent/ui/editor/MarkdownToolbar.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/nip23LongContent/ui/editor/MarkdownToolbar.kt @@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.SmallFloatingActionButton import androidx.compose.material3.Text @@ -123,6 +124,7 @@ private fun ToolbarIconButton( onClick = onClick, containerColor = containerColor, contentColor = contentColor, + shape = CircleShape, modifier = Modifier .size(32.dp) @@ -159,6 +161,7 @@ private fun ToolbarButton( onClick = onClick, containerColor = containerColor, contentColor = contentColor, + shape = CircleShape, modifier = Modifier .size(32.dp)