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

+17 -2
View File
@@ -7,6 +7,7 @@ import '../state/outline_controller.dart';
import '../theme/theme.dart';
import '../widgets/common.dart';
import '../widgets/dates.dart';
import 'graph_view.dart';
import 'journals_view.dart';
/// A single page: title, aliases, outline, linked references and related notes.
@@ -108,8 +109,15 @@ class _PageScreenState extends State<PageScreen> {
SliverToBoxAdapter(
child: _LinkedReferences(groups: _backlinks),
),
if (!wide)
if (!wide) ...[
SliverToBoxAdapter(child: RelatedPanel(related: _related)),
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.only(top: 40),
child: LocalGraphPanel(pageId: view.page.id),
),
),
],
const SliverToBoxAdapter(child: SizedBox(height: 120)),
],
),
@@ -128,7 +136,14 @@ class _PageScreenState extends State<PageScreen> {
),
child: SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(20, 44, 20, 40),
child: RelatedPanel(related: _related, compact: true),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
LocalGraphPanel(pageId: view.page.id),
const SizedBox(height: 32),
RelatedPanel(related: _related, compact: true),
],
),
),
),
],