Skip to content

Commit 660b90d

Browse files
committed
feat(ui): report-an-edge-case callout when the missed skeleton is selected
Clicking a node of the missed skeleton now opens a dedicated right-panel callout instead of the standard node panel (code snippet and callers/callees are meaningless for a not-fully-indexed file): - explains the gap in plain words (best-effort detection; the file content itself is ground truth) - asks the user to have their agent summarize what fails to parse and report it upstream so the edge case can be handled - two working actions: a prefilled upstream GitHub issue (title 'Indexing gap: <file>'; body carries ONLY the file path and project name, with an explicit add-snippets-only-if-shareable note) and a copy-to-clipboard agent prompt (index_status -> summarize flagged ranges -> file the issue) with visible copied feedback Verified in the browser: skeleton click opens the callout with both actions; frontend build + tests green. Refs DeusData#963 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 545971c commit 660b90d

2 files changed

Lines changed: 151 additions & 13 deletions

File tree

‎graph-ui/src/components/GraphTab.tsx‎

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
import { Sidebar } from "./Sidebar";
2323
import { FilterPanel } from "./FilterPanel";
2424
import { NodeDetailPanel } from "./NodeDetailPanel";
25+
import { MissedCallout } from "./MissedCallout";
2526
import { ResizeHandle } from "./ResizeHandle";
2627
import { ErrorBoundary } from "./ErrorBoundary";
2728
import type { GraphNode, GraphData, RepoInfo } from "../lib/types";
@@ -556,19 +557,34 @@ export function GraphTab({ project }: GraphTabProps) {
556557
className="border-l border-border shrink-0 h-full overflow-hidden"
557558
style={{ width: rightWidth, maxHeight: "100%" }}
558559
>
559-
<NodeDetailPanel
560-
node={selectedNode}
561-
allNodes={filteredData.nodes}
562-
allEdges={filteredData.edges}
563-
project={project}
564-
repoInfo={repoInfo}
565-
onClose={() => {
566-
setSelectedNode(null);
567-
setHighlightedIds(null);
568-
setSelectedPath(null);
569-
}}
570-
onNavigate={handleNavigateToNode}
571-
/>
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+
)}
572588
</div>
573589
</>
574590
)}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
import { useEffect, useState } from "react";
2+
import type { GraphNode } from "../lib/types";
3+
4+
/* Upstream tracker for indexing gaps — issues land on the codebase-memory-mcp
5+
* project itself (the tool that failed to index), never the user's repo. */
6+
const UPSTREAM_ISSUES_URL = "https://github.com/DeusData/codebase-memory-mcp/issues/new";
7+
8+
interface MissedCalloutProps {
9+
node: GraphNode;
10+
project: string | null;
11+
onClose: () => void;
12+
}
13+
14+
function buildIssueUrl(path: string, project: string | null): string {
15+
const title = `Indexing gap: ${path}`;
16+
const body = [
17+
"## Not fully indexed (best-effort coverage signal)",
18+
"",
19+
`- **File:** \`${path}\``,
20+
`- **Project:** \`${project ?? "unknown"}\``,
21+
"",
22+
"<!-- Please add: the flagged line ranges from index_status (parse_partial),",
23+
"the language and the construct that fails to parse, and a minimal snippet",
24+
"of the affected code — ONLY if the code is shareable. -->",
25+
"",
26+
"_Reported from the graph UI's missed-coverage view._",
27+
].join("\n");
28+
return `${UPSTREAM_ISSUES_URL}?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}`;
29+
}
30+
31+
function buildAgentPrompt(path: string, project: string | null): string {
32+
return (
33+
`codebase-memory-mcp could not fully index \`${path}\`` +
34+
(project ? ` (project \`${project}\`)` : "") +
35+
" — best-effort coverage signal. Please: " +
36+
"1) call the index_status MCP tool and note this file's flagged line ranges under parse_partial; " +
37+
"2) read those ranges in the file and summarize which construct fails to parse; " +
38+
`3) file a GitHub issue at ${UPSTREAM_ISSUES_URL} titled "Indexing gap: ${path}" ` +
39+
"with the summary — include a minimal reproducible snippet ONLY if the code is shareable."
40+
);
41+
}
42+
43+
/* Right-panel callout shown when a missed-skeleton node is selected: explains
44+
* the gap and offers two working actions — a prefilled upstream issue and a
45+
* ready-made agent prompt (clipboard, with visible feedback). */
46+
export function MissedCallout({ node, project, onClose }: MissedCalloutProps) {
47+
const path = node.file_path || node.name;
48+
const [copied, setCopied] = useState(false);
49+
50+
useEffect(() => {
51+
if (!copied) return;
52+
const t = setTimeout(() => setCopied(false), 2000);
53+
return () => clearTimeout(t);
54+
}, [copied]);
55+
56+
const copyPrompt = async () => {
57+
try {
58+
await navigator.clipboard.writeText(buildAgentPrompt(path, project));
59+
setCopied(true);
60+
} catch {
61+
/* clipboard unavailable (permissions/insecure context) — leave the
62+
* button state unchanged so the failure is visible, not silent */
63+
}
64+
};
65+
66+
return (
67+
<div className="h-full flex flex-col p-4 gap-3 overflow-y-auto">
68+
<div className="flex items-start justify-between">
69+
<div>
70+
<p className="text-[10px] text-foreground/30 uppercase tracking-widest">
71+
Not fully indexed
72+
</p>
73+
<p className="text-sm font-medium text-foreground/90 break-all mt-1">{path}</p>
74+
<p className="text-[10px] text-foreground/40 mt-0.5">{node.label}</p>
75+
</div>
76+
<button
77+
onClick={onClose}
78+
className="text-foreground/40 hover:text-foreground/80 text-sm px-1"
79+
aria-label="Close"
80+
>
81+
×
82+
</button>
83+
</div>
84+
85+
<p className="text-[12px] leading-relaxed text-foreground/70">
86+
We did not manage to fully index this part of your code — constructs here may be
87+
missing from the graph (best-effort detection; the file content itself is ground
88+
truth).
89+
</p>
90+
<p className="text-[12px] leading-relaxed text-foreground/70">
91+
Help us handle this edge case too: let your agent summarize what fails to parse
92+
here and file a GitHub issue for the codebase-memory-mcp project.
93+
</p>
94+
95+
<div className="flex flex-col gap-2 mt-1">
96+
<button
97+
onClick={copyPrompt}
98+
className={`text-[12px] font-medium rounded-md border px-3 py-1.5 transition-all text-left ${
99+
copied
100+
? "border-primary/60 bg-primary/15 text-primary"
101+
: "border-white/10 bg-white/[0.03] text-foreground/80 hover:bg-white/[0.07]"
102+
}`}
103+
>
104+
{copied ? "✓ Copied — paste it to your agent" : "Copy agent prompt"}
105+
</button>
106+
<a
107+
href={buildIssueUrl(path, project)}
108+
target="_blank"
109+
rel="noreferrer"
110+
className="text-[12px] font-medium rounded-md border border-white/10 bg-white/[0.03] text-foreground/80 hover:bg-white/[0.07] px-3 py-1.5 transition-all"
111+
>
112+
File a GitHub issue (prefilled) ↗
113+
</a>
114+
</div>
115+
116+
<p className="text-[10px] leading-snug text-foreground/35 mt-1">
117+
The prefilled issue contains only the file path and project name — add code
118+
snippets only if they are shareable.
119+
</p>
120+
</div>
121+
);
122+
}

0 commit comments

Comments
 (0)