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

Function focusCommentsPanel

packages/app-core/src/components/VimNav.tsx:1820–1827  ·  view source on GitHub ↗
(state: ReturnType<typeof useStore.getState>)

Source from the content-addressed store, hash-verified

1818 }
1819
1820 function focusCommentsPanel(state: ReturnType<typeof useStore.getState>): void {
1821 const panel = document.querySelector<HTMLElement>('[data-comments-panel]')
1822 panel?.focus({ preventScroll: true })
1823 const items = getCommentItems()
1824 if (items.length === 0) return
1825 const pos = findCommentPosition(items, state.activeCommentId)
1826 scrollToCommentElement(items[pos], state)
1827 }
1828
1829 function activateCommentItem(el: HTMLElement | undefined): void {
1830 if (!el) return

Callers 1

handlerFunction · 0.85

Calls 3

getCommentItemsFunction · 0.85
findCommentPositionFunction · 0.85
scrollToCommentElementFunction · 0.85

Tested by

no test coverage detected