From 40cfdc93571cd0a1ec69725186aaf8e0628f6806 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Fri, 29 May 2026 12:26:32 +0000 Subject: [PATCH] fix: slide graphe noire + nombre slides adaptatif MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - slides-renderer: SlideChart supporte le nouveau format plat (slide.chartType + slide.data[{label,value}]) en plus de slide.chart → corrige la slide noire avec légende visible mais graphe vide - slides.tool: nombre de slides adapté au contenu (3-4 pour note courte, 5-7 moyenne, 8-12 longue) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- memento-note/components/lab/slides-renderer.tsx | 13 ++++++++++++- memento-note/lib/ai/tools/slides.tool.ts | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/memento-note/components/lab/slides-renderer.tsx b/memento-note/components/lab/slides-renderer.tsx index d3d4a98..540bbda 100644 --- a/memento-note/components/lab/slides-renderer.tsx +++ b/memento-note/components/lab/slides-renderer.tsx @@ -25,7 +25,18 @@ const GRID_STROKE = 'rgba(255,255,255,0.07)' // ── Chart ────────────────────────────────────────────────────────────────────── function SlideChart({ slide }: { slide: SlideSpec }) { - const { chart } = slide + // Support both old format (slide.chart) and new flat format (slide.chartType + slide.data) + const chart = slide.chart ?? ( + slide.chartType || slide.data + ? { + type: slide.chartType ?? 'bar', + data: (slide.data as any[])?.map((d: any) => ({ name: d.label ?? d.name, value: d.value })) ?? [], + xKey: 'name', + yKeys: ['value'], + showLegend: true, + } + : undefined + ) if (!chart?.data?.length) return null const colors = chart.colors ?? CHART_COLORS diff --git a/memento-note/lib/ai/tools/slides.tool.ts b/memento-note/lib/ai/tools/slides.tool.ts index 845eca9..f6001ea 100644 --- a/memento-note/lib/ai/tools/slides.tool.ts +++ b/memento-note/lib/ai/tools/slides.tool.ts @@ -45,7 +45,7 @@ Available slide types: - "summary": title, items[] (conclusion with checkmarks) RULES: -- 6-12 slides per presentation +- Adapt the number of slides to the content: 3-4 slides for short notes (<200 words), 5-7 for medium, 8-12 for long/rich notes - First slide MUST be type "title" - Last slide MUST be type "summary" - Include at least 1 "chart" or "stats" slide