Stable suffix that captures note content/order for the geometry cache key.
(visibleAgentNotes: VisibleAgentNote[])
| 52 | |
| 53 | /** Stable suffix that captures note content/order for the geometry cache key. */ |
| 54 | function 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. */ |
| 77 | function expansionCacheKey( |
no outgoing calls
no test coverage detected