From 1fc790f0c7d6e5d635219edc123a1e266414fcde Mon Sep 17 00:00:00 2001 From: Antigravity Date: Sun, 28 Jun 2026 09:28:36 +0000 Subject: [PATCH] =?UTF-8?q?feat(insights):=20bouton=20Fit=20view=20sur=20l?= =?UTF-8?q?e=20graphe=20=E2=80=94=20reset=20zoom=20+=20clear=20focus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - zoomRef stocke le behavior d3.zoom pour accès externe au useEffect - handleFitView: d3.zoomIdentity reset (600ms transition) + clear selectedClusterId - Bouton Maximize2 en haut à droite du graphe avec aria-label - cursor-pointer + focus-visible:ring pour a11y --- .cursor/hooks/state/continual-learning.json | 4 ++-- memento-note/components/network-graph.tsx | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.cursor/hooks/state/continual-learning.json b/.cursor/hooks/state/continual-learning.json index 2d5d3a5..c25f107 100644 --- a/.cursor/hooks/state/continual-learning.json +++ b/.cursor/hooks/state/continual-learning.json @@ -1,8 +1,8 @@ { "version": 1, "lastRunAtMs": 1782633053032, - "turnsSinceLastRun": 6, + "turnsSinceLastRun": 7, "lastTranscriptMtimeMs": 1782633052959.9294, - "lastProcessedGenerationId": "fa1ae817-7a99-4fd6-8b50-8407600557dd", + "lastProcessedGenerationId": "5c41c5b1-0c40-4c8e-a6df-b22e873df8f6", "trialStartedAtMs": null } diff --git a/memento-note/components/network-graph.tsx b/memento-note/components/network-graph.tsx index 2fbef0e..9bd868e 100644 --- a/memento-note/components/network-graph.tsx +++ b/memento-note/components/network-graph.tsx @@ -2,6 +2,7 @@ import { useEffect, useRef } from 'react' import * as d3 from 'd3' +import { Maximize2 } from 'lucide-react' interface Note { id: string @@ -49,6 +50,7 @@ export function NetworkGraph({ }: NetworkGraphProps) { const svgRef = useRef(null) const containerRef = useRef(null) + const zoomRef = useRef(null) useEffect(() => { if (!svgRef.current || !containerRef.current) return @@ -67,6 +69,7 @@ export function NetworkGraph({ g.attr('transform', event.transform) }) + zoomRef.current = zoom svg.call(zoom as any) // Filter notes with cluster assignments @@ -348,6 +351,15 @@ export function NetworkGraph({ } }, [notes, clusters, bridgeNotes, onNoteSelect, selectedClusterId]) + const handleFitView = () => { + if (!svgRef.current || !zoomRef.current) return + d3.select(svgRef.current) + .transition() + .duration(600) + .call(zoomRef.current.transform, d3.zoomIdentity) + onClusterSelect?.(null) + } + return (
{/* Pastilles de cluster — cliquables pour activer le focus */} @@ -378,6 +390,15 @@ export function NetworkGraph({ )}
+ {/* Fit view button */} + )