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