MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / pushNavigation

Function pushNavigation

graph-ui/src/graph/navigation-history.ts:46–53  ·  view source on GitHub ↗
(history: NavigationHistory<T>, entry: T, options: NavigationHistoryOptions<T>)

Source from the content-addressed store, hash-verified

44
45/** Ein neuer Schritt. Gleicht er dem aktuellen, bleibt alles, wie es ist. */
46export function pushNavigation<T>(history: NavigationHistory<T>, entry: T, options: NavigationHistoryOptions<T>): NavigationHistory<T> {
47 const current = history.entries[history.index];
48 if (current !== undefined && options.key(current) === options.key(entry)) return history;
49 const limit = Math.max(1, options.limit ?? NAVIGATION_HISTORY_LIMIT);
50 const kept = [...history.entries.slice(0, history.index + 1), entry];
51 const entries = kept.slice(Math.max(0, kept.length - limit));
52 return { entries, index: entries.length - 1, recent: visit(history.recent, entry, options) };
53}
54
55/**
56 * Den aktuellen Eintrag ersetzen statt einen Schritt abzulegen (K27): fuer

Callers 7

GalaxyPanelFunction · 0.90
pushFunction · 0.90
useArchitectureHistoryFunction · 0.90
pushFunction · 0.90
replaceNavigationFunction · 0.85

Calls 2

keyMethod · 0.80
visitFunction · 0.70

Tested by 2

pushFunction · 0.72
pushFunction · 0.72