MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / findCommentPosition

Function findCommentPosition

packages/app-core/src/components/VimNav.tsx:1803–1808  ·  view source on GitHub ↗
(items: HTMLElement[], activeCommentId: string | null)

Source from the content-addressed store, hash-verified

1801 }
1802
1803 function findCommentPosition(items: HTMLElement[], activeCommentId: string | null): number {
1804 if (items.length === 0) return 0
1805 if (!activeCommentId) return 0
1806 const exact = items.findIndex((item) => item.dataset.commentId === activeCommentId)
1807 return exact >= 0 ? exact : 0
1808 }
1809
1810 function scrollToCommentElement(
1811 el: HTMLElement | undefined,

Callers 2

handleCommentsKeyFunction · 0.85
focusCommentsPanelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected