From 3223824edb03d3f5657af55dc8b01a8e79259f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Falc=C3=B3n?= Date: Fri, 12 Jun 2026 16:21:23 +0200 Subject: [PATCH] fix(transactions): improve mobile analysis button affordance (#520) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Improves the transaction actions menu on mobile: - **Tap-to-show tooltip instead of a modal** — when the Analysis button is tapped with no filter applied, it now shows the same tooltip used on desktop ("Apply a filter to enable this button") via a controlled Radix tooltip, instead of opening a separate modal dialog. - **Always show the "Analysis" label on mobile** — previously the mobile button was icon-only, which made it hard to understand. It now shows the icon + label like desktop. - **Move "Add transaction" into the more-actions dropdown on mobile** — frees up horizontal space so the Analysis label fits. On desktop the standalone Add transaction button is unchanged. ## Notes - Reuses the existing `Add transaction` translation key (already in `lang/es.json`). - Removed the now-unused `Dialog` import/markup. ## Test plan - [ ] On mobile, tap Analysis with no filter → tooltip appears on tap, dismisses on tap outside. - [ ] On mobile, the Analysis button shows its label. - [ ] On mobile, "Add transaction" appears in the more-actions (⌄) dropdown. - [ ] On desktop, behavior is unchanged (hover tooltip, standalone Add transaction button). --- .../transactions/transaction-actions-menu.tsx | 128 ++++++++++-------- 1 file changed, 69 insertions(+), 59 deletions(-) diff --git a/resources/js/components/transactions/transaction-actions-menu.tsx b/resources/js/components/transactions/transaction-actions-menu.tsx index 82faad76..7e7d1bae 100644 --- a/resources/js/components/transactions/transaction-actions-menu.tsx +++ b/resources/js/components/transactions/transaction-actions-menu.tsx @@ -1,13 +1,6 @@ import { categorize } from '@/actions/App/Http/Controllers/TransactionController'; import { Button } from '@/components/ui/button'; import { ButtonGroup } from '@/components/ui/button-group'; -import { - Dialog, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, -} from '@/components/ui/dialog'; import { DropdownMenu, DropdownMenuContent, @@ -84,7 +77,7 @@ export function TransactionActionsMenu({ const handleAnalysisClick = () => { if (!canAnalyze) { if (isMobile) { - setAnalysisHintOpen(true); + setAnalysisHintOpen((open) => !open); } return; } @@ -130,20 +123,35 @@ export function TransactionActionsMenu({ {features.transactionAnalysis && (isMobile ? ( - + + + + + + {!canAnalyze && ( + + {__( + 'Apply a filter to enable this button', + )} + + )} + + ) : ( @@ -211,32 +219,36 @@ export function TransactionActionsMenu({ - - - - - - - {!isKeySet - ? __('Unlock encryption to add transactions') - : __('Create a new transaction')} - - - + {!isMobile && ( + + + + + + + {!isKeySet + ? __( + 'Unlock encryption to add transactions', + ) + : __('Create a new transaction')} + + + + )} @@ -258,6 +270,15 @@ export function TransactionActionsMenu({ + {isMobile && ( + + + {__('Add transaction')} + + )} )} - - - - - {__('Analysis')} - - {__('Apply a filter to enable this button')} - - - - ); }