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.
This commit is contained in:
abhay-codes07 2026-07-22 17:22:57 +05:30
parent 90f709bf8d
commit 3cf299d825
No known key found for this signature in database

View file

@ -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(() => {