feat(graph): graph view with network, local, synapse, cluster and namespace modes

- synapse-ffi: graph_data() returns the whole page-level graph (links, tags,
  property refs, block refs/embeds per page, unlinked mentions, decayed
  synapses) as parallel arrays with degree, backlinks, Louvain clusters and
  primary tags; cached by op seq, synapse state and hour.
- synapse-ffi: ForceLayout, a Barnes-Hut force layout stepped from Dart on a
  Rust worker thread (pin/unpin for dragging, reheat).
- app: Graph view with a mode selector (Network, Local, Synapses, Clusters,
  Namespaces, Timeline), filters (title, tag, date range, min links,
  orphans, journals, mentions), pan/zoom, node drag, hover highlighting,
  activation pulse, cluster hulls, radial namespace/tag tree, and a local
  graph panel on every page. Edges render as one vertex mesh, nodes in
  colour/size batches, culled to the viewport.
- Tests: Rust extraction/mentions/cache/clusters/layout; widget tests for
  mode switching, filters and layout restarts; a real-app integration
  smoke test with frame timings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-21 15:39:07 +02:00
1 parent 6a4a76670b
commit e43452f5af
29 files changed
+6177 -76

No files matched your search

+20 -2
View File
@@ -8,7 +8,7 @@ import 'all_pages_view.dart';
import 'journals_view.dart';
import 'page_screen.dart';
import 'quick_switcher.dart';
import 'timeline_view.dart';
import 'graph_view.dart';
/// App frame: sidebar (navigation, recents, theme), top bar and the current view.
class Shell extends StatefulWidget {
@@ -51,6 +51,12 @@ class _ShellState extends State<Shell> {
shift: true,
): () =>
app.go(const JournalsRoute()),
const SingleActivator(
LogicalKeyboardKey.keyG,
control: true,
shift: true,
): () =>
app.go(const GraphRoute(GraphMode.network)),
const SingleActivator(
LogicalKeyboardKey.keyT,
control: true,
@@ -111,7 +117,13 @@ class _ShellState extends State<Shell> {
key: ValueKey((route, app.generation)),
child: switch (route) {
JournalsRoute() => const JournalsView(),
TimelineRoute() => const TimelineView(),
TimelineRoute() => const GraphView(
mode: GraphMode.timeline,
),
GraphRoute() => GraphView(
mode: route.mode,
focusId: route.focusId,
),
AllPagesRoute() => const AllPagesView(),
PageTarget() => PageScreen(target: route),
},
@@ -257,6 +269,12 @@ class _Sidebar extends StatelessWidget {
selected: route is JournalsRoute,
onTap: () => go(const JournalsRoute()),
),
_NavItem(
icon: Icons.hub_outlined,
label: 'Graph',
selected: route is GraphRoute,
onTap: () => go(const GraphRoute(GraphMode.network)),
),
_NavItem(
icon: Icons.timeline_rounded,
label: 'Timeline',