feat(graph): navigation & UX — deep-link, depth, PNG, rich panel (PR D)
Final corpus-graph PR. Connects the graph to the chair's workflow and rounds out the Obsidian-grade interactions. Backend (web/graph_api.py): neighborhood depth cap 2 → 3 (still bounded by NODE_CAP_MAX). Frontend: - URL deep-link: /graph?focus=cl:<id> is read on mount and written on focus change (router.replace, scroll:false). GraphView wrapped in <Suspense> per Next 16's useSearchParams requirement. - "הצג בגרף" button on the precedent detail page → /graph?focus=cl:<id>. - Depth slider (1–3) in the focused overlay → useNodeNeighborhood(id, depth). - Export PNG: grabs the rendered <canvas> from the area ref → toDataURL → download; failures surface a toast (UI4). - Rich node panel: precedent nodes fetch headnote/summary via the existing usePrecedent hook (Skeleton while pending, error surfaced — UI4). - Edge-type legend (ציטוט / נושא-תחום / יומון) added under the node legend. Deferred (noted for a later pass): expand-in-place merge, search→camera-center. web-ui build + lint pass. Invariants: G2 (depth change is read-only), UI4 (PNG + detail errors surfaced, not swallowed). api:types post-deploy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -527,7 +527,7 @@ async def build_node_neighborhood(
|
||||
- ``pa:<token>`` — a practice-area hub; same as topic.
|
||||
"""
|
||||
types = normalize_node_types(node_types)
|
||||
depth = max(1, min(int(depth), 2))
|
||||
depth = max(1, min(int(depth), 3)) # BFS is still bounded by NODE_CAP_MAX
|
||||
prefix, _, rest = node_id.partition(":")
|
||||
rest = rest.strip()
|
||||
if prefix not in {"cl", "tag", "pa"} or not rest:
|
||||
|
||||
Reference in New Issue
Block a user