MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / visibleSections

Function visibleSections

graph-ui/src/twin/render-model.ts:477–500  ·  view source on GitHub ↗
(ir: SemanticIR, presentation: ResolvedPresentation)

Source from the content-addressed store, hash-verified

475 * deciding it in one place keeps the depths from disagreeing about it.
476 */
477export function visibleSections(ir: SemanticIR, presentation: ResolvedPresentation): TwinSection[] {
478 const labels = labelsFor(presentation.terminology);
479 const sections: TwinSection[] = buildSections(ir)
480 .filter(section => sectionVisible(section.name, presentation.facets))
481 .filter(section => section.populated || section.emptyText.length > 0)
482 .map(section => ({
483 ...section,
484 title: labels[section.name] ?? section.title,
485 icon: SECTION_ICONS[section.name]
486 }));
487 for (const spec of PLACEHOLDER_SECTIONS) {
488 if (!presentation.facets.has(spec.facet)) {
489 continue;
490 }
491 // A lens with something behind it renders what is behind it. The
492 // placeholder is the fallback and not the default: a reader who has
493 // imported a recording must not be told the lens is unbuilt.
494 const answered = spec.name === 'runtime' ? runtimeSection(ir) : undefined;
495 sections.push(answered === undefined
496 ? placeholderSection(spec, labels)
497 : { ...answered, title: labels[answered.name] ?? answered.title, icon: SECTION_ICONS[answered.name] });
498 }
499 return sections;
500}
501
502/**
503 * The same body, with the file's imports folded into the DATA block.

Callers 5

technicalFunction · 0.85
juniorFunction · 0.85
seniorFunction · 0.85
architectFunction · 0.85

Calls 6

buildSectionsFunction · 0.90
runtimeSectionFunction · 0.90
labelsForFunction · 0.85
sectionVisibleFunction · 0.85
placeholderSectionFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected