From 0f3cc2e7d6d92287e17424eed9fd9172742651ab Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 13:11:27 +0000 Subject: [PATCH] =?UTF-8?q?Stats=20:=20param=C3=A8tres=20de=20la=20courbe,?= =?UTF-8?q?=20masquer=20des=20mois?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bouton ⚙ sur « Mois par mois » : aperçu de la courbe et une case par mois pour l'afficher ou non (ex. le mois d'un ajout en lot). Les mois masqués n'apparaissent plus dans la courbe ni dans « mois le plus chargé » mais les titres restent comptés partout ailleurs. Réglage synchronisé (statsHiddenMonths), inclus dans la sauvegarde, 18 langues. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe --- src/components/stats/Charts.tsx | 10 +-- src/components/stats/StatsSettings.tsx | 115 +++++++++++++++++++++++++ src/i18n/locales/ar.ts | 4 + src/i18n/locales/de.ts | 4 + src/i18n/locales/en.ts | 4 + src/i18n/locales/es.ts | 4 + src/i18n/locales/fr.ts | 4 + src/i18n/locales/hi.ts | 4 + src/i18n/locales/id.ts | 4 + src/i18n/locales/it.ts | 4 + src/i18n/locales/ja.ts | 4 + src/i18n/locales/ko.ts | 4 + src/i18n/locales/nl.ts | 4 + src/i18n/locales/pl.ts | 4 + src/i18n/locales/pt.ts | 4 + src/i18n/locales/ru.ts | 4 + src/i18n/locales/th.ts | 4 + src/i18n/locales/tr.ts | 4 + src/i18n/locales/vi.ts | 4 + src/i18n/locales/zh.ts | 4 + src/lib/backup.ts | 3 + src/lib/cloud/sync.ts | 2 +- src/pages/StatsPage.tsx | 43 +++++++-- src/store.tsx | 6 +- src/types.ts | 2 + 25 files changed, 239 insertions(+), 14 deletions(-) create mode 100644 src/components/stats/StatsSettings.tsx diff --git a/src/components/stats/Charts.tsx b/src/components/stats/Charts.tsx index 47cd6c0..a3f2a5f 100644 --- a/src/components/stats/Charts.tsx +++ b/src/components/stats/Charts.tsx @@ -50,12 +50,12 @@ export function Columns({ height = 140, label, }: { - bars: { key: string; axis: string; value: number; tip: string; highlight?: boolean }[] + bars: { key: string; axis: string; value: number; tip: string; highlight?: boolean; /** Masquée par l'utilisateur : pas de barre, libellé barré */ hidden?: boolean }[] height?: number /** Nom du graphique (lecteurs d'écran) */ label: string }) { - const max = Math.max(1, ...bars.map((b) => b.value)) + const max = Math.max(1, ...bars.filter((b) => !b.hidden).map((b) => b.value)) return (
@@ -64,8 +64,8 @@ export function Columns({ {bars.map((b) => (
0 ? 'bg-accent-fill' : 'bg-transparent', !b.highlight && 'opacity-80 group-hover:opacity-100 group-focus-visible:opacity-100')} - style={{ height: b.value > 0 ? `${Math.max(3, (b.value / max) * 100)}%` : 0 }} + className={cx('w-full max-w-9 rounded-t-[4px] transition-opacity', b.value > 0 && !b.hidden ? 'bg-accent-fill' : 'bg-transparent', !b.highlight && 'opacity-80 group-hover:opacity-100 group-focus-visible:opacity-100')} + style={{ height: b.value > 0 && !b.hidden ? `${Math.max(3, (b.value / max) * 100)}%` : 0 }} /> {b.tip} @@ -75,7 +75,7 @@ export function Columns({