Show only the knowledge base and content in the knowledge graph

The graph now represents the agent's Brain: its documents and the
content made from them. Work in progress, failed runs, research
suggestions and schedules are status, so they are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Iqbal
2026-10-29 11:51:04 +07:00
parent 643c3c39f9
commit bdae539e9e
5 changed files with 39 additions and 58 deletions

View File

@@ -13,7 +13,7 @@ import { locale, t, type Key } from '../i18n'
import { ContentCard, Preview } from './Results'
const HUB_LABEL: Record<Cluster, Key> = {
sources: 'prod.hub.sources', made: 'prod.hub.made', working: 'prod.hub.working', research: 'prod.hub.research', schedules: 'prod.hub.schedules',
sources: 'prod.hub.sources', made: 'prod.hub.made',
}
// Uses the Fullscreen API on the whole stage (graph + panel); where it is missing (iPhone Safari)
@@ -67,10 +67,8 @@ export function ProductionPage() {
// No LMS is connected yet: an approved SCORM module is the package that goes into one.
const lms = materials.filter(m => m.status === 'accepted' && m.kind === 'scorm')
const graph = useMemo(
() => (docs.data && results.data && schedules.data
? buildGraph({ docs: docs.data, materials: results.data.materials, sources: results.data.sources, schedules: schedules.data }, c => t(HUB_LABEL[c]))
: null),
[docs.data, results.data, schedules.data],
() => (docs.data && results.data ? buildGraph({ docs: docs.data, materials: results.data.materials }, c => t(HUB_LABEL[c])) : null),
[docs.data, results.data],
)
const num = (n: number, ready: boolean, unit: Key) => (ready
@@ -297,7 +295,7 @@ function KnowledgeGraph({ graph }: { graph: Graph }) {
</g>
<g>
{graph.nodes.map((n, i) => {
const r = n.hub ? 9 : n.cluster === 'schedules' ? 5.5 : 3.2 + Math.min(3, (degree.get(n.id) ?? 0) * 0.7)
const r = n.hub ? 9 : 3.2 + Math.min(3, (degree.get(n.id) ?? 0) * 0.7)
return (
<g key={n.id} ref={el => { nodeEls.current[i] = el }}
className={`graph-node c-${n.cluster}${n.hub ? ' hub' : ''}${neighbours && !neighbours.has(n.id) ? ' dim' : ''}${hover === n.id ? ' hover' : ''}${selected?.id === n.id ? ' sel' : ''}`}