MCPcopy Index your code
hub / github.com/modem-dev/hunk / notesCacheKey

Function notesCacheKey

src/ui/diff/diffSectionGeometry.ts:54–74  ·  view source on GitHub ↗

Stable suffix that captures note content/order for the geometry cache key.

(visibleAgentNotes: VisibleAgentNote[])

Source from the content-addressed store, hash-verified

52
53/** Stable suffix that captures note content/order for the geometry cache key. */
54function notesCacheKey(visibleAgentNotes: VisibleAgentNote[]) {
55 if (visibleAgentNotes.length === 0) {
56 return "";
57 }
58
59 return `:notes:${visibleAgentNotes
60 .map(({ annotation }) => {
61 const key = JSON.stringify({
62 author: annotation.author,
63 id: annotation.id,
64 newRange: annotation.newRange,
65 oldRange: annotation.oldRange,
66 rationale: annotation.rationale,
67 source: annotation.source,
68 summary: annotation.summary,
69 title: annotation.title,
70 });
71 return `${key.length}:${key}`;
72 })
73 .join("")}`;
74}
75
76/** Stable suffix that captures expansion state for the geometry cache key. */
77function expansionCacheKey(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected