Defer graph link selection during flight

This commit is contained in:
Meta Vens 2026-05-23 17:24:13 +01:00
commit fbb5100154
2 changed files with 17 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -386,6 +386,7 @@ function App() {
const [graphState, setGraphState] = React.useState<EpiphanyGraphsState | null>(null)
const [contentIndex, setContentIndex] = React.useState<QuartzContentIndex | null>(null)
const [selection, setSelection] = React.useState<ViewerSelection | null>(null)
const [navigationSelection, setNavigationSelection] = React.useState<ViewerSelection | null>(null)
const [articleCache, setArticleCache] = React.useState<Record<string, ArticleState>>({})
const [error, setError] = React.useState<Error | null>(null)
const articleCacheRef = React.useRef<Record<string, ArticleState>>({})
@ -497,12 +498,17 @@ function App() {
}, [slugs])
const selectNote = React.useCallback((slug: string) =>
setSelection({
setNavigationSelection({
kind: "node",
graphKey: "architecture",
nodeId: slug,
}), [])
const onNavigationComplete = React.useCallback((nextSelection: ViewerSelection) => {
setNavigationSelection(null)
setSelection(nextSelection)
}, [])
const onArticleLinkClick = React.useCallback(
(event: React.MouseEvent<HTMLElement>) => {
const anchor = (event.target as HTMLElement).closest("a[href]")
@ -549,6 +555,8 @@ function App() {
state={graphState}
title="Zyphos Vault Backlink Web"
selection={selection}
navigationSelection={navigationSelection}
onNavigationComplete={onNavigationComplete}
onSelectionChange={setSelection}
overlayPanels
className="zyphos-graph-shell"