feat(extension): live-layout CSP fix + scatter-then-organize settle + structural radial Circular - #170
Conversation
…out animates THE reason nodes were static: the webview CSP was default-src 'none' with no worker-src. graphology's FA2LayoutSupervisor creates its Web Worker from a Blob URL; with no worker-src the browser falls back to child-src → default-src 'none' and CSP-blocks the worker. The supervisor threw on construction, the try/catch swallowed it, and the graph silently fell back to the static seed layout — so no animation ever ran. Add 'worker-src blob:' to the CSP. Sigma already auto-refreshes on graph node-attr updates (bindGraphHandlers → scheduleRefresh), so once the worker ticks positions the canvas repaints → live settle. Added an html.test assertion so the directive can't silently regress.
…acing Lively: the graph was pre-solved (200 FA2 iterations) before first paint, so the live worker had nothing left to animate — 'moves but feels dead'. Now when the live worker will run, the seed is a light 8-iteration warm-up (grouped but loose) and the worker visibly ORGANIZES it; slowDown 3→1 makes per-tick motion energetic; run window 2.5s→3.5s. Full 200-iter pre-solve kept only for the no-worker static fallback. Cleaner spacing (both views): main-view FA2 scalingRatio 6→8 spreads nodes wider (less tangle). Focused view: ring radius now grows with node count (min arc per card) so dense rings expand outward instead of packing cards on top of each other; base ring spacing 220→280. extension 668.
…ves on the rim The Circular preset was a flat single ring (all nodes equidistant, arbitrary order) — not the GitNexus-style structured circle. Rework it into a concentric radial layout driven by graph role: - leaves (outDegree 0) → outermost ring - hubs (high in-degree + entry-point bonus) → innermost rings - others ranked between by in-degree, spread across the inner rings Within each ring, nodes are ordered by the mean angle of their already-placed inner neighbours so ring→ring edges run centre→out (radial), which minimises crossings (cannot eliminate them for non-planar graphs). Ring radius grows with node count (min arc per node) so dense rings expand outward instead of stacking. Also aligned the preset-file FA2 settings (scalingRatio 8) with the tuned mount settings so re-applying ForceAtlas2 matches the initial layout. extension 669 (+ a test asserting hubs land more central than leaves).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughSummaryUser-visible / reviewer-relevant changes:
Risks:
Validation:
Package/schema impact:
WalkthroughFive files updated across focused-card layout geometry, circular preset redesign, ForceAtlas2 seeding tuning, and Content Security Policy. Ring-based placement now dynamically expands for node density; circular preset applies role-based concentric rings instead of flat placement; mount-time warm-up iterations adapt to worker availability; and CSP explicitly permits blob-backed workers. ChangesRadial layout and preset geometry
ForceAtlas2 worker-aware tuning and enablement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Circular preset redesign is dense logic with new ring assignment, centrality scoring, and coordinate math. Focused layout and FA2 tuning are straightforward constant/parameter changes. CSP is minimal. Geometry changes are semantically independent but interrelated in observable behavior. Requires tracing radial placement logic and validating hub/leaf ordering. Possibly related PRs
Suggested labels
Comment |
Summary
Three graph-UX follow-ups to PR #169 (graph overhaul). Webview-only; no core/host/contract change. extension 669 green.
Commits
03d8db9fix: worker-src blob: in webview CSP — THE reason the live layout never animated:default-src 'none'with noworker-srcCSP-blocked the FA2 Web Worker (blob URL), so it silently fell back to a static seed. Added the directive + a regression test.852e86flivelier settle (scatter-then-organize) — we pre-solved 200 FA2 iterations before first paint, so the worker had nothing to animate ('moves but feels dead'). Now an 8-iteration warm-up + the worker visibly organizes; slowDown 3→1 (energetic), run 2.5s→3.5s. Plus scalingRatio 6→8 for wider main-view spacing.58836ebstructural radial Circular — the flat single-ring Circular is now concentric-by-role: hubs at the centre (in-degree + entry-point), leaves on the rim, ring radius grows with node count, ring order minimises edge crossings.Test plan
pnpm checkgreen: core 282 / exporters 161 / extension 669🤖 Generated with Claude Code