Local graph panel on the page editor #113

Closed
opened 2026-07-14 09:32:45 +02:00 by fable-5 · 1 comment
Collaborator

Context

Besides the pond-wide view, the currently open page gets a small neighborhood graph (direct neighbors, optionally two hops) as a side panel next to the existing Labels/History/Backlinks panels.

Scope

  • Extract the SVG graph renderer from the pond graph view into a reusable component.
  • Compute the 1–2-hop neighborhood client-side from the cached GET /ponds/:id/links response (BFS; no extra endpoint — ponds are small and the query is cached).
  • Panel in the editor-page__panels column of apps/web/src/pages/PageEditorPage.tsx (pattern: apps/web/src/links/BacklinksPanel.tsx), collapsible like the other panels; hop-depth toggle (1/2); the current page visually distinct (e.g. ring); phantoms included dashed.
  • Hidden when the page has no links in either direction. i18n via the graph namespace.

Acceptance criteria

  • Panel shows direct neighbors (in- and outgoing) and, on toggle, second-hop pages; click navigates.
  • Current page is visually highlighted; phantom neighbors render dashed.
  • Panel absent for link-less pages and for anonymous public view (panels are editor-only already).

Technical notes

  • Keep the renderer prop-driven (nodes/edges/highlight) so pond view and panel share it without coupling.

Dependencies

Requires #112.

Size

~1 day.

## Context Besides the pond-wide view, the currently open page gets a small neighborhood graph (direct neighbors, optionally two hops) as a side panel next to the existing Labels/History/Backlinks panels. ## Scope - Extract the SVG graph renderer from the pond graph view into a reusable component. - Compute the 1–2-hop neighborhood **client-side** from the cached `GET /ponds/:id/links` response (BFS; no extra endpoint — ponds are small and the query is cached). - Panel in the `editor-page__panels` column of `apps/web/src/pages/PageEditorPage.tsx` (pattern: `apps/web/src/links/BacklinksPanel.tsx`), collapsible like the other panels; hop-depth toggle (1/2); the current page visually distinct (e.g. ring); phantoms included dashed. - Hidden when the page has no links in either direction. i18n via the `graph` namespace. ## Acceptance criteria - [ ] Panel shows direct neighbors (in- and outgoing) and, on toggle, second-hop pages; click navigates. - [ ] Current page is visually highlighted; phantom neighbors render dashed. - [ ] Panel absent for link-less pages and for anonymous public view (panels are editor-only already). ## Technical notes - Keep the renderer prop-driven (nodes/edges/highlight) so pond view and panel share it without coupling. ## Dependencies Requires #112. ## Size ~1 day.
fable-5 added this to the M12 — Page hierarchy & knowledge graph milestone 2026-07-14 09:32:45 +02:00
fable-5 added the
frontend
label 2026-07-14 09:32:45 +02:00
Author
Collaborator

Implemented in a72cb1b. A collapsible "Local graph" panel joins the backlinks below the content in read mode: the current page (highlight ring) with its wikilink neighborhood, switchable between one and two hops — computed client-side by BFS over the cached pond-wide graph query (shared with #112, no second endpoint). Phantoms render dashed, clicks navigate, link-less pages show no panel.

Implemented in a72cb1b. A collapsible "Local graph" panel joins the backlinks below the content in read mode: the current page (highlight ring) with its wikilink neighborhood, switchable between one and two hops — computed client-side by BFS over the cached pond-wide graph query (shared with #112, no second endpoint). Phantoms render dashed, clicks navigate, link-less pages show no panel.
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stwaidele/dorfteich#113
No description provided.