From 42285fc448335f3a711c1be8a12b3f2d4a985200 Mon Sep 17 00:00:00 2001 From: zeim839 Date: Mon, 7 Apr 2025 13:22:36 -0400 Subject: [PATCH] fix: truncate long note titles in graph --- components/graph.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/graph.tsx b/components/graph.tsx index f291211..3129b4d 100644 --- a/components/graph.tsx +++ b/components/graph.tsx @@ -55,7 +55,8 @@ export default function GraphView() { // graphElements transforms nodes and edges into cytoscape elements. const graphElements = () => { const elements : object[] = notes.map(note => ( - { data: { id: note.id?.toString(), title: note.title } } + { data: { id: note.id?.toString(), title: (note.title.length >= 23) + ? note.title.slice(0, 20) + "..." : note.title } } )) return elements.concat(edges.map(edge => ( { data: { source: edge.src.toString(),