From 3cf299d8254159a349f83bc515d8de81bb0e6dec Mon Sep 17 00:00:00 2001 From: abhay-codes07 Date: Wed, 22 Jul 2026 17:22:57 +0530 Subject: [PATCH] fix(memory-graph): center arrow-key navigation in the visible graph area selectAndCenter passed the full containerSize.height to viewport.centerOn, while every other navigation action (auto-fit, center, zoom) uses graphFitHeight, which on compact viewports subtracts the space taken by the bottom controls. centerOn places the target at height/2, so keyboard navigation dropped the selected node at the midpoint of the whole container, partly behind the bottom control bar on mobile, instead of the midpoint of the visible graph area like the center button does. Use graphFitHeight so arrow-key selection lands where the other centering paths already do. --- packages/memory-graph/src/components/memory-graph.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/memory-graph/src/components/memory-graph.tsx b/packages/memory-graph/src/components/memory-graph.tsx index 9d0c2ef6..d165ac71 100644 --- a/packages/memory-graph/src/components/memory-graph.tsx +++ b/packages/memory-graph/src/components/memory-graph.tsx @@ -467,10 +467,10 @@ export function MemoryGraph({ n.x, n.y, containerSize.width, - containerSize.height, + graphFitHeight, ) }, - [nodes, containerSize.width, containerSize.height], + [nodes, containerSize.width, graphFitHeight], ) const navigateUp = useCallback(() => {