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

Function HelpView

packages/app-core/src/components/HelpView.tsx:180–681  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178}
179
180export function HelpView(): JSX.Element {
181 const closeActiveNote = useStore((s) => s.closeActiveNote)
182 const setCommandPaletteOpen = useStore((s) => s.setCommandPaletteOpen)
183 const setSearchOpen = useStore((s) => s.setSearchOpen)
184 const setSettingsOpen = useStore((s) => s.setSettingsOpen)
185 const setFocusedPanel = useStore((s) => s.setFocusedPanel)
186 const keymapOverrides = useStore((s) => s.keymapOverrides)
187 const runtimePlatform = window.zen.platformSync()
188 const platformLabel =
189 runtimePlatform === 'darwin'
190 ? 'macOS'
191 : runtimePlatform === 'win32'
192 ? 'Windows'
193 : 'Linux'
194 const primaryModifierLabel =
195 runtimePlatform === 'darwin' ? 'Command (⌘)' : 'Ctrl'
196
197 const [query, setQuery] = useState('')
198 const deferredQuery = useDeferredValue(query.trim().toLowerCase())
199
200 const allCommands = buildCommands({ includeUnavailable: true })
201
202 const quickStart = useMemo(
203 () =>
204 HELP_QUICK_START.filter((card) =>
205 matchesQuery(deferredQuery, card.title, card.body)
206 ),
207 [deferredQuery]
208 )
209
210 const coreConcepts = useMemo(
211 () =>
212 HELP_CORE_CONCEPTS.filter((card) =>
213 matchesQuery(deferredQuery, card.title, card.body)
214 ),
215 [deferredQuery]
216 )
217
218 const howToGuides = useMemo(
219 () =>
220 HELP_HOW_TO_GUIDES.filter((card) =>
221 matchesQuery(deferredQuery, card.title, card.body)
222 ),
223 [deferredQuery]
224 )
225
226 const shortcutSections = useMemo(
227 () =>
228 HELP_SHORTCUT_SECTIONS.map((section) => {
229 const items = section.items.filter((item) =>
230 matchesQuery(
231 deferredQuery,
232 section.title,
233 section.description,
234 resolveShortcutKeys(section.id, item.action, keymapOverrides) ?? item.keys,
235 item.action,
236 item.detail
237 )

Callers

nothing calls this directly

Calls 7

buildCommandsFunction · 0.90
matchesQueryFunction · 0.85
resolveShortcutKeysFunction · 0.85
resolveVimCommandLabelFunction · 0.85
commandExAliasFunction · 0.85
platformSyncMethod · 0.80
shortcutFunction · 0.70

Tested by

no test coverage detected