Fix: Breadcrumb disappearing #3
Reference in New Issue
Block a user
Delete Branch "claude/issue-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
createPathSegment(Graph.tsx) that caused breadcrumbs to disappear when navigating backwards.Root Cause
The
onClickhandler increatePathSegmentclosed over thegraphsPathvariable from the render at the time the segment was created. When the user navigated deeper (e.g. Main → Ocean → End),oceanSegment.onClickstill referenced the oldgraphsPath = [mainSegment]. Clicking "Ocean" would callfindIndexon that stale snapshot, get-1, thensplice(0)wiped the entire breadcrumb array.Fix
Changed the
onClickhandler to use the functional updater form ofsetGraphsPath, sofindIndexalways runs against the current state instead of a stale closure:Closes #2