Add the missing d3-transition dependency + import so graph-island's zoom transitions animate (and astro check reaches zero)

task-graph-island-d3-transition-dep

task confidence verified status done 2026-06-16 owner starlight-engineer
source log-auditor — surfaced recording DEC-0038; the FDE flagged graph-island.ts's 4 ts(2339) transition errors as pre-existing/unrelated and out of scope (adding a dep), with no durable home. CLOSED in the ClientRouter-survival / shared-ThemeInit pass (same commit) — see Outcome below.

Add the missing d3-transition dep so graph-island's zoom transitions animate

Site chrome unified into shared SiteHeader + SiteFooter + ThemeToggle components, and the docs/KB surface made fully open — DEC-0022's DOCS_ENABLED landing-only gate is removed so /knowledge ships publicly alongside the landing/board/graph wired pages/graph.astro into the shared site chrome and fixed a NUL-byte parse bug so the graph compiles. While verifying, the FDE found astro check was clean on every file touched — but 4 errors remain in src/lib/graph-island.ts, pre-existing and unrelated to the chrome work.

The gap

graph-island.ts calls .transition() on a d3 selection (the zoom-button animation), but d3-transition is imported by neither the file nor packages/site/package.json — the deps are only d3-force / d3-selection / d3-zoom / d3-drag. d3's .transition() is added to selection.prototype by the d3-transition module's side effect; without it the call is untyped (the 4 ts(2339) Property 'transition' does not exist errors) and, at runtime, a no-op — so the graph renders but the zoom buttons jump instead of animating.

The fix

  • Add d3-transition (+ @types/d3-transition) to packages/site/package.json.
  • import 'd3-transition'; at the top of graph-island.ts (or wherever the selection/zoom is created) so the prototype augmentation + types are present.

Why a task, not a fix-in-place

Adding a dependency is the graph work-stream's call, not a one-token hygiene edit, and it was explicitly out of scope for DEC-0038. Routed to the Astro Starlight Engineer (owns the site/graph surface). Provenance: surfaced by the log-auditor recording DEC-0038; originally confidence: inferred (agent-verified against astro check output + package.json, not human-curated). Board globbed before filing — no open task covered the d3-transition gap.

Outcome (done) — verified

Closed during the ClientRouter-survival / shared-ThemeInit UX pass:

  • d3-transition added as a direct dependency (^3.0.0) and @types/d3-transition as a devDependency (^3.0.9) in packages/site/package.json; pnpm install linked them (the runtime module was already present transitively via d3-zoom, now declared honestly).
  • import 'd3-transition'; added at the top of graph-island.ts (with a comment): the bare side-effect import is REQUIRED because the types ship as a declare module 'd3-selection' augmentation that only applies when the module is actually imported — pnpm's @types auto-include did not pick it up.
  • pnpm --filter @dossier/site check → 0 errors (the 4 ts(2339) errors are gone) — acceptance #1 and #2 met and verified.
  • Acceptance #3: .transition() is now both typed and explicitly loaded. Note — the runtime calls were already functional via the transitive d3-zoom → d3-transition import (the graph was browser-verified rendering 70 nodes / 331 edges with working zoom under ClientRouter nav); the explicit import HARDENS this so it no longer depends on another package's import order. The literal zoom-button click animation was not re-clicked in this pass.

Kept on the board as done (not deleted) — ids are permanent addresses; the completed-work record stays legible.