From 56b46f1dfa4ba7fb5161a47849de8af15e41fa80 Mon Sep 17 00:00:00 2001 From: escouade-bot Date: Wed, 18 Mar 2026 00:05:27 -0400 Subject: [PATCH 1/3] Remove hard-coded expense filter from Category Over Time report The Category Over Time report previously only showed expenses (t.amount < 0). This removes that filter so all transaction types are shown by default, and adds a type filter (expense/income/transfer) in the right filter panel. Ref: simpl-resultat#41 Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.fr.md | 4 +++ CHANGELOG.md | 4 +++ docs/guide-utilisateur.md | 2 +- src/components/reports/ReportFilterPanel.tsx | 27 ++++++++++++++++++++ src/hooks/useReports.ts | 22 ++++++++++++---- src/i18n/locales/en.json | 3 ++- src/i18n/locales/fr.json | 3 ++- src/pages/ReportsPage.tsx | 6 +++-- src/services/reportService.ts | 11 ++++++-- 9 files changed, 70 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.fr.md b/CHANGELOG.fr.md index a3d909f..5daf118 100644 --- a/CHANGELOG.fr.md +++ b/CHANGELOG.fr.md @@ -2,6 +2,10 @@ ## [Non publié] +### Modifié +- Rapport Catégorie dans le temps : suppression du filtre codé en dur sur les dépenses, affiche maintenant tous les types de transactions par défaut (#41) +- Rapport Catégorie dans le temps : ajout d'un filtre par type (dépense/revenu/transfert) dans le panneau de filtre à droite (#41) + ## [0.6.6] ### Modifié diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c15ed6..f764f12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed +- Category Over Time report: removed hard-coded expense-only filter, now shows all transaction types by default (#41) +- Category Over Time report: added type filter (expense/income/transfer) in the right filter panel (#41) + ## [0.6.6] ### Changed diff --git a/docs/guide-utilisateur.md b/docs/guide-utilisateur.md index 23463d0..4053fee 100644 --- a/docs/guide-utilisateur.md +++ b/docs/guide-utilisateur.md @@ -252,7 +252,7 @@ Visualisez vos données financières avec des graphiques interactifs et comparez - Tendances mensuelles : revenus vs dépenses dans le temps (graphique en barres) - Dépenses par catégorie : répartition des dépenses (graphique circulaire) -- Catégories dans le temps : suivez l'évolution de chaque catégorie (graphique en ligne) +- Catégories dans le temps : suivez l'évolution de chaque catégorie (graphique en barres empilées), avec filtre par type (dépense/revenu/transfert) - Budget vs Réel : tableau comparatif mensuel et cumul annuel - Rapport dynamique : tableau croisé dynamique (pivot table) personnalisable - Motifs SVG (lignes, points, hachures) pour distinguer les catégories diff --git a/src/components/reports/ReportFilterPanel.tsx b/src/components/reports/ReportFilterPanel.tsx index ec0aea0..7f21a2a 100644 --- a/src/components/reports/ReportFilterPanel.tsx +++ b/src/components/reports/ReportFilterPanel.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { Filter, Search } from "lucide-react"; import type { ImportSource } from "../../shared/types"; +import type { CategoryTypeFilter } from "../../hooks/useReports"; interface ReportFilterPanelProps { categories: { name: string; color: string }[]; @@ -11,6 +12,8 @@ interface ReportFilterPanelProps { sources: ImportSource[]; selectedSourceId: number | null; onSourceChange: (id: number | null) => void; + categoryType?: CategoryTypeFilter; + onCategoryTypeChange?: (type: CategoryTypeFilter) => void; } export default function ReportFilterPanel({ @@ -21,6 +24,8 @@ export default function ReportFilterPanel({ sources, selectedSourceId, onSourceChange, + categoryType, + onCategoryTypeChange, }: ReportFilterPanelProps) { const { t } = useTranslation(); const [search, setSearch] = useState(""); @@ -57,6 +62,28 @@ export default function ReportFilterPanel({ )} + {/* Type filter */} + {onCategoryTypeChange && ( +
+
+ + {t("categories.type")} +
+
+ +
+
+ )} + {/* Category filter */} {categories.length > 0 &&