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

Function hintTargetOpensNote

packages/app-core/src/lib/vim-nav.ts:12–18  ·  view source on GitHub ↗
(element: HTMLElement | null | undefined)

Source from the content-addressed store, hash-verified

10 * plain buttons return false, so they keep their own focus. (#100)
11 */
12export function hintTargetOpensNote(element: HTMLElement | null | undefined): boolean {
13 if (!element) return false
14 const sidebarPath = element.closest('[data-sidebar-path]')?.getAttribute('data-sidebar-path')
15 if (sidebarPath && !isWorkspaceVirtualTabPath(sidebarPath)) return true
16 const tabPath = element.closest('[data-tab-path]')?.getAttribute('data-tab-path')
17 return !!tabPath && !isWorkspaceVirtualTabPath(tabPath)
18}
19
20/**
21 * True when a keydown inside the home view (`data-home-nav`) should yield to the

Callers 2

VimNavFunction · 0.90
vim-nav.test.tsFile · 0.90

Calls 1

Tested by

no test coverage detected