From cd54a983c3843242396c7f36302b192a51766bdb Mon Sep 17 00:00:00 2001 From: Antigravity Date: Fri, 29 May 2026 14:20:50 +0000 Subject: [PATCH] feat: AI chat tone selector + graph node pinning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ai-chat: sélecteur tone (Professional/Créatif/Académique/Décontracté) passé via noteContext.tone dans le body vers /api/chat - network-graph: dragended garde fx/fy → nœud épinglé après drag double-clic sur nœud pour désépingler (fx=null, fy=null) - sprint-status: 6-2 et 6-3 passés en done Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/sprint-status.yaml | 4 ++-- memento-note/components/ai-chat.tsx | 28 +++++++++++++++++++++++ memento-note/components/network-graph.tsx | 9 ++++++-- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/docs/sprint-status.yaml b/docs/sprint-status.yaml index aa1ee9e..6affb13 100644 --- a/docs/sprint-status.yaml +++ b/docs/sprint-status.yaml @@ -64,8 +64,8 @@ development_status: # Epic 6 — Croissance & Activation (PLG) — ajouté 2026-05-29 epic-6: in-progress 6-1-onboarding-activation: done # story-onboarding-activation.md - 6-2-markdown-roundtrip: review # brief-markdown-roundtrip.md - 6-3-brainstorm-canvas-finalize: review # story: 6-3-brainstorm-canvas-finalize.md + 6-2-markdown-roundtrip: done # brief-markdown-roundtrip.md + 6-3-brainstorm-canvas-finalize: done # story: 6-3-brainstorm-canvas-finalize.md 6-4-chat-with-pdf: done # already implemented: document-qa-overlay.tsx + document-ingestion + document-search tool 6-5-pptx-export-watermark: done # story: 6-5-pptx-export-watermark.md epic-6-retrospective: optional diff --git a/memento-note/components/ai-chat.tsx b/memento-note/components/ai-chat.tsx index 8785e7b..9b442f5 100644 --- a/memento-note/components/ai-chat.tsx +++ b/memento-note/components/ai-chat.tsx @@ -42,6 +42,7 @@ export function AIChat({ showFloatingTrigger = true }: { showFloatingTrigger?: b const [input, setInput] = useState('') const [conversationId, setConversationId] = useState() const [isContextualAIVisible, setIsContextualAIVisible] = useState(false) + const [tone, setTone] = useState<'professional' | 'creative' | 'academic' | 'casual'>('professional') const [history, setHistory] = useState([]) const [historyLoading, setHistoryLoading] = useState(false) @@ -97,6 +98,7 @@ export function AIChat({ showFloatingTrigger = true }: { showFloatingTrigger?: b webSearch: webSearch && webSearchAvailable, conversationId: convId, language, + noteContext: { title: '', content: '', tone }, } } ) @@ -273,6 +275,32 @@ export function AIChat({ showFloatingTrigger = true }: { showFloatingTrigger?: b /> + {/* Tone selector */} +
+ {(['professional', 'creative', 'academic', 'casual'] as const).map((t_) => { + const labels: Record = { + professional: '💼 Pro', + creative: '✨ Créatif', + academic: '🎓 Académique', + casual: '😊 Décontracté', + } + return ( + + ) + })} +
+ {/* Messages */} {messages.length === 0 && (
diff --git a/memento-note/components/network-graph.tsx b/memento-note/components/network-graph.tsx index 477eef4..f96bb11 100644 --- a/memento-note/components/network-graph.tsx +++ b/memento-note/components/network-graph.tsx @@ -241,6 +241,11 @@ export function NetworkGraph({ return String(d.clusterId) === selectedClusterId ? 1 : 0.15 }) .on('click', (event, d) => onNoteSelect(d.id)) + .on('dblclick', (event, d) => { + d.fx = null + d.fy = null + simulation.alphaTarget(0.1).restart() + }) .call(d3.drag() .on('start', dragstarted) .on('drag', dragged) @@ -328,8 +333,8 @@ export function NetworkGraph({ function dragended(event: any, d: D3Node) { if (!event.active) simulation.alphaTarget(0) - d.fx = null - d.fy = null + // Garder le nœud épinglé à sa position après drag (fx/fy non remis à null) + // Double-clic pour désépingler → géré via dblclick ci-dessous } return () => {