From a244632e0a03e1b198f9177a259f7e959b519db3 Mon Sep 17 00:00:00 2001 From: marcoitaloesp-ai Date: Tue, 16 Dec 2025 11:32:44 +0000 Subject: [PATCH] =?UTF-8?q?v1.43.1=20-=20Fix:=20Espa=C3=A7os=20em=20branco?= =?UTF-8?q?=20mobile=20eliminados=20+=20Textos=20compactos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 23 +++++++++++ README.md | 2 +- VERSION | 2 +- .../dashboard/BalanceProjectionChart.jsx | 17 ++++----- .../components/dashboard/CashflowChart.jsx | 15 ++++++-- .../dashboard/OverpaymentsAnalysis.jsx | 18 ++++----- frontend/src/pages/Dashboard.jsx | 38 +++++++++++-------- 7 files changed, 76 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b02b061..d1c2126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,29 @@ O formato segue [Keep a Changelog](https://keepachangelog.com/pt-BR/). Este projeto adota [Versionamento Semântico](https://semver.org/pt-BR/). +## [1.43.1] - 2025-12-16 + +### Fixed +- **Espaços em branco desnecessários em Mobile** - Otimização completa de altura e padding + - Widget Fluxo de Caixa: + - Removido `h-100` em mobile (agora se ajusta ao conteúdo) + - Card-body padding reduzido: 1rem + - Estados loading/erro: altura 280px (antes 350px fixo) + - Gráfico: 280px (mobile) vs 350px (desktop) + - Resumo: margens reduzidas `mt-3 pt-2` + - Widget Projeção de Saldo: + - Card-body padding: 1rem em mobile + - Gráfico reduzido: 250px (mobile) vs 350px (desktop) + - Alertas compactos: padding `p-2`, margens `mb-2/mb-3`, fonte 0.75rem + - Textos abreviados em alertas para economizar espaço + +### Improved +- **Abreviações em textos mobile** - Labels compactos sem quebra de linha + - Fluxo de Caixa: "RECEITAS", "DESPESAS", "MÉD. REC.", "MÉD. DESP." + - Sobrepagamentos: "TOTAL", "QTD", "MÉDIA" + - Alertas: "Saldo negativo em" ao invés de "Previsão de saldo negativo em" + - Todos com `whiteSpace: 'nowrap'` para prevenir quebras + ## [1.43.0] - 2025-12-16 ### Added diff --git a/README.md b/README.md index 19864b4..ddc5f38 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ cd frontend && ./deploy.sh ### Backend ```bash cd backend && ./deploy.sh -``` +```github/.DIRETRIZES_DESENVOLVIMENTO_v5 ## 📖 Documentação diff --git a/VERSION b/VERSION index b978278..3987c47 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.43.0 +1.43.1 diff --git a/frontend/src/components/dashboard/BalanceProjectionChart.jsx b/frontend/src/components/dashboard/BalanceProjectionChart.jsx index 31854e7..8ea6e1b 100644 --- a/frontend/src/components/dashboard/BalanceProjectionChart.jsx +++ b/frontend/src/components/dashboard/BalanceProjectionChart.jsx @@ -259,19 +259,18 @@ const BalanceProjectionChart = () => { )} -
+
{/* Summary Stats */} {summary && ( <> {/* Alert if overdue transactions included */} {summary.overdue_count > 0 && ( -
- +
+
{t('reports.projectionChart.overdueIncluded') || 'Atenção'}:{' '} {summary.overdue_count} {t('reports.projectionChart.overdueTransactions') || 'transação(ões) em atraso'}{' '} - {t('reports.projectionChart.includedInProjection') || 'já incluída(s) no saldo atual'}. - {' '} + {!isMobile && (t('reports.projectionChart.includedInProjection') || 'já incluída(s) no saldo atual.')}{' '} ({summary.overdue_impact >= 0 ? '+' : ''}{currency(summary.overdue_impact, data?.currency)}) @@ -328,18 +327,18 @@ const BalanceProjectionChart = () => { {/* Alert if negative balance predicted */} {summary?.negative_month && ( -
- +
+
{t('reports.projectionChart.warning') || 'Atenção!'}{' '} - {t('reports.projectionChart.negativeAlert') || 'Previsão de saldo negativo em'}{' '} + {isMobile ? 'Saldo negativo em' : (t('reports.projectionChart.negativeAlert') || 'Previsão de saldo negativo em')}{' '} {summary.negative_month}
)} {/* Chart */} -
+
diff --git a/frontend/src/components/dashboard/CashflowChart.jsx b/frontend/src/components/dashboard/CashflowChart.jsx index 281ea6e..135dab2 100644 --- a/frontend/src/components/dashboard/CashflowChart.jsx +++ b/frontend/src/components/dashboard/CashflowChart.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { Chart as ChartJS, CategoryScale, @@ -36,10 +36,17 @@ const CashflowChart = ({ data, loading, scale = 'monthly', primaryCurrency = 'EU const { t } = useTranslation(); const { currency } = useFormatters(); const chartRef = useRef(null); + const [isMobile, setIsMobile] = useState(window.innerWidth < 768); + + useEffect(() => { + const handleResize = () => setIsMobile(window.innerWidth < 768); + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); + }, []); if (loading) { return ( -
+
Loading...
@@ -49,7 +56,7 @@ const CashflowChart = ({ data, loading, scale = 'monthly', primaryCurrency = 'EU if (!data || data.length === 0) { return ( -
+

{t('dashboard.noDataAvailable')}

@@ -211,7 +218,7 @@ const CashflowChart = ({ data, loading, scale = 'monthly', primaryCurrency = 'EU }; return ( -
+
); diff --git a/frontend/src/components/dashboard/OverpaymentsAnalysis.jsx b/frontend/src/components/dashboard/OverpaymentsAnalysis.jsx index 87e1a85..440957f 100644 --- a/frontend/src/components/dashboard/OverpaymentsAnalysis.jsx +++ b/frontend/src/components/dashboard/OverpaymentsAnalysis.jsx @@ -273,30 +273,30 @@ const OverpaymentsAnalysis = ({ data, loading, onTransactionClick }) => {
- - {t('dashboard.totalOverpaid')} + + {isMobile ? 'TOTAL' : t('dashboard.totalOverpaid')} - + +{currency(selectedMonthData.total, 'BRL')}
- - {t('dashboard.transactions')} + + {isMobile ? 'QTD' : t('dashboard.transactions')} - + {selectedMonthData.count}
- - {t('dashboard.avgPerTransaction')} + + {isMobile ? 'MÉDIA' : t('dashboard.avgPerTransaction')} - + +{currency(selectedMonthData.total / selectedMonthData.count, 'BRL')}
diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 4103ff5..096576a 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -21,6 +21,7 @@ const Dashboard = () => { const [loading, setLoading] = useState(true); const [cashflowLoading, setCashflowLoading] = useState(true); const [variancesLoading, setVariancesLoading] = useState(true); + const [isMobile, setIsMobile] = useState(window.innerWidth < 768); // Dados do dashboard const [summary, setSummary] = useState(null); @@ -32,6 +33,13 @@ const Dashboard = () => { const [cashflowMonths, setCashflowMonths] = useState(12); const [variancesMonths, setVariancesMonths] = useState(12); + // Detectar resize + useEffect(() => { + const handleResize = () => setIsMobile(window.innerWidth < 768); + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); + }, []); + // Carregar resumo geral const loadSummary = useCallback(async () => { try { @@ -325,7 +333,7 @@ const Dashboard = () => {
{/* Coluna Principal - Fluxo de Caixa */}
-
+
@@ -346,7 +354,7 @@ const Dashboard = () => { ))}
-
+
{ {/* Resumo do período */} {cashflow && !cashflowLoading && ( -
+
- - {t('dashboard.totalIncome')} + + {isMobile ? 'RECEITAS' : t('dashboard.totalIncome')} - + {currency(cashflow.totals?.income || 0, summary?.primary_currency || 'EUR')}
- - {t('dashboard.totalExpenses')} + + {isMobile ? 'DESPESAS' : t('dashboard.totalExpenses')} - + {currency(cashflow.totals?.expense || 0, summary?.primary_currency || 'EUR')}
- - {t('dashboard.avgIncome')} + + {isMobile ? 'MÉD. REC.' : t('dashboard.avgIncome')} - + {currency(cashflow.totals?.average_income || 0, summary?.primary_currency || 'EUR')}
- - {t('dashboard.avgExpense')} + + {isMobile ? 'MÉD. DESP.' : t('dashboard.avgExpense')} - + {currency(cashflow.totals?.average_expense || 0, summary?.primary_currency || 'EUR')}