Route hash focus through viewport target
This commit is contained in:
parent
243bba0f70
commit
5378bda3bd
3 changed files with 8 additions and 10 deletions
File diff suppressed because one or more lines are too long
|
|
@ -413,7 +413,7 @@ function App() {
|
|||
.then(({ contentIndex: nextContentIndex, graphState: nextGraphState }) => {
|
||||
if (!cancelled) {
|
||||
const nextSlugs = new Set(Object.keys(nextContentIndex).map(normalizeSlug))
|
||||
const initialSelection =
|
||||
const initialViewportTarget =
|
||||
parseHashSelection(nextSlugs) ??
|
||||
currentRouteSelection(nextSlugs) ?? {
|
||||
kind: "node" as const,
|
||||
|
|
@ -422,8 +422,7 @@ function App() {
|
|||
}
|
||||
setContentIndex(nextContentIndex)
|
||||
setGraphState(nextGraphState)
|
||||
setSelection(initialSelection)
|
||||
setViewportTarget(initialSelection)
|
||||
setViewportTarget(initialViewportTarget)
|
||||
}
|
||||
})
|
||||
.catch((caught) => {
|
||||
|
|
@ -490,7 +489,6 @@ function App() {
|
|||
const hashSelection = parseHashSelection(slugs)
|
||||
|
||||
if (hashSelection) {
|
||||
setSelection(hashSelection)
|
||||
setViewportTarget(hashSelection)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ import { QuartzComponent, QuartzComponentConstructor } from "./types"
|
|||
export default (() => {
|
||||
const ZyphosGraphShell: QuartzComponent = () => (
|
||||
<>
|
||||
<link rel="stylesheet" href="/static/epiphany-graph/assets/viewer.css?v=graph-20260523-focus2" />
|
||||
<link rel="stylesheet" href="/static/epiphany-graph/assets/viewer.css?v=graph-20260523-focus3" />
|
||||
<div class="zyphos-epiphany-graph-root"></div>
|
||||
<script type="module" src="/static/epiphany-graph/assets/viewer.js?v=graph-20260523-focus2"></script>
|
||||
<script type="module" src="/static/epiphany-graph/assets/viewer.js?v=graph-20260523-focus3"></script>
|
||||
</>
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue