/** * The overview body: one plain box with the resolved background (design §5). * * At 500 nodes and zoom 0.2, a Tamagui body per node is 500 knob resolutions, * 500 subtrees and 500 observer callbacks to paint something the size of a * postage stamp. This is what a consumer swaps in instead, and it is also what * the merged single-path edge layer will sit behind in v1.1. * * The load-bearing part is not the div, it is the MEASURE. Width and minimum * height come from `nodeMeasure.ts` — the same recipe `GraphNode` uses, given * the same knobs and the same ports — so swapping the body cannot change the * node's box, and React Flow's per-node `ResizeObserver` has nothing to report. * A "small grey rectangle" here would move every edge endpoint on the canvas * the moment a user zoomed out, which is the failure design §5 is written * against. * * `lod.spec.tsx` asserts the box against `GraphNode`'s rather than against a * number, so the two cannot drift. */ import { useResolvedKnobs } from "@multiplatform.one/theme"; import { YStack } from "tamagui"; import type { GraphNodeMeasure, GraphNodePort } from "./nodeMeasure"; import { graphNodeMinHeight, graphNodeWidth, portSpacing, graphNodeSize } from "./nodeMeasure"; export interface OverviewNodeProps { readonly id: string; /** Same ports the detail body would render. They set the height floor. */ readonly ports?: readonly GraphNodePort[]; /** Semantic intent — reaches the resolver, never a colour prop. */ readonly intent?: string; readonly selected?: boolean; /** `NodeKindSpec.measure`; falls back to the per-kind default table. */ readonly measure?: Partial; /** true on a touch surface — widens the port pitch, raising the floor. */ readonly coarsePointer?: boolean; } export function OverviewNode({ id, ports, intent, selected = false, measure, coarsePointer = false, }: OverviewNodeProps) { // The same resolver call the detail body makes, so the fill is the fill the // user was just looking at rather than a second grey invented here. const { knobProps } = useResolvedKnobs({ component: "GraphNode", intent }); const size = graphNodeSize(knobProps.sizeToken); const portSpacingPx = portSpacing({ coarsePointer }); return ( ); }