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

Function refreshNavigation

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

Source from the content-addressed store, hash-verified

89 * Schritt und kein Auffrischen: dann bleibt alles, wie es ist.
90 */
91export function refreshNavigation<T>(history: NavigationHistory<T>, entry: T, options: NavigationHistoryOptions<T>): NavigationHistory<T> {
92 const current = history.entries[history.index];
93 if (current === undefined || current === entry || options.key(current) !== options.key(entry)) return history;
94 const entries = history.entries.map((item, at) => (at === history.index ? entry : item));
95 const place = options.recentKey?.(entry);
96 const recent = place === undefined ? history.recent : history.recent.map((item) => (options.recentKey?.(item) === place ? entry : item));
97 return { entries, index: history.index, recent };
98}
99
100/** Der Eintrag, zu dem Zurueck (-1) oder Vor (+1) fuehren wuerde. */
101export function peekNavigation<T>(history: NavigationHistory<T>, step: -1 | 1): T | undefined {

Callers 2

useArchitectureHistoryFunction · 0.90

Calls 1

keyMethod · 0.80

Tested by

no test coverage detected