@@ -22,6 +22,7 @@ import {
2222import { Sidebar } from "./Sidebar" ;
2323import { FilterPanel } from "./FilterPanel" ;
2424import { NodeDetailPanel } from "./NodeDetailPanel" ;
25+ import { MissedCallout } from "./MissedCallout" ;
2526import { ResizeHandle } from "./ResizeHandle" ;
2627import { ErrorBoundary } from "./ErrorBoundary" ;
2728import type { GraphNode , GraphData , RepoInfo } from "../lib/types" ;
@@ -102,6 +103,12 @@ export function GraphTab({ project }: GraphTabProps) {
102103 const [ enabledLabels , setEnabledLabels ] = useState < Set < string > > ( new Set ( ) ) ;
103104 const [ enabledEdgeTypes , setEnabledEdgeTypes ] = useState < Set < string > > ( new Set ( ) ) ;
104105
106+ /* Missed skeleton (#963): the file structure of files the indexer could
107+ * not fully cover, shown as a white satellite cluster beside the code
108+ * galaxy. Toggle only hides/shows it — the data rides along with every
109+ * code-graph layout. */
110+ const [ showMissedSkeleton , setShowMissedSkeleton ] = useState ( true ) ;
111+
105112 /* Dead-code view: recolor by status + status-based filters */
106113 const [ deadCodeView , setDeadCodeView ] = useState ( false ) ;
107114 const [ showOnlyDead , setShowOnlyDead ] = useState ( false ) ;
@@ -190,6 +197,48 @@ export function GraphTab({ project }: GraphTabProps) {
190197 }
191198 } , [ project , budget , fetchOverview ] ) ;
192199
200+ /* Missed skeleton: offset into place and paint white — a ghost of the
201+ * files the graph could not fully cover, sitting beside the galaxy. */
202+ const missedSkeleton = useMemo ( ( ) => {
203+ const mg = data ?. missed_graph ;
204+ if ( ! mg || mg . nodes . length === 0 ) return null ;
205+ const nodes = mg . nodes . map ( ( n ) => ( {
206+ ...n ,
207+ x : n . x + mg . offset . x ,
208+ y : n . y + mg . offset . y ,
209+ z : n . z + mg . offset . z ,
210+ color : "#e9eef5" ,
211+ } ) ) ;
212+ return { nodes, edges : mg . edges , ids : new Set ( nodes . map ( ( n ) => n . id ) ) } ;
213+ } , [ data ] ) ;
214+
215+ /* Overview framing: both clusters (galaxy + skeleton) in one shot. */
216+ const overviewTarget = useMemo ( ( ) => {
217+ if ( ! data ) return null ;
218+ const all = missedSkeleton ? [ ...data . nodes , ...missedSkeleton . nodes ] : data . nodes ;
219+ return computeCameraTarget ( all , new Set ( all . map ( ( n ) => n . id ) ) ) ;
220+ } , [ data , missedSkeleton ] ) ;
221+
222+ /* With a skeleton beside the galaxy, auto-frame BOTH clusters on load so
223+ * the side-by-side composition is visible without manual zooming. */
224+ useEffect ( ( ) => {
225+ if ( missedSkeleton && overviewTarget ) {
226+ setCameraTarget ( overviewTarget ) ;
227+ }
228+ } , [ missedSkeleton , overviewTarget ] ) ;
229+
230+ /* Clicking empty space while the skeleton has focus flies back to the
231+ * overview (the galaxy may be entirely off-screen at that point, so there
232+ * is no code node to click). No-op during normal galaxy exploration. */
233+ const handleBackgroundClick = useCallback ( ( ) => {
234+ if ( selectedNode && missedSkeleton ?. ids . has ( selectedNode . id ) && overviewTarget ) {
235+ setSelectedNode ( null ) ;
236+ setHighlightedIds ( null ) ;
237+ setSelectedPath ( null ) ;
238+ setCameraTarget ( overviewTarget ) ;
239+ }
240+ } , [ selectedNode , missedSkeleton , overviewTarget ] ) ;
241+
193242 /* Fetch git remote metadata for GitHub deep-links */
194243 useEffect ( ( ) => {
195244 if ( ! project ) {
@@ -226,6 +275,19 @@ export function GraphTab({ project }: GraphTabProps) {
226275 const handleNodeClick = useCallback (
227276 ( node : GraphNode ) => {
228277 if ( ! filteredData ) return ;
278+
279+ /* Clicking the missed skeleton re-centers the camera on that whole
280+ * cluster (it's small — the natural focus unit is the skeleton, not a
281+ * single node); clicking any code node flies back to the code galaxy
282+ * via the normal per-node focus below. */
283+ if ( missedSkeleton ?. ids . has ( node . id ) ) {
284+ setSelectedNode ( node ) ;
285+ setHighlightedIds ( null ) ;
286+ setSelectedPath ( node . file_path ?? null ) ;
287+ setCameraTarget ( computeCameraTarget ( missedSkeleton . nodes , missedSkeleton . ids ) ) ;
288+ return ;
289+ }
290+
229291 setSelectedNode ( node ) ;
230292
231293 /* Highlight the node and its direct connections */
@@ -238,7 +300,7 @@ export function GraphTab({ project }: GraphTabProps) {
238300 setSelectedPath ( node . file_path ?? null ) ;
239301 setCameraTarget ( computeCameraTarget ( filteredData . nodes , connectedIds ) ) ;
240302 } ,
241- [ filteredData ] ,
303+ [ filteredData , missedSkeleton ] ,
242304 ) ;
243305
244306 const handleNavigateToNode = useCallback (
@@ -351,6 +413,9 @@ export function GraphTab({ project }: GraphTabProps) {
351413 onToggleShowOnlyDead = { ( ) => setShowOnlyDead ( ( v ) => ! v ) }
352414 onToggleHideEntryPoints = { ( ) => setHideEntryPoints ( ( v ) => ! v ) }
353415 onToggleHideTests = { ( ) => setHideTests ( ( v ) => ! v ) }
416+ missedView = { showMissedSkeleton }
417+ missedCount = { data ?. missed_graph ?. nodes . filter ( ( n ) => n . label === "File" ) . length ?? 0 }
418+ onToggleMissedView = { ( ) => setShowMissedSkeleton ( ( v ) => ! v ) }
354419 />
355420 < Sidebar
356421 nodes = { filteredData . nodes }
@@ -385,11 +450,13 @@ export function GraphTab({ project }: GraphTabProps) {
385450 < ErrorBoundary >
386451 < GraphScene
387452 data = { filteredData }
453+ missed = { showMissedSkeleton ? missedSkeleton : null }
388454 highlightedIds = { highlightedIds }
389455 cameraTarget = { cameraTarget }
390456 showLabels = { showLabels }
391457 display = { display }
392458 onNodeClick = { handleNodeClick }
459+ onBackgroundClick = { handleBackgroundClick }
393460 />
394461 </ ErrorBoundary >
395462
@@ -490,19 +557,34 @@ export function GraphTab({ project }: GraphTabProps) {
490557 className = "border-l border-border shrink-0 h-full overflow-hidden"
491558 style = { { width : rightWidth , maxHeight : "100%" } }
492559 >
493- < NodeDetailPanel
494- node = { selectedNode }
495- allNodes = { filteredData . nodes }
496- allEdges = { filteredData . edges }
497- project = { project }
498- repoInfo = { repoInfo }
499- onClose = { ( ) => {
500- setSelectedNode ( null ) ;
501- setHighlightedIds ( null ) ;
502- setSelectedPath ( null ) ;
503- } }
504- onNavigate = { handleNavigateToNode }
505- />
560+ { missedSkeleton ?. ids . has ( selectedNode . id ) ? (
561+ /* Skeleton node: the standard panel (code snippet, callers) is
562+ * meaningless for a not-fully-indexed file — show the coverage
563+ * callout with its report-the-edge-case actions instead. */
564+ < MissedCallout
565+ node = { selectedNode }
566+ project = { project }
567+ onClose = { ( ) => {
568+ setSelectedNode ( null ) ;
569+ setHighlightedIds ( null ) ;
570+ setSelectedPath ( null ) ;
571+ } }
572+ />
573+ ) : (
574+ < NodeDetailPanel
575+ node = { selectedNode }
576+ allNodes = { filteredData . nodes }
577+ allEdges = { filteredData . edges }
578+ project = { project }
579+ repoInfo = { repoInfo }
580+ onClose = { ( ) => {
581+ setSelectedNode ( null ) ;
582+ setHighlightedIds ( null ) ;
583+ setSelectedPath ( null ) ;
584+ } }
585+ onNavigate = { handleNavigateToNode }
586+ />
587+ ) }
506588 </ div >
507589 </ >
508590 ) }
0 commit comments