Reuse evidence-bearing rows without the legacy reader levels or model controls.
(props: {
section: TwinSection;
openEvidence?: string;
entriesFor: (path: string) => Evidence[];
onToggleEvidence: (path: string) => void;
onFollow: (symbol: SymbolRef) => void;
onPointRow?: (row: TwinRow | undefined) => void;
})
| 72 | |
| 73 | /** Reuse evidence-bearing rows without the legacy reader levels or model controls. */ |
| 74 | function FactDisclosure(props: { |
| 75 | section: TwinSection; |
| 76 | openEvidence?: string; |
| 77 | entriesFor: (path: string) => Evidence[]; |
| 78 | onToggleEvidence: (path: string) => void; |
| 79 | onFollow: (symbol: SymbolRef) => void; |
| 80 | onPointRow?: (row: TwinRow | undefined) => void; |
| 81 | }) { |
| 82 | const title = SECTION_TITLES[props.section.name] ?? props.section.title; |
| 83 | const unavailable = unavailableText(props.section); |
| 84 | const section: TwinSection = { |
| 85 | ...props.section, |
| 86 | title, |
| 87 | // Missing answers must never inherit a checked-empty sentence. |
| 88 | emptyText: unavailable ?? props.section.emptyText, |
| 89 | ...(props.section.name === 'tests' |
| 90 | ? { note: 'Links inferred from indexed callers; these are not test results or measured coverage.' } |
| 91 | : {}), |
| 92 | }; |
| 93 | return ( |
| 94 | <details className="selected-code-fact" data-section={section.name}> |
| 95 | <summary> |
| 96 | <span>{title}</span> |
| 97 | <span className="selected-code-count">{sectionSummary(section)}</span> |
| 98 | </summary> |
| 99 | <SectionView |
| 100 | section={section} |
| 101 | voiceOf={() => undefined} |
| 102 | openEvidence={props.openEvidence} |
| 103 | entriesFor={props.entriesFor} |
| 104 | onToggleEvidence={props.onToggleEvidence} |
| 105 | onActivate={(row) => { if (row.target) props.onFollow(row.target); }} |
| 106 | onPoint={props.onPointRow} |
| 107 | /> |
| 108 | </details> |
| 109 | ); |
| 110 | } |
| 111 | |
| 112 | export default function SelectedCodePanel(props: SelectedCodePanelProps) { |
| 113 | const { filePath, symbol, selection, ir, imports } = props; |
nothing calls this directly
no test coverage detected